Steply

Solve x + 2y + z = 8, x + y - z = 1, 2x + y + z = 7 by gaussian…

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

Step by step

The question

Question: solve x + 2y + z = 8, x + y − z = 1 and 2x + y + z = 7 by Gaussian elimination.

x + 2y + z = 8①
x + y − z = 1②

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

2x + y + z = 7③

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, 2, 1, 8; 1, 1, −1, 1; 2, 1, 1, 7]

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

4 Get 0s under the 1 in column 2

→ [1, 2, 1, 8; 0, 1, 2, 7; 0, 0, 5, 12]

5 Get a 1 in row 3

→ [1, 2, 1, 8; 0, 1, 2, 7; 0, 0, 1, 12 over 5]

6 Back substitution

Start at the bottom.

Each row is an equation again.

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

So z = 12/5.

z = 125

Row 2 is the equation y + 2z = 7.

y + 2z = 7

We know z = 12/5.

We put it in.

y + 2 × 125 = 7

Work it out: y + 24/5 = 7.

y + 245 = 7

To remove the + 24/5, we take away 24/5 on both sides.

y + 245 − 245 = 7 − 245

So y = 11/5.

y = 115

Row 1 is the equation x + 2y + z = 8.

x + 2y + z = 8

We know y = 11/5 and z = 12/5.

We put them in.

x + 2 × 115 + 125 = 8

Work it out: x + 34/5 = 8.

x + 345 = 8

To remove the + 34/5, we take away 34/5 on both sides.

x + 345 − 345 = 8 − 345

So x = 6/5.

x = 65

We write it as (6/5, 11/5, 12/5).

(x, y, z) = (65, 115, 125)

7 Check

Let's check in every equation.

We put x = 6/5, y = 11/5, z = 12/5 into ①.

① (65) + 2(115) + (125) = 65 + 225 + 125
= 8

We get 8, the same as the right side.

Now ②.

② (65) + (115) − (125) = 65 + 115 − 125
= 1

We get 1, the same as the right side.

Now ③.

③ 2(65) + (115) + (125) = 125 + 115 + 125
= 7

We get 7, 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) = (65, 115, 125)

Your turn

Try this one yourself, then check:

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

More from Gaussian elimination

The whole lesson: Gaussian elimination →