Lesson 3 of 8 · 18 min
Gaussian elimination
Write a system of linear equations as an augmented matrix, use elementary row operations to reach row-echelon form, and back-substitute to solve it, by hand and with technology.
What you will be able to do
- Recognise the general form of a system of linear equations in several variables.
- Write a system as an augmented matrix, and read a system from one.
- Use the three elementary row operations to reduce an augmented matrix to row-echelon form.
- Solve the system by back substitution, and with technology.
The inverse method is quick with a calculator, but it has two weaknesses. Without technology a inverse is slow, and when the method simply stops, without telling you whether there are no solutions or infinitely many.
Gaussian elimination fixes both. It is the elimination you used in Year 10 for two equations, organised so it works for any number of equations and unknowns. It is also what computers use to solve systems with millions of unknowns.
Definition
Systems of linear equations
A system of linear equations in variables has the general form
Each variable appears only to the first power, with no products of variables. With three variables we usually write , and .
All the information is in the numbers, so drop the variables and the equals signs and keep the coefficients and constants in an augmented matrix, with a bar where the equals signs were:
Each row is one equation, and each column before the bar belongs to one variable. A variable missing from an equation has coefficient .
Which augmented matrix represents the system , , ?
Key idea
Elementary row operations
These three operations change the equations but never their solutions:
- Swap two rows: .
- Multiply a row by a non-zero constant: , .
- Add a multiple of another row: .
Each acts on the whole row, including the constant after the bar.
The goal is row-echelon form: a staircase of zeros in the bottom-left corner, so each row starts further right than the one above.
Then the last row is an equation in alone, the one above it in and , and so on. Solving from the bottom up is back substitution.
Gaussian elimination
Write the augmented matrix
Keep the variables in the same order in every row.
Get a leading entry in row 1
If the top-left entry is , swap in a row that does not start with . A leading keeps the arithmetic simple.
Clear the first column below it
Use and to make the entries below the leading entry .
Repeat one row down
Use row 2's leading entry to clear the entry below it in column 2. Never use row 1 again: it would bring back the zeros you made.
Back-substitute
Solve the last row for , then the row above for , then the top row for .
Check
Substitute your solution into every original equation.
Choose "Gaussian elimination" to see each row operation and the back substitution. Then edit a coefficient and watch the operations change.
Worked example
Solve a system by Gaussian elimination
Use Gaussian elimination to solve
Step 1: Write the augmented matrix
Step 2: Clear column 1
and :
The leading in row 1 makes the multipliers just the entries you want to remove.
Step 3: Simplify row 2
:
Step 4: Clear column 2 below row 2
:
This is row-echelon form.
Step 5: Back-substitute
Row 3: , so . Row 2: , so . Row 1: , so .
Step 6: Check in the original equations
, and .
Try it yourself first, then check the working one step at a time.
Answer
, ,
Method
Write the augmented matrix.
Use row 1 to clear column 1, then row 2 to clear column 2.
Back-substitute from the last row up.
Check in every original equation.
Watch out for
Using again to clear column 2, which brings back a non-zero entry in column 1.
Forgetting to apply the operation to the constant after the bar.
Solve the system whose augmented matrix is in row-echelon form:
Which row operation changes the second row of
Common mistake
Arithmetic across the whole row
The commonest slip is to change the coefficients and forget the constant after the bar, or to subtract a negative wrongly: , not . Write the operation beside each new row so you (and the marker) can check it.
Without technology
Show each augmented matrix and the operations that produced it. Choose operations that avoid fractions where you can, such as instead of .
With technology
The calculator's ref and rref commands row-reduce a matrix. rref (reduced row-echelon form) goes further, giving s down the diagonal and s above them too, so the solution sits in the last column. Write down the augmented matrix you entered and the rref result.
Exam tip
Show the row operations
"Use Gaussian elimination" questions in Paper 1 award marks for the method. Label every step (), reach row-echelon form, then back-substitute. A solution found another way, such as substitution, may not earn the method marks.
Summary
A system of linear equations becomes an augmented matrix : one row per equation, one column per variable, constants after the bar.
The row operations are: swap two rows, multiply a row by a non-zero constant, add a multiple of one row to another. None changes the solutions.
Row-echelon form has a staircase of zeros in the bottom-left corner.
Clear column 1 using row 1, then column 2 using row 2, then back-substitute from the bottom up.
With technology,
rrefgives the solution directly; still record the matrix you entered.
Finished the lesson?
Try the 3 quick checks above and the lesson completes itself, or mark it complete now.