Gauss-Jordan Elimination
Gauss-Jordan elimination keeps row reducing to reduced row echelon form so answers read off directly. Steps, an example, and how it differs from Gaussian.
What Gauss-Jordan Elimination Adds
You run Gaussian elimination until the matrix is upper triangular, then stop and back-substitute. Gauss-Jordan elimination keeps going: it eliminates upward, leaving the matrix in reduced row echelon form (RREF). For a system with a unique solution, the left block becomes the identity matrix and the right block becomes the solution vector. No back-substitution required.
The cost is extra row operations. Gaussian elimination on an n×n matrix requires roughly 2n³/3 operations; Gauss-Jordan requires roughly n³. For a 3×3 system that difference is small, about 9 extra steps. For larger systems it is a factor of 1.5 in runtime. Do Gauss-Jordan by hand only on matrices up to 5×5; the step-by-step calculator stops there.
Step-By-Step Procedure For The Gauss-Jordan Method
Phase 1: Forward Elimination (Same As Gaussian Elimination)
Write the augmented matrix [A|b]. For each column left to right:
- Select a pivot, the first non-zero entry in the current row. If it is zero, swap with a lower row that has a non-zero entry. If no such row exists, the system is singular (no unique solution).
- Scale the pivot row so the pivot equals 1.
- Use row addition to create zeros below the pivot.
After this phase the matrix is in row-echelon form (REF): zeros below each pivot, each pivot to the right of the one above.
Phase 2: Backward Elimination (The Gauss-Jordan Difference)
Move from the last pivot back to the first. For each pivot, use row addition to create zeros above it. The pivot itself is already 1 from the forward phase, so no further scaling is needed. When you finish, the matrix is in reduced row echelon form (RREF): each leading entry is 1, and it is the only non-zero entry in its column.
For a consistent system with a unique solution, the left side becomes the identity matrix and the right side is the solution. For a system with free variables, the RREF shows the parametric form directly. For an inconsistent system, you get a row of zeros on the left with a non-zero on the right, the equation 0 = c with c ≠ 0.
Gauss-Jordan Example: Worked 3×3 System
Solve the system:
x₁ + 2x₂ + x₃ = 9
2x₁ + 3x₂ + 2x₃ = 16
3x₁ + x₂ + x₃ = 11
Augmented matrix: [1 2 1 | 9; 2 3 2 | 16; 3 1 1 | 11]
Forward Phase (REF)
Pivot is already 1 in row 1, column 1. Eliminate below: R2 = R2-2R1 gives [0 -1 0 | -2]; R3 = R3-3R1 gives [0 -5 -2 | -16]. Matrix is now:
[1 2 1 | 9]
[0 -1 0 | -2]
[0 -5 -2 | -16]
Pivot in row 2, column 2 is -1. Scale R2: multiply by -1, giving [0 1 0 | 2]. Eliminate below using R3 = R3 + 5R2, giving [0 0 -2 | -6]. Forward phase ends with matrix in REF:
[1 2 1 | 9]
[0 1 0 | 2]
[0 0 -2 | -6]
Backward Phase (RREF)
Scale last pivot to 1: R3 = R3 / -2 gives [0 0 1 | 3]. Now eliminate above: R2 = R2-0*R3 (no change to column 3 above pivot). Actually the pivot in column 3 has a zero above it, easier here: use R1 = R1, R3 to eliminate the 1 in column 3, giving [1 2 0 | 6]. Then use R1 = R1-2R2 to eliminate the 2 in column 2, giving [1 0 0 | 2]. Final RREF:
[1 0 0 | 2]
[0 1 0 | 2]
[0 0 1 | 3]
Solution: x₁ = 2, x₂ = 2, x₃ = 3. No back-substitution needed, the answer is read directly from the last column.
Gaussian Vs Gauss-Jordan: Work, Clarity, And Uses
When To Use Gauss-Jordan Instead Of Gaussian Elimination
Use Gauss-Jordan when you need the solution in the most explicit form possible, for example, when you are teaching the concept of RREF, or when you expect to interpret the solution set (unique, infinite, none) at a glance. It is also the standard method for finding an inverse matrix: augment A with the identity I and reduce to RREF; the right block becomes A⁻¹.
Use standard Gaussian elimination when you care about speed or when you are solving a system that you will later use back-substitution on anyway. Gaussian elimination is faster for large systems and is the algorithm behind LAPACK's dgesv routine, which handles matrices up to thousands of dimensions. Gauss-Jordan would double the work for no benefit.
Comparison
| Attribute | Gaussian Elimination | Gauss-Jordan Elimination |
|---|---|---|
| Final matrix form | Row-echelon form (REF) – zeros below each pivot | Reduced row-echelon form (RREF) – zeros above and below each pivot |
| Back-substitution needed? | Yes – solve from last row upward | No – solution reads directly from last column |
| Approximate operation count (n×n) | 2n³/3 | n³ |
| Best for | Solving large systems (100+ equations); numerical stability with pivoting | Small systems by hand; matrix inversion; teaching RREF |
| Standard library implementation | LAPACK dgesv (LU decomposition) | Usually implemented directly for small n; no standard LAPACK routine |
Using Gauss-Jordan Elimination To Find An Inverse Matrix
To compute A⁻¹ using Gauss-Jordan, write the augmented matrix [A | I] where I is the n×n identity matrix. Apply the same row operations that would reduce A to RREF. When the left block becomes the identity matrix, the right block is A⁻¹.
For example, take A = [1 2; 3 4]. Augment with I₂: [1 2 | 1 0; 3 4 | 0 1]. Eliminate forward: R2 = R2-3R1 gives [0 -2 | -3 1]. Scale R2: R2 = R2 / -2 gives [0 1 | 1.5 -0.5]. Backward: R1 = R1-2R2 gives [1 0 | -2 1]. The inverse is [ -2 1; 1.5 -0.5 ], which matches the formula for a 2×2 inverse. This method works for any invertible square matrix and is the method taught in Strang, Introduction to Linear Algebra, ch. 2.
Failure case: if a row of zeros appears on the left during the elimination, the matrix is singular and has no inverse. That is the same condition as a zero determinant.
Who Should Use Gauss-Jordan Elimination And Who Should Skip It
Gauss-Jordan elimination suits college linear algebra students solving small systems by hand and needing to verify each step. It also suits numerical methods students learning about pivoting and stability before moving to library solvers like LAPACK's dgesv. Engineering students in a first matrices course who need to interpret solution types, unique, infinite, none, will find RREF gives the answer in the clearest possible form.
Anyone solving large sparse systems with 1000+ equations should skip Gauss-Jordan entirely and use a dedicated sparse solver library such as scipy.sparse.linalg.splu. Anyone seeking a deep theoretical treatment of vector spaces or eigenvalues should go to Strang or Axler. The single thing that most often goes wrong when learning Gauss-Jordan is forgetting to apply each row operation to the entire augmented row, both the coefficient side and the constant side, which destroys the solution.
Common Questions
What is the difference between Gaussian elimination and Gauss-Jordan elimination?
Gaussian elimination stops at row-echelon form (REF) and uses back-substitution. Gauss-Jordan continues to reduced row echelon form (RREF), creating zeros above each pivot. Gauss-Jordan requires about 50% more operations for an n×n matrix.
When should I use the Gauss-Jordan method instead?
Use Gauss-Jordan when you want the solution without back-substitution, when you are aiming for RREF, or when you need a matrix inverse. For systems larger than 5×5 by hand, Gaussian elimination is faster and easier.
What are the reduced row echelon form steps?
Forward elimination creates zeros below each pivot until REF is reached. Then backward elimination creates zeros above each pivot, and each pivot is scaled to 1. The final matrix has leading 1s that are the only non-zero entries in their columns.
Is Gauss-Jordan elimination the same as finding the inverse?
The algorithm is identical: augment the matrix with the identity and reduce to RREF. The right block becomes the inverse. This is the standard method taught in linear algebra textbooks.
Can Gauss-Jordan handle systems with no solution?
Yes. If the RREF contains a row of zeros on the left with a non-zero constant on the right (0 = c), the system is inconsistent and has no solution. The algorithm detects this during the elimination.
How many operations does Gauss-Jordan take?
For an n×n matrix, Gauss-Jordan requires roughly n³ operations. Gaussian elimination requires about 2n³/3. For a 3×3 system, that is about 27 versus 18 operations, both trivial by hand.
What goes wrong with Gauss-Jordan elimination?
Zero pivots that are not swapped cause division by zero. Decimal rounding errors from small pivots amplify noise. For ill-conditioned matrices like the Hilbert matrix, Gauss-Jordan (like Gaussian elimination) can produce large errors even with partial pivoting.