Inverse Matrix Gauss Jordan Row Reduction Method

Find the inverse of a matrix by row reducing [A | I] to [I | A⁻¹]. Worked 2×2 and 3×3 examples, and how to tell when a matrix has no inverse (singular).

Find a Matrix Inverse With Gauss-Jordan Elimination

Augment your n×n matrix with the identity matrix, apply row operations until the left block is the identity, and the right block is your inverse. That is the inverse matrix gauss jordan method, also called the [A|I] method. It works because each row operation is equivalent to multiplying on the left by an elementary matrix; the same sequence that turns A into I turns I into A⁻¹.

Compute A⁻¹ by row reduction for 2×2 and 3×3 matrices, handle singular matrices, and verify your result. The method is direct: you never need determinants or cofactors.

Strang, Introduction to Linear Algebra (Ch. 2) defines the notation; OpenStax and LibreTexts linear algebra texts use the same row-operation conventions. For a refresher on gauss jordan elimination or row echelon form, see those sources.

Why [A | I] → [I | A⁻¹] Works

Every row operation, swap two rows, scale a row, or add a multiple of one row to another, is encoded by an elementary matrix E. When you apply a row operation to the augmented matrix [A | I], you are multiplying both blocks on the left by E. After a sequence of operations E₁, E₂, …, Eₖ, the left block becomes Eₖ…E₂E₁A, and the right block becomes Eₖ…E₂E₁I.

If that left block is the identity I, then the product Eₖ…E₂E₁ equals A⁻¹. The right block is therefore A⁻¹ times the identity, which is A⁻¹. That is the entire logic: the same row operations that reduce A to I produce the inverse on the right side.

This works only if A is square and invertible. If at any point you hit a zero pivot that cannot be swapped away, the matrix is singular and has no inverse.

Worked 2x2 Example

Let A = [[3, 4], [2, 6]]. Find A⁻¹ using [A | I] → [I | A⁻¹].

Step 1: Write the augmented matrix.
[A | I] = [[3, 4 | 1, 0], [2, 6 | 0, 1]]

Step 2: Create a leading 1 in the first row, first column. Scale row 1 by 1/3.
R1 → (1/3)R1: [[1, 4/3 | 1/3, 0], [2, 6 | 0, 1]]

Step 3: Eliminate below the pivot. Replace row 2 with row 2 − 2×row 1.
R2 → R2 − 2R1: [[1, 4/3 | 1/3, 0], [0, 6 − 8/3 | −2/3, 1]] = [[1, 4/3 | 1/3, 0], [0, 10/3 | −2/3, 1]]

Step 4: Scale row 2 to get a leading 1. Multiply row 2 by 3/10.
R2 → (3/10)R2: [[1, 4/3 | 1/3, 0], [0, 1 | (−2/3)(3/10), (1)(3/10)]] = [[1, 4/3 | 1/3, 0], [0, 1 | −1/5, 3/10]]

Step 5: Eliminate above the pivot in column 2. Replace row 1 with row 1 − (4/3)×row 2.
R1 → R1 − (4/3)R2: [[1, 0 | 1/3 − (4/3)(−1/5), 0 − (4/3)(3/10)], [0, 1 | −1/5, 3/10]] = [[1, 0 | 1/3 + 4/15, −2/5], [0, 1 | −1/5, 3/10]] = [[1, 0 | 9/15 = 3/5, −2/5], [0, 1 | −1/5, 3/10]]

The right block is A⁻¹ = [[3/5, −2/5], [−1/5, 3/10]].

Worked 3x3 Example

Let A = [[1, 2, 1], [2, 5, 3], [1, 3, 4]]. Find its inverse by row reduction.

Write the augmented matrix:
[[1, 2, 1 | 1, 0, 0],
[2, 5, 3 | 0, 1, 0],
[1, 3, 4 | 0, 0, 1]]

Step 1: The first pivot is 1 (row 1, column 1). Eliminate below: row 2 ← row 2 − 2×row 1; row 3 ← row 3 − 1×row 1.
[[1, 2, 1 | 1, 0, 0], [0, 1, 1 | −2, 1, 0], [0, 1, 3 | −1, 0, 1]]

Step 2: The second pivot is 1 (row 2, column 2). Eliminate below: row 3 ← row 3 − 1×row 2.
[[1, 2, 1 | 1, 0, 0], [0, 1, 1 | −2, 1, 0], [0, 0, 2 | 1, −1, 1]]

Step 3: Scale row 3 to get a leading 1: row 3 ← (1/2)×row 3.
[[1, 2, 1 | 1, 0, 0], [0, 1, 1 | −2, 1, 0], [0, 0, 1 | 0.5, −0.5, 0.5]]

Step 4: Eliminate above the third pivot. Row 2 ← row 2 − 1×row 3. Row 1 ← row 1 − 1×row 3.
[[1, 2, 0 | 0.5, 0.5, −0.5], [0, 1, 0 | −2.5, 1.5, −0.5], [0, 0, 1 | 0.5, −0.5, 0.5]]

Step 5: Eliminate above the second pivot. Row 1 ← row 1 − 2×row 2.
[[1, 0, 0 | 0.5 − 2(−2.5) = 5.5, 0.5 − 2(1.5) = −2.5, −0.5 − 2(−0.5) = 0.5], [0, 1, 0 | −2.5, 1.5, −0.5], [0, 0, 1 | 0.5, −0.5, 0.5]]

The right block is the inverse:
A⁻¹ = [[5.5, −2.5, 0.5], [−2.5, 1.5, −0.5], [0.5, −0.5, 0.5]].

When There Is No Inverse: The Singular Matrix Case

A square matrix with no inverse is a singular matrix. During row reduction, you reach a stage where a pivot position contains zero and no row swap can bring a non-zero entry into that position. This means the matrix's determinant is zero.

For a singular matrix, the left block will never become the identity. Instead, it will contain a row of zeros, or the row reduction will stop with a zero pivot that cannot be eliminated. In such a case, A⁻¹ does not exist; the system Ax = b either has no solution or infinitely many, depending on b.

Example: A = [[1, 2], [2, 4]]. Perform Gauss-Jordan: after subtracting 2×row1 from row2, you get [[1, 2 | 1, 0], [0, 0 | −2, 1]]. The second row has a zero pivot and no further row swap can help, both columns in that row are zero. A is singular.

Checking: A·A⁻¹ = I

Always verify your result by multiplying A and the computed A⁻¹. The product must be the identity matrix, down to the last entry. In the 2×2 example above:

A·A⁻¹ = [[3, 4], [2, 6]] × [[3/5, −2/5], [−1/5, 3/10]]
= [[3×(3/5) + 4×(−1/5), 3×(−2/5) + 4×(3/10)], [2×(3/5) + 6×(−1/5), 2×(−2/5) + 6×(3/10)]]
= [[9/5 − 4/5, −6/5 + 6/5], [6/5 − 6/5, −4/5 + 9/5]]
= [[1, 0], [0, 1]].

If you are working with fractions, use exact arithmetic to avoid round-off error. A small discrepancy in the off-diagonal entries (say, 10⁻¹⁶) is floating-point noise; a non-zero entry like 0.01 means your inverse is wrong.

Common Questions

What is the difference between Gaussian elimination and Gauss-Jordan elimination?

Gaussian elimination stops at row-echelon form (upper triangular) and then uses back-substitution. Gauss-Jordan continues to reduced row echelon form (RREF), producing the inverse directly. The Gauss-Jordan variant is used.

What is a pivot, and why does a zero pivot cause trouble?

A pivot is the first non-zero entry in a row after row reduction. A zero pivot means the algorithm would divide by zero. If a zero pivot occurs, you must swap rows to bring a non-zero entry into that position. If no such swap is possible, the matrix is singular.

Can I use the [A|I] method on a non-square matrix?

No. Only square matrices can have inverses. The [A|I] method requires an n×n matrix on the left and the n×n identity on the right. For rectangular matrices, you would need the pseudoinverse, which is a different topic.

How do I know if my matrix has an inverse?

A square matrix has an inverse if and only if its determinant is non-zero, or equivalently, if it is not singular. During row reduction, if you can reduce it to the identity matrix, it is invertible. If you get a row of zeros on the left, it is singular.

What is partial pivoting, and does this method use it?

Partial pivoting is the strategy of swapping rows so that the pivot is the largest absolute value in its column, which improves numerical stability. The worked examples above do not use pivoting because the pivots were already non-zero, but the method supports it.

How many row operations does the [A|I] method require?

For an n×n matrix, the Gauss-Jordan method performs O(n³) operations. Specifically, for a 2×2 matrix, you need about 6 to 8 row operations; for a 3×3, about 12 to 15. The exact count depends on the zero entries and pivot choices.

What should I do if my computed A⁻¹ does not multiply to the identity?

Check your row operations step by step. A common mistake is failing to apply the same operation to the entire augmented row, both the left and right blocks. Also verify that you did not make arithmetic errors with fractions or decimals.