Steply

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

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

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

x + 3y + 2z = 9③

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; 2, −1, 1, 6; 1, 3, 2, 9]

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, 3, 6; 0, 2, 3, 9]

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, −1, −2; 0, 2, 3, 9]

4 Get 0s under the 1 in column 2

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

5 Get a 1 in row 3

→ [1, 1, −1, 0; 0, 1, −1, −2; 0, 0, 1, 13 over 5]

6 Back substitution

Start at the bottom.

Each row is an equation again.

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

So z = 13/5.

z = 135

Row 2 is the equation y − z = −2.

y − z = −2

We know z = 13/5.

We put it in.

y − 135 = −2

Work it out: y − 13/5 = −2.

y − 135 = −2

To remove the − 13/5, we add 13/5 on both sides.

y − 135 + 135 = −2 + 135

So y = 3/5.

y = 35

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

x + y − z = 0

We know y = 3/5 and z = 13/5.

We put them in.

x + 35 − 135 = 0

Work it out: x − 2 = 0.

x − 2 = 0

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

x − 2 + 2 = 0 + 2

So x = 2.

x = 2

We write it as (2, 3/5, 13/5).

(x, y, z) = (2, 35, 135)

7 Check

Let's check in every equation.

We put x = 2, y = 3/5, z = 13/5 into ①.

① 2 + (35) − (135) = 2 + 35 − 135 = 0

We get 0, the same as the right side.

Now ②.

② 2(2) − (35) + (135) = 4 − 35 + 135 = 6

We get 6, the same as the right side.

Now ③.

③ 2 + 3(35) + 2(135) = 2 + 95 + 265 = 9

We get 9, 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) = (2, 35, 135)

Your turn

Try this one yourself, then check:

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

More from Gaussian elimination

The whole lesson: Gaussian elimination →