Elimination solves equations by taking one from another. Watch what that does to the lines: one turns, and the crossing stays.
Elimination keeps the crossing point
One step: the second equation minus a multiple of the first.
Two lines, 2x − y = 4 and x + y = 5, crossing at (3, 2). The step: take one half of the first equation from the second.
Describe this picture
One panel with a grid and the two lines and , crossing at the marked point . A caption names the step: take one half of the first equation from the second. As the step plays, the line turns about the crossing point until it lies flat, as the line , which is ; a dashed copy shows where it started, and a readout gives the second equation as it changes. The crossing point never moves, and the first line stays where it is. A transport plays the step, pauses it and steps back; there is no other control.
Clear one unknown
Here are the two equations from Two pictures of a linear system:
If the second equation had no in it, it would give at once. So take a multiple of the first equation away from the second, chosen to remove the . The first equation has and the second has , so take away one half of the first:
The that we divided by is the pivot: the first number in the row we keep. The is the multiplier: the number below the pivot, divided by the pivot. I’ll write the multiplier that clears row using row as
Here . The new second row starts with 0, and its first nonzero number, , is the second pivot.
Back substitution
The system now looks like a staircase:
Solve from the bottom up. The last equation gives . Put it into the first: , so . Solving from the bottom row upwards like this is back substitution.
Why the answer never moves
Look at the picture at the top of the page again. The second line turned, but it turned about the crossing point, so the answer stayed .
That is no accident. Any pair that makes both old equations true also makes the new one true, because the new equation is the old second one minus half the old first one. And we can go back: adding half of the first equation to the new one gives the old second equation again. So the old system and the new system have exactly the same solutions. Elimination does not change the problem. It changes how the problem is written, until the answer can be read off.
Three equations
The same steps work for any size. Take three equations in three unknowns:
The first pivot is the 1 in front of . The second row has , so : take 3 times row 1 from row 2, which leaves . The third row has no , so . Now the second pivot is the 2 in front of . The third row has , so : take 2 times the new row 2 from row 3, which leaves .
Watch the same steps on the table of numbers.
Steps on a grid of cells
Elimination clears every number below a pivot, row by row.
The three equations as cells, one row each, with the right-hand sides after the bar.
Describe this picture
The numbers of the three equations as a grid of cells, : three rows of , and numbers, with the right-hand sides after a dashed bar. Each cell is shaded by its number. The pivot in use is outlined. As each row is cleared, its multiplier appears beside it, , then , then , set out in the shape of a lower triangle; the row lights up and its cells change to their new numbers, with 0 below the pivot. At the end all three pivots are outlined and the grid reads over over , with right-hand sides 2, 6 and . The picture has no control.
Every number below the diagonal is now zero. A matrix like that is upper triangular, and I’ll call it :
Its diagonal holds the three pivots, 1, 2 and 5. Back substitution then runs from the bottom: gives ; gives ; and gives . Check in the original equations: , and .
When elimination breaks
A zero pivot. Take and . The first equation has no , so the first pivot is 0, and dividing by it is impossible. The fix is to swap the two equations, a row exchange. Now the system is and : already a staircase. So and , which gives .
No fix. Take and . The multiplier is 2, and taking twice the first from the second leaves . That is false whatever and are, so there is no solution: the lines are parallel. With instead, the same step leaves . That is always true, so it puts no limit on anything, and there are infinitely many solutions: both equations are the same line. In both cases a pivot came out 0 and no lower row could replace it. A system like that is called singular.
Steps as matrices
Each step is itself a matrix. Taking 3 times row 1 from row 2 is the same as multiplying on the left by
It is the identity with placed in row 2, column 1. Row 2 of is times row 1 of plus row 2, exactly the step. Multiplying matrices comes from Matrix multiplication. With one such matrix for each step, the whole of elimination is
where here is the identity, because , and holds in row 3, column 2. The page LU factorisation runs these steps backwards.
How much work it takes
How long does elimination take on a big system? Count the multiply-and-subtract steps. With equations, clearing the first column changes about numbers in each of about rows, so about steps. The next column needs about , then , and so on. Added up, that is about
For equations, that is about multiply-and-subtract steps: a fraction of a second on a laptop. But double and the work grows eight times.
Worked example
- Two equations. , . Pivot 2, multiplier , second pivot . So , , then .
- Three equations. Multipliers 3, 0 and 2; pivots 1, 2 and 5; , , .
- A multiplier. What multiplier clears a 6 below a pivot of 2? .
- A zero pivot. , : exchange the rows, then and .
- A zero row. If a step leaves , one unknown is free and there are infinitely many solutions. If it leaves , there are none.
- Predict. Does the crossing point move while elimination runs? No: each step keeps exactly the same solutions.
Where you’ll meet this
Most programs that solve a dense system run elimination, usually in the form of the page LU factorisation. A circuit simulator solves one system for the voltages at all the junctions of a chip. Programs that work out how a bridge or an aircraft wing bends cut the shape into small pieces and solve a system with one equation per piece, often hundreds of thousands. The solver in SciPy, a free Python library, does the same.
Reference card
| Quantity | Formula | Notes |
|---|---|---|
| Pivot | when row is used | must not be 0 |
| Multiplier | number to clear, over the pivot | |
| Step | row row row | keeps every solution |
| Result | upper triangular , pivots on its diagonal | then back substitution |
| As matrices | holds | |
| Zero pivot | exchange with a lower row | if none: singular |
| Singular | a row : none; : infinitely many | |
| Cost | about steps | equations |