Gaussian and Gauss-Jordan elimination
You know a system is consistent from rank and the Rouché–Capelli criterion — now you need the actual solution. Gauss elimination and Gauss–Jordan elimination are the two standard hand algorithms for that job, both built from the same elementary row operations on the augmented matrix , differing only in how far the reduction goes. Gauss elimination stops at upper-triangular form and finishes with back substitution; Gauss–Jordan pushes all the way to the identity matrix and reads the answer straight off. This article works both methods on the same system side by side, so you can see exactly where they diverge and why Gauss–Jordan costs more arithmetic. It sits directly after row operations and rank in the "Matrices, systems, and numerical linear algebra" sub-chapter, and feeds into Gauss–Seidel iteration next — the iterative alternative to these two direct methods.
Row-reduce to upper-triangular form and back-substitute (Gauss), or keep reducing to and read the answer off directly (Gauss–Jordan) — both direct methods solving the same .
The core idea
Both algorithms operate on the augmented matrix using the three elementary row operations (swap two rows, scale a row by a nonzero constant, add a multiple of one row to another). They agree completely through forward elimination and part company after.
Gauss elimination has two phases. Forward elimination zeroes every entry below the diagonal, leaving
where: are the reduced coefficients, the reduced right-hand side, and the number of unknowns. Back substitution then solves from the bottom up: , then from row using the now-known , and so on to .
Gauss–Jordan elimination continues past upper-triangular form: it also eliminates the entries above each pivot and scales every pivot to , turning the coefficient block into the identity,
where: the right-hand column of the fully reduced augmented matrix is the solution vector — no separate back-substitution pass is needed, at the cost of roughly more arithmetic than plain Gauss elimination. A practical refinement for both algorithms is partial pivoting: before eliminating a column, swap rows so the largest-magnitude available entry becomes the pivot. This avoids division by an exact zero and, for decimal computation, curbs round-off growth from dividing by a tiny pivot — dividing by a very small number amplifies whatever error already sits in that row, and every later row inherits it. For the exact-fraction examples typical of this course, pivoting mainly guards against a zero pivot, but defaulting to it is good habit even when no pivot is exactly zero, since a small-but-nonzero pivot produces awkward fractions that are far more error-prone by hand than a larger pivot swapped in from a row below. Operation counts: Gauss elimination is for forward elimination and for back substitution, so for large forward elimination dominates the cost; Gauss–Jordan's extra above-pivot elimination is also but with a larger constant — the precise sense in which it does "more work," even though both scale the same way with system size. Both methods are direct methods: barring rounding error, they produce the exact solution in a finite, predictable number of steps, unlike an iterative method that only converges toward the answer over repeated passes. That distinction matters for the next article in this sub-chapter, Gauss–Seidel iteration, which solves the same by repeated approximation instead of a finite sequence of row operations, and is preferred for very large, sparse systems where a full elimination would be too costly.
The goal is to show, step by step and with every row operation stated explicitly, how continuing Gauss elimination's upper-triangular result past the point where back substitution would normally begin — first scaling each pivot to , then clearing every entry above it, working from the bottom pivot up to the top — mechanically forces the coefficient block into the identity matrix so the augmented column becomes the solution vector with no further computation.
Step 1. Start from the upper-triangular form already reached by forward elimination on :
Gauss elimination would back-substitute from here; Gauss–Jordan instead keeps row-reducing.
Step 2. Scale each pivot to . gives ; gives :
Step 3. Eliminate above the bottom pivot using row 3. gives ; gives :
Step 4. Eliminate above the row-2 pivot, then rescale row 1 to a leading . gives ; then gives :
The left block is , so the right column is read off directly: .
Worked example
Step 1. Solve by Gauss elimination. Augmented matrix:
Step 2. Forward eliminate below the pivot in column 1. gives ; gives :
Step 3. Eliminate below the pivot in column 2. gives :
This is upper-triangular, so forward elimination is done.
Step 4. Back-substitute. Row 3: . Row 2: . Row 1: . Solution: .
Step 5. Check in equation 2: , matching the given right-hand side.
Competitive stretch
The same matrix, pushed on to Gauss–Jordan (worked in full in the derivation above), gives with — identical to the Gauss-elimination answer, exactly as it must be, since both algorithms solve the same consistent, unique-solution system.
Common traps
- Forgetting to check for a zero pivot during forward elimination — swap in a nonzero entry from a row below (partial pivoting) before continuing, or the elimination formulas break down.
- Applying a row operation to the coefficient columns but forgetting the augmented column — a common source of a "close but wrong" final answer.
- Stopping Gauss–Jordan at upper-triangular form — that is just Gauss elimination — instead of continuing to clear above the pivots and scale to .
- Assuming the mechanical steps apply verbatim when : a zero row, or a row like , appearing during elimination signals infinitely many solutions or inconsistency instead.
- Skipping partial pivoting when a small but technically nonzero pivot appears — the arithmetic still "works" formally, but hand calculations with awkward fractions become far more error-prone than if a larger pivot from a lower row had been swapped in first.
Ask the tutor: want to practice a system with a tricky zero pivot, or see the Gauss vs. Gauss–Jordan operation counts compared side by side for a general ?
Why bother with Gauss-Jordan if Gauss elimination already gives the answer
Gauss–Jordan does more arithmetic — roughly more operations than plain Gauss elimination — so for a single system, Gauss elimination plus back substitution is usually the cheaper route. Gauss–Jordan earns its keep when you want the answer without writing a separate back-substitution routine, or when you apply the same reduction to to compute directly, which Gauss elimination alone cannot hand you.
Does partial pivoting change the final solution
No. Swapping two rows (or swapping a row with a linear combination of itself and another) is one of the three elementary row operations, and elementary row operations never change the solution set of the system — they only change how you arrive at it. Partial pivoting is purely a computational safeguard: it avoids dividing by zero and, for decimal arithmetic, keeps the multipliers small so rounding errors don't blow up. The exact-fraction answer at the end is identical whether or not you pivoted.
How do I tell from the row-reduced matrix whether a system has no solution or infinitely many
Watch what happens to the rows during elimination. If a row reduces to something like with — all coefficients zero but a nonzero right-hand side — the system is inconsistent and has no solution. If instead a row reduces to all zeros including the right-hand side (), that equation carries no information, , and the system has infinitely many solutions, with the leftover unknown(s) becoming free parameters. Only when every row keeps a nonzero pivot does the mechanical back-substitution or read-off step give a single unique solution.