Cramer's Rule

Cramer's Rule expresses the solution of a square linear system Ax = b entirely in terms of determinants. It gives an explicit formula for each variable without row reduction, making it ideal for small systems and for understanding how the solution depends on the data.

Statement of Cramer's Rule

Given a system of n equations in n unknowns Ax = b where det(A) ≠ 0, the unique solution is:

where D = det(A) and Dᵢ = det(Aᵢ), with Aᵢ being the matrix A with its i-th column replaced by the constants vector b.

Step-by-Step Method

  1. Write the coefficient matrix A and the constants vector b.
  2. Compute D = det(A).
  3. If D = 0, check all Dᵢ: if all Dᵢ = 0 → infinitely many solutions; if any Dᵢ ≠ 0 → no solution.
  4. For each variable xᵢ, form Aᵢ by replacing column i of A with b.
  5. Compute Dᵢ = det(Aᵢ).
  6. Divide: xᵢ = Dᵢ / D.

Worked Example 1 — 2×2 System

Solve: 3x₁ − 2x₂ = 7 and x₁ + 4x₂ = 5

Worked Example 2 — 3×3 System

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

Expanding along the first row: D = 1·[(−1)(−1)−(1)(2)] − 1·[(2)(−1)−(1)(1)] + 1·[(2)(2)−(−1)(1)] = 1·(−1) − 1·(−3) + 1·(5) = −1 + 3 + 5 = 7

Similarly D₁ = 7, D₂ = 7, D₃ = 7, giving x₁ = x₂ = x₃ = 1.

Solution: x₁ = x₂ = x₃ = 1. Verify: 1+1+1 = 6 ✓, 2(1)−1+1 = 2 ✓, 1+2(1)−1 = 2 ✓

Worked Example 3 — No Solution Case

System: x₁ + x₂ = 2, 2x₁ + 2x₂ = 5 (scaled inconsistent system)

D = 0 but D₁ ≠ 0 → the system has no solution (inconsistent).

When to Use Cramer's Rule

SituationRecommendation
Small system (2×2 or 3×3)Cramer's Rule is fast and shows explicit dependency on data
4×4 or largerGaussian elimination is more efficient
Symbolic/parametric systemCramer's Rule gives closed-form expressions for each variable
Singular matrix (D=0)Use elimination to determine infinite vs no solution

Frequently Asked Questions

Why is Cramer's Rule not used for large systems?

Computing each n×n determinant requires O(n!) operations by cofactor expansion. For n = 10, this means billions of multiplications. Gaussian elimination solves the same system in O(n³) operations.

Can Cramer's Rule detect infinitely many solutions?

Yes. If D = 0 and all Dᵢ = 0, the system is dependent and has infinitely many solutions. However, Cramer's Rule cannot explicitly describe the solution set — use Gaussian elimination for that.

Does Cramer's Rule work for non-homogeneous systems only?

Cramer's Rule works for any n×n system Ax = b. For homogeneous systems (b = 0) with D ≠ 0, all xᵢ = 0 (trivial solution). For D = 0, non-trivial solutions may exist.