Steply

Solve x + y + z = 4, 2x + 3y + z = 9, x - y + 2z = 1 by gaussian…

Step by step, with the reason for every step · Gaussian elimination · Algebra 2

Step by step

The question

Question: solve x + y + z = 4, 2x + 3y + z = 9 and x − y + 2z = 1 by Gaussian elimination.

x + y + z = 4①
2x + 3y + z = 9②

We want the x, y and z that make all three true.

x − y + 2z = 1③

We will use three moves on the rows.

Swap two rows.

Times a row by a number that is not 0.

Add a multiple of one row to another.

Each move keeps the equations true, like in elimination.

swap two rows
× a row by a number (not 0)
add a multiple of one row to another

1 Write the augmented matrix

Each row is one equation: the numbers in front of x, y and z, then the number on the right.

The bar stands for the = signs.

This is called an augmented matrix.

= [1, 1, 1, 4; 2, 3, 1, 9; 1, −1, 2, 1]

We call the rows R 1, R 2 and R 3.

Our goal: 1s down the diagonal, and 0s under them.

This shape is called row-echelon form.

Then we go back up, one letter at a time.

goal: 1s down the diagonal, 0s under them

2 Get 0s under the 1 in column 1

→ [1, 1, 1, 4; 0, 1, −1, 1; 0, −2, 1, −3]

Careful!

A row move works on the whole row, the number after the bar too.

That number is the right side of the equation.

Careful: the whole row, after the bar too

3 Get 0s under the 1 in column 2

→ [1, 1, 1, 4; 0, 1, −1, 1; 0, 0, −1, −1]

4 Get a 1 in row 3

→ [1, 1, 1, 4; 0, 1, −1, 1; 0, 0, 1, 1]

5 Back substitution

Start at the bottom.

Each row is an equation again.

Row 3 is 1z = 1, with 0 for the other letters.

So z = 1.

z = 1

Row 2 is the equation y − z = 1.

y − z = 1

We know z = 1.

We put it in.

y − 1 = 1

Work it out: y − 1 = 1.

y − 1 = 1

To remove the − 1, we add 1 on both sides.

y − 1 + 1 = 1 + 1

So y = 2.

y = 2

Row 1 is the equation x + y + z = 4.

x + y + z = 4

We know y = 2 and z = 1.

We put them in.

x + 2 + 1 = 4

Work it out: x + 3 = 4.

x + 3 = 4

To remove the + 3, we take away 3 on both sides.

x + 3 − 3 = 4 − 3

So x = 1.

x = 1

We write it as (1, 2, 1).

(x, y, z) = (1, 2, 1)

6 Check

Let's check in every equation.

We put x = 1, y = 2, z = 1 into ①.

① 1 + 2 + 1 = 4

We get 4, the same as the right side.

Now ②.

② 2(1) + 3(2) + 1 = 2 + 6 + 1 = 9

We get 9, the same as the right side.

Now ③.

③ 1 − 2 + 2(1) = 1 − 2 + 2 = 1

We get 1, the same as the right side.

All of them work.

So the answer is right!

Let's look back.

First: write the augmented matrix.

Then: get 0s under the 1 in column 1.

Then: get 0s under the 1 in column 2.

Then: get a 1 in row 3.

Then: back substitution.

Last: check.

Answer
(x, y, z) = (1, 2, 1)

Your turn

Try this one yourself, then check:

Solve x + y + z = 9, 3x + 4y + z = 26, x − y + 2z = 5
Show the answer
(x, y, z) = (4, 3, 2)

More from Gaussian elimination

The whole lesson: Gaussian elimination →