Systems of Linear Equations — Gaussian Elimination
Gaussian elimination is a systematic algorithm for solving systems of linear equations by transforming the augmented coefficient matrix into row echelon form using elementary row operations, then back-substituting. Key result: any linear system has either no solution, exactly one solution, or infinitely many; the algorithm detects which case occurs and produces all solutions. Applies to: any linear system over a field. Origin: named for Carl Friedrich Gauss (early 1800s), though the method appears in Chinese mathematics by ~150 BCE.
Replacing an equation by a combination of itself and other equations in the system does not change the solution set, as long as the operation is reversible. Gaussian elimination exploits this to strategically zero out coefficients one column at a time, manufacturing a staircase ("echelon") structure where each successive equation involves fewer unknowns — until the last reveals one variable directly, and the rest unravel by substitution.
Formal Statement
A system of linear equations in unknowns over a field (usually or ) is:
Derivation hint: each row collects the coefficients multiplying the unknowns; is the constant term. In matrix form this is , where is the coefficient matrix, , and . The augmented matrix is
Derivation hint: append the constant vector as an extra column so row operations act on coefficients and constants together. A solution is satisfying [1]; the set of all solutions is the solution set.
The three elementary row operations (EROs) on a matrix are: 1. Swap rows . 2. Scale a row by a nonzero scalar : , . 3. Replace a row by itself plus a multiple of another: (). Each ERO corresponds to left-multiplication by an invertible elementary matrix , so applying it to yields .
A matrix is in row echelon form if:
- All zero rows are at the bottom.
- The leading nonzero entry of each row (the pivot) is strictly to the right of the pivot in the row above.
It is in reduced row echelon form (RREF) if additionally every pivot equals and is the only nonzero entry in its column. The columns containing pivots are pivot columns; the corresponding unknowns are basic variables, and the rest are free variables.
If is obtained from by a sequence of elementary row operations, then the systems and have exactly the same solution set.
The system is consistent (has a solution) if and only if
Derivation hint: an inconsistent system reveals a pivot in the augmented column — a row with — which raises the augmented rank above the coefficient rank. When consistent, with :
- if , the solution is unique;
- if , there are infinitely many solutions parametrized by free variables (over an infinite field).
Why It Holds / Derivation
We show each ERO preserves solutions; since each is reversible, no solutions are gained or lost.
Step 1 — Setup. Let satisfy , i.e. every scalar equation [1] holds.
Step 2 — Swap. Reordering equations does not change which assignments satisfy them all. Solution set unchanged. Reverse: swap again.
Step 3 — Scale. Replace equation by , :
Derivation hint: multiplying both sides of a true equation by nonzero keeps it true, and dividing by recovers the original — equivalence in both directions.
Step 4 — Replacement. Replace equation by (eqn ) (eqn ). If satisfies both equations and , then
Derivation hint: add zero ( eqn residual) scaled by to zero ( eqn residual); the new equation is also satisfied. Subtracting (eqn ) reverses it. so the new equation holds. Conversely, given the new system, subtract (eqn ) to recover the original. Equation is untouched throughout.
Step 5 — Conclusion. Each operation and its inverse are EROs, so the solution sets of the original and transformed systems coincide.
∎Step 1. Find the leftmost column with a nonzero entry. Swap a row with a nonzero entry into the top position; call this entry the pivot.
Step 2. Use replacement operations to zero all entries below the pivot in that column.
Step 3. Ignore the pivot row and column; recurse on the smaller submatrix below-right.
Step 4. Each step fixes one more pivot and shrinks the active submatrix; the process halts after at most pivots, yielding REF. Continuing upward (clearing above pivots and scaling) gives RREF, which is unique for a given matrix.
∎Gauss developed the elimination method around 1809–1810 while computing the orbit of the asteroid Pallas by least squares — he needed to solve the resulting normal equations, a large symmetric system. He described the systematic reduction in his work on celestial mechanics, and the notation/method was later formalized by the geodesist Wilhelm Jordan (giving "Gauss–Jordan" for full reduction to RREF). Ironically Gauss never claimed it as new; he treated it as routine arithmetic. The "Gaussian" name spread through 20th-century numerical analysis, particularly after the algorithm's role in early electronic computation was studied by Alan Turing, John von Neumann, and Herman Goldstine in the 1940s.
Building Intuition
Think of each equation as a constraint slab in -dimensional space — a hyperplane. Solving the system means finding the intersection of all these hyperplanes. Gaussian elimination is the act of replacing the tangle of slabs with an equivalent, neatly stacked one where the constraints decouple: the last equation pins down one variable, the second-to-last then pins down another given the first, and so on. The "staircase" of REF is geometrically the statement that you've untangled the constraints into a triangular cascade. Free variables are directions along which no constraint bites — the solution can slide freely, generating a line, plane, or higher flat. A contradictory row (with ) means the slabs have no common point — like three lines in a plane forming a triangle that never meet at one spot.
Worked Examples
Given:
Step 1 — Augmented matrix:
Step 2 — Eliminate below pivot (col 1). , :
Step 3 — Eliminate below pivot (col 2). :
Step 4 — Back-substitute.
- Row 3: .
- Row 2: .
- Row 1: .
Answer:
Given:
Step 1 — Augmented matrix and elimination. , :
Step 2 — :
Pivot columns: 1 and 3. Free variable: .
Step 3 — Back-substitute.
- Row 2: .
- Row 1: .
Answer (parametric form):
A one-parameter family — a line in .
Common Misconceptions
- Forgetting the augmented column. Every row operation must act on too. Operating only on silently changes the system.
- "More equations means a unique solution." Not so. Redundant equations (like Example 2) collapse to zero rows; does not guarantee uniqueness.
- Dividing by zero pivots. If a pivot position holds , you must swap in a nonzero row first — never scale by an undefined reciprocal.
- Confusing REF and RREF. REF suffices for back-substitution; full RREF is unnecessary work unless you need the inverse or a canonical form. RREF is unique; REF is not.
- Reading consistency wrong. A row means — inconsistent. A row is harmless (a redundant equation).
In exact arithmetic the pivot choice never affects the answer. But consider, in floating-point with ~3 significant digits:
Using the tiny as pivot, gives , after rounding — catastrophically wrong (true: ). Swapping rows first (partial pivoting, choosing the largest-magnitude pivot) recovers the correct answer. So "any nonzero pivot works" is false in practice — pivot magnitude controls error amplification.
Connections
Gaussian elimination is the computational core linking many topics. The pivot count is the Matrix Rank, and the existence of a contradictory row is the Rouché–Capelli Theorem in action. The forward-elimination multipliers and pivots assemble into the LU Decomposition , which lets you re-solve for many cheaply. The product of pivots (with a sign for row swaps) gives the Determinant. Applying elimination to produces the Matrix Inverse. The free variables of the homogeneous system span the Null Space (Kernel), while pivot columns of the original form a basis of the Column Space — together these realize the Rank–Nullity Theorem. The whole framework lives inside the theory of Vector Spaces and Linear Transformations.
Real-World Applications
Historical Development
Subtleties & Limits
Complexity and stability frontiers. Classical Gaussian elimination costs operations. Whether dense linear systems can be solved in essentially optimal time hinges on the matrix multiplication exponent : solving is asymptotically as hard as multiplying, and the exact value of (currently bounded near , conjectured ) is open. Separately, the numerical status is subtle: partial pivoting is stable on virtually all real-world matrices, yet contrived examples (Wilkinson's growth-factor matrices) make the error blow up exponentially — proving tight average-case or smoothed stability bounds remains an active research area. For huge sparse systems, exact elimination causes fill-in (zeros becoming nonzero), and finding fill-minimizing pivot orderings is NP-hard, so practitioners turn to iterative methods (CG, GMRES) where elimination becomes infeasible.
See Also
LU Decomposition · Matrix Rank · Rouché–Capelli Theorem · Determinant · Matrix Inverse · Null Space (Kernel) · Rank–Nullity Theorem · Cramer's Rule · Numerical Stability and Pivoting