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
- Write the coefficient matrix A and the constants vector b.
- Compute D = det(A).
- If D = 0, check all Dᵢ: if all Dᵢ = 0 → infinitely many solutions; if any Dᵢ ≠ 0 → no solution.
- For each variable xᵢ, form Aᵢ by replacing column i of A with b.
- Compute Dᵢ = det(Aᵢ).
- 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.
Worked Example 3 — No Solution Case
System: x₁ + x₂ = 2, 2x₁ + 2x₂ = 5 (scaled inconsistent system)
When to Use Cramer's Rule
| Situation | Recommendation |
|---|---|
| Small system (2×2 or 3×3) | Cramer's Rule is fast and shows explicit dependency on data |
| 4×4 or larger | Gaussian elimination is more efficient |
| Symbolic/parametric system | Cramer's Rule gives closed-form expressions for each variable |
| Singular matrix (D=0) | Use elimination to determine infinite vs no solution |
- Cramer's Rule Calculator — Solve 2×2 to 4×4 systems step by step
- Cramer's Rule Formula — Formula reference with variable definitions
- Row Echelon Method — Gaussian elimination for larger systems
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.