Cramer's Rule: How to Use It, Why It Works, and When Not to Use It
Cramer's rule gives a direct formula for each unknown of a linear system — no row reduction and no inverse. It is perfect for exam questions that ask for a single unknown, but it has limits you must know. This article collects how to use it, where it comes from, the special cases and its practical range in one place.
xi=ΔΔi, where Δ=detA and Δi is the determinant of A with column i replaced by the constants b
Valid when A is square and Δ=0 · one unknown needs only two determinants
For systems larger than 3×3, or in software, use Gaussian elimination or LU instead
The rule in one sentence
Compute the determinant Δ of the coefficient matrix, put the right-hand constants in place of the column of the unknown you want, compute the new determinant Δi, and divide.
A 2×2 example: replacing the first column by b gives Δx; replacing the second gives Δy.3x+2yx−y=7=−1⇒Δ=312−1=−5,x=−57−12−1=−5−5=1,y=−5317−1=−5−10=2
3×3 systems: solve only for what is asked
Example
Find y from 2x+y−z=3,x+3y+2z=14,3x−y+z=2
Δ=21313−1−121=2(3+2)−1(1−6)+(−1)(−1−9)=25
Δy=2133142−121=2(14−4)−3(1−6)+(−1)(2−42)=75
y=75/25=3 — no need to find x and z at all
All three unknowns of a 3×3 system need four determinants. Always check by substituting back, or use the step-by-step Cramer calculator (in Thai).
Why the rule works (a two-line proof)
Let Xi be the identity matrix with column i replaced by the solution vector x. Multiplying by A, column i becomes Ax=b while the other columns stay those of A, so AXi=Ai. Now use det(AB)=detAdetB:
detA⋅detXi=detAi,detXi=xi⇒xi=detAdetAi
Seen another way, Cramer's rule is x=A−1b=detAadjAb written one unknown at a time, so it always agrees with the inverse method.
When Δ = 0, and parameter-k problems
If Δ=0 the formula fails, and the system has either no solution or infinitely many. A favourite exam example:
kx+yx+ky=1=1Δ=k2−1,Δx=Δy=k−1
k=±1: x=y=k+11
k=1: Δ=Δx=Δy=0; both equations are the same line → infinitely many solutions
k=−1: Δ=0 but Δx=−2=0 → parallel lines → no solution
Trap Never cancel the factor (k−1) before checking k=1. And for 3×3 systems, even if Δ and every Δi are zero the system can still have no solution — use rank to decide (in Thai).
When to use it, and when not to
Use it for
Avoid it for
2–3 unknowns by hand
4 or more unknowns
A single unknown, e.g. one mesh current
Δ=0 or very close to zero
Symbolic coefficients (R, k, s) when you want a general formula
Different numbers of equations and unknowns
2×2 AC circuits with complex impedances
Software that needs speed and numerical accuracy
Cost is the main reason. With determinants by cofactor expansion, Cramer's rule needs about (n+1)! multiplications, so a 20-unknown system needs about 5×1019 of them (roughly 1,600 years at a billion per second), while Gaussian elimination needs about n3/3≈2,700. Details are in numerical solution of linear systems (in Thai).
When the number of equations equals the number of unknowns (a square coefficient matrix) and the determinant of the coefficient matrix is non-zero. If Δ = 0 the system has either no solution or infinitely many, and row reduction is needed to tell which.
Why is Cramer's rule fast in exams?
If the question asks for only one unknown you need just two determinants, Δ and the determinant for that unknown, instead of solving for everything or inverting the whole matrix. It is ideal for 2–3 unknowns by hand.
Why don't computer programs use Cramer's rule?
The cost explodes. With cofactor expansion a 20-unknown system needs about 5 × 10¹⁹ multiplications, while Gaussian elimination needs about 2,700, and Gaussian elimination with partial pivoting is also more stable numerically.
Can Cramer's rule be used for AC circuits?
Yes. It uses only addition, subtraction, multiplication and division, so it works directly with complex impedances, and also with the Laplace variable s, where Δ(s) = 0 is the characteristic equation of the circuit.