Why Gaussian elimination works
7 min read
Short answer
Gaussian elimination works because each row operation is reversible, so the new system has exactly the same solutions as the old one. We use that freedom to reach a triangular system that can be solved from the bottom up. Recording the multipliers gives the factorization .
Why the solutions never change
Three operations are allowed: swap two equations, scale an equation by a nonzero number, add a multiple of one equation to another. Each has an inverse of the same kind (swap again, divide, subtract). So if solves the system before an operation, it solves it after, and if it solves it after, undoing the operation shows it solved it before.
In matrix language each operation is multiplication by an invertible elementary matrix . The system becomes , which has the same solutions because can be cancelled.
What elimination achieves
Choose a pivot in column 1 and subtract multiples of row 1 to zero out everything below it. Move to column 2 and repeat. After about arithmetic operations for an system, you hold an upper triangular .
The last equation involves one unknown, which you solve; substitute upward. The number of pivots is the rank, the columns without pivots give the free variables, and a row of zeros with a nonzero right side exposes an inconsistent system.
LU factorization and pivoting
Each elimination step subtracts a multiplier times a row. Storing those multipliers below the diagonal in a matrix (with ones on the diagonal) gives . Then solving means solving two easy triangular systems, and , and the expensive factorization can be reused for many right-hand sides.
If a pivot is zero you swap in a lower row. Even a tiny pivot is dangerous in floating point, so software picks the largest available entry (partial pivoting) and factors .
Worked example
Solve , , by elimination and record the multipliers.
gives . gives .
gives , that is , so .
Back-substitute: ; then . The solution is .
Multipliers fill , with . Check row 3 of : . ✓
Try it yourself
Why does adding (row 1) to row 2 not change the solutions of a system?
Show the answer
Because it can be undone by subtracting (row 1) again. Any solution of the old system satisfies the new equation (a sum of valid equations), and any solution of the new system satisfies the old one by undoing the step.
Keep going with practice
Vidi's elimination lessons let you practice the row operations whose logic this article explains.