Overview
Cramer's Rule provides an explicit formula for solving systems of linear equations using determinants. While computationally intensive for large systems, it's useful for theoretical purposes and small systems.
Prerequisites
The system must be square (n n n equations, n n n unknowns)
The coefficient matrix A A A must be invertible (det ( A ) ≠ 0 \det(A) \neq 0 det ( A ) = 0 )
The Formula
For the system A x = b A\mathbf{x} = \mathbf{b} A x = b where A A A is n × n n \times n n × n :
x i = det ( A i ) det ( A ) x_i = \frac{\det(A_i)}{\det(A)} x i = d e t ( A ) d e t ( A i )
where A i A_i A i is A A A with column i i i replaced by b \mathbf{b} b .
2×2 System
For:
a 1 x + b 1 y = c 1 a_1 x + b_1 y = c_1 a 1 x + b 1 y = c 1
a 2 x + b 2 y = c 2 a_2 x + b_2 y = c_2 a 2 x + b 2 y = c 2
Solutions:
x = ∣ c 1 b 1 c 2 b 2 ∣ ∣ a 1 b 1 a 2 b 2 ∣ , y = ∣ a 1 c 1 a 2 c 2 ∣ ∣ a 1 b 1 a 2 b 2 ∣ x = \frac{\begin{vmatrix} c_1 & b_1 \\ c_2 & b_2 \end{vmatrix}}{\begin{vmatrix} a_1 & b_1 \\ a_2 & b_2 \end{vmatrix}}, \qquad y = \frac{\begin{vmatrix} a_1 & c_1 \\ a_2 & c_2 \end{vmatrix}}{\begin{vmatrix} a_1 & b_1 \\ a_2 & b_2 \end{vmatrix}} x = a 1 a 2 b 1 b 2 c 1 c 2 b 1 b 2 , y = a 1 a 2 b 1 b 2 a 1 a 2 c 1 c 2
Example: 2×2 System
Solve:
3 x + 2 y = 7 3x + 2y = 7 3 x + 2 y = 7
x − y = 1 x - y = 1 x − y = 1
Step 1: Calculate det ( A ) \det(A) det ( A )
det ( A ) = ∣ 3 2 1 − 1 ∣ = 3 ( − 1 ) − 2 ( 1 ) = − 5 \det(A) = \begin{vmatrix} 3 & 2 \\ 1 & -1 \end{vmatrix} = 3(-1) - 2(1) = -5 det ( A ) = 3 1 2 − 1 = 3 ( − 1 ) − 2 ( 1 ) = − 5
Step 2: Calculate det ( A 1 ) \det(A_1) det ( A 1 ) - replace column 1 with b \mathbf{b} b
det ( A 1 ) = ∣ 7 2 1 − 1 ∣ = 7 ( − 1 ) − 2 ( 1 ) = − 9 \det(A_1) = \begin{vmatrix} 7 & 2 \\ 1 & -1 \end{vmatrix} = 7(-1) - 2(1) = -9 det ( A 1 ) = 7 1 2 − 1 = 7 ( − 1 ) − 2 ( 1 ) = − 9
Step 3: Calculate det ( A 2 ) \det(A_2) det ( A 2 ) - replace column 2 with b \mathbf{b} b
det ( A 2 ) = ∣ 3 7 1 1 ∣ = 3 ( 1 ) − 7 ( 1 ) = − 4 \det(A_2) = \begin{vmatrix} 3 & 7 \\ 1 & 1 \end{vmatrix} = 3(1) - 7(1) = -4 det ( A 2 ) = 3 1 7 1 = 3 ( 1 ) − 7 ( 1 ) = − 4
Step 4: Apply Cramer's Rule
x = det ( A 1 ) det ( A ) = − 9 − 5 = 9 5 = 1.8 x = \frac{\det(A_1)}{\det(A)} = \frac{-9}{-5} = \frac{9}{5} = 1.8 x = d e t ( A ) d e t ( A 1 ) = − 5 − 9 = 5 9 = 1.8
y = det ( A 2 ) det ( A ) = − 4 − 5 = 4 5 = 0.8 y = \frac{\det(A_2)}{\det(A)} = \frac{-4}{-5} = \frac{4}{5} = 0.8 y = d e t ( A ) d e t ( A 2 ) = − 5 − 4 = 5 4 = 0.8
3×3 System
For three unknowns x x x , y y y , z z z :
x = det ( A x ) det ( A ) , y = det ( A y ) det ( A ) , z = det ( A z ) det ( A ) x = \frac{\det(A_x)}{\det(A)}, \quad y = \frac{\det(A_y)}{\det(A)}, \quad z = \frac{\det(A_z)}{\det(A)} x = d e t ( A ) d e t ( A x ) , y = d e t ( A ) d e t ( A y ) , z = d e t ( A ) d e t ( A z )
where A x A_x A x , A y A_y A y , A z A_z A z have the x x x , y y y , z z z columns replaced by b \mathbf{b} b .
Example: 3×3 System
Solve:
x + 2 y + z = 4 x + 2y + z = 4 x + 2 y + z = 4
2 x + y + z = 5 2x + y + z = 5 2 x + y + z = 5
x + y + 2 z = 6 x + y + 2z = 6 x + y + 2 z = 6
A = [ 1 2 1 2 1 1 1 1 2 ] , b = [ 4 5 6 ] A = \begin{bmatrix} 1 & 2 & 1 \\ 2 & 1 & 1 \\ 1 & 1 & 2 \end{bmatrix}, \quad \mathbf{b} = \begin{bmatrix} 4 \\ 5 \\ 6 \end{bmatrix} A = 1 2 1 2 1 1 1 1 2 , b = 4 5 6
det ( A ) = 1 ( 1 × 2 − 1 × 1 ) − 2 ( 2 × 2 − 1 × 1 ) + 1 ( 2 × 1 − 1 × 1 ) \det(A) = 1(1 \times 2 - 1 \times 1) - 2(2 \times 2 - 1 \times 1) + 1(2 \times 1 - 1 \times 1) det ( A ) = 1 ( 1 × 2 − 1 × 1 ) − 2 ( 2 × 2 − 1 × 1 ) + 1 ( 2 × 1 − 1 × 1 )
= 1 ( 1 ) − 2 ( 3 ) + 1 ( 1 ) = 1 − 6 + 1 = − 4 = 1(1) - 2(3) + 1(1) = 1 - 6 + 1 = -4 = 1 ( 1 ) − 2 ( 3 ) + 1 ( 1 ) = 1 − 6 + 1 = − 4
(After calculating all modified determinants)
x = 1 x = 1 x = 1 , y = 1 y = 1 y = 1 , z = 2 z = 2 z = 2
Advantages
Gives explicit formula for each variable
Useful for parametric solutions (variables in terms of parameters)
Good for theoretical analysis
Easy to compute for 2 × 2 2 \times 2 2 × 2 and 3 × 3 3 \times 3 3 × 3 systems
Limitations
Only works for square systems with unique solutions
Computationally expensive for large n n n (requires n + 1 n+1 n + 1 determinants)
Each determinant computation is O ( n ! ) O(n!) O ( n !)
Not numerically stable for large systems
Comparison with Other Methods
Method Better For Cramer's Rule Small systems, symbolic computation Gaussian Elimination General systems, numerical computation Matrix Inverse Multiple systems with same A A A LU Decomposition Large systems, repeated solving
When to Use
Use Cramer's Rule when:
System is small (2 × 2 2 \times 2 2 × 2 or 3 × 3 3 \times 3 3 × 3 )
Need explicit formula for solution
Solving symbolically (parameters in coefficients)
Theoretical derivations
Avoid when:
System is large (n > 4 n > 4 n > 4 )
Need numerical efficiency
System may be singular or nearly singular