Matrix Inversion Method

The matrix inversion method solves the linear system Ax = b by computing x = A⁻¹b. Unlike Gaussian elimination, this approach produces the inverse matrix explicitly, which is useful when the same coefficient matrix A is used to solve multiple right-hand sides. The inverse is found using cofactors and the adjugate.

Core Formula

Step 1: Compute det(A)

If det(A) = 0, the matrix is singular and the inverse does not exist. The system either has no solution or infinitely many solutions.

Step 2: Compute the Cofactor Matrix

The cofactor Cᵢⱼ is the signed minor obtained by deleting row i and column j:

where Mᵢⱼ is the determinant of the (n−1)×(n−1) matrix obtained by removing row i and column j.

Step 3: Transpose to Get the Adjugate

Step 4: Compute A⁻¹

Step 5: Multiply X = A⁻¹ · B

The solution vector X is the matrix product of A⁻¹ and the column vector B.

Worked Example — 2×2 System

Solve: 4x₁ + 7x₂ = 1, 2x₁ + 6x₂ = 0

Solution: x₁ = 3/5, x₂ = −1/5. Verify: 4(3/5)+7(−1/5) = 12/5−7/5 = 1 ✓

Worked Example — 3×3 System (Full Steps)

Solve: x₁ + 2x₂ + 3x₃ = 14, x₁ + x₂ + x₃ = 6, 2x₁ + x₂ + x₃ = 8

Step 1 — det(A) expanding along row 1:

Step 2 — Cofactor matrix C (sign pattern +−+ / −+− / +−+):

Step 3 — Adjugate = Cᵀ:

Step 4 — A⁻¹ = adj(A) / det(A) = adj(A) / (−1):

Step 5 — X = A⁻¹·B:

Solution: x₁ = 2, x₂ = 0, x₃ = 4. Verify: 2+0+12 = 14 ✓, 2+0+4 = 6 ✓, 4+0+4 = 8 ✓

Comparison with Other Methods

MethodBest ForLimitation
Cramer's Rule2×2, 3×3, explicit formulaO(n!) complexity for large n
Gaussian EliminationAny size, all casesDoes not produce A⁻¹ directly
Matrix InversionSame A with multiple b vectorsOnly for invertible n×n, slower than LU

Frequently Asked Questions

Why compute A⁻¹ at all?

If you need to solve Ax = b for many different right-hand sides b with the same matrix A (e.g., simulation runs or data batches), computing A⁻¹ once lets you solve each new system with a single matrix-vector multiplication.

What is the sign pattern for cofactors?

The sign pattern is (−1)ⁱ⁺ʲ, which creates a checkerboard of + and − signs starting with + at position (1,1): + − + / − + − / + − + for a 3×3 matrix.

Is there a shortcut for 2×2 matrices?

Yes. For A = [[a,b],[c,d]], the inverse is A⁻¹ = (1/(ad−bc))·[[d,−b],[−c,a]]. Simply swap the diagonal entries, negate the off-diagonal entries, and divide by the determinant.

Can this method detect infinitely many solutions?

Partially. If det(A) = 0, you know the system does not have a unique solution, but matrix inversion cannot distinguish between no solution and infinitely many solutions. Use Gaussian elimination for that.