Step by step
The question
Question: solve x + y + z = 3, x − y + 2z = 5 and 2x + y − z = 1 by Gaussian elimination.
We want the x, y and z that make all three true.
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.
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.
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.
2 Get 0s under the 1 in column 1
Careful!
A row move works on the whole row, the number after the bar too.
That number is the right side of the equation.
3 Get a 1 in row 2
4 Get 0s under the 1 in column 2
5 Get a 1 in row 3
6 Back substitution
Start at the bottom.
Each row is an equation again.
Row 3 is 1z = 12/7, with 0 for the other letters.
So z = 12/7.
Row 2 is the equation y − z/2 = −1.
We know z = 12/7.
We put it in.
Work it out: y − 6/7 = −1.
To remove the − 6/7, we add 6/7 on both sides.
So y = −1/7.
Row 1 is the equation x + y + z = 3.
We know y = −1/7 and z = 12/7.
We put them in.
Work it out: x + 11/7 = 3.
To remove the + 11/7, we take away 11/7 on both sides.
So x = 10/7.
We write it as (10/7, −1/7, 12/7).
7 Check
Let's check in every equation.
We put x = 10/7, y = −1/7, z = 12/7 into ①.
We get 3, the same as the right side.
Now ②.
We get 5, the same as the right side.
Now ③.
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 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.