Steply

Solve x + y + z = 0, x - 2y + z = -6, 2x + y - z = 5 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 = 0, x − 2y + z = −6 and 2x + y − z = 5 by Gaussian elimination.

x + y + z = 0①
x − 2y + z = −6②

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

2x + y − z = 5③

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, 0; 1, −2, 1, −6; 2, 1, −1, 5]

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, 0; 0, −3, 0, −6; 0, −1, −3, 5]

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 a 1 in row 2

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

4 Get 0s under the 1 in column 2

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

5 Get a 1 in row 3

→ [1, 1, 1, 0; 0, 1, 0, 2; 0, 0, 1, −7 over 3]

6 Back substitution

Start at the bottom.

Each row is an equation again.

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

So z = −7/3.

z = −73

Each row is an equation again.

Row 2 is 1y = 2.

So y = 2.

y = 2

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

x + y + z = 0

We know y = 2 and z = −7/3.

We put them in.

x + 2 + (−73) = 0

Work it out: x − 1/3 = 0.

x − 13 = 0

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

x − 13 + 13 = 0 + 13

So x = 1/3.

x = 13

We write it as (1/3, 2, −7/3).

(x, y, z) = (13, 2, −73)

7 Check

Let's check in every equation.

We put x = 1/3, y = 2, z = −7/3 into ①.

① (13) + 2 + (−73) = 13 + 2 − 73 = 0

We get 0, the same as the right side.

Now ②.

② (13) − 2(2) + (−73) = 13 − 4 − 73 = −6

We get −6, the same as the right side.

Now ③.

③ 2(13) + 2 − (−73) = 23 + 2 + 73 = 5

We get 5, 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 a 1 in row 2.

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) = (13, 2, −73)

Your turn

Try this one yourself, then check:

Solve x + y + z = 2, x − 3y + z = −10, 2x + y − z = 13
Show the answer
(x, y, z) = (3, 3, −4)

More from Gaussian elimination

The whole lesson: Gaussian elimination →