Guides7 min
Cramer's Rule: Solving Linear Systems with Determinants (2×2 and 3×3 Examples)
Cramer's rule writes down the solution of a linear system using nothing but determinants. For two or three equations it is quick and tidy, which is why it shows up so often on exams. This guide shows how the formula is used and when it cannot be used.
What is Cramer's rule?
For a system Ax = b with as many equations as unknowns, if the determinant det(A) of the coefficient matrix is nonzero, the solution is given by
where Aⱼ is the matrix A with its j-th column replaced by b. In other words, you compute one extra determinant per variable.
Example 1: a 2×2 system
First find the determinant of the coefficient matrix. If it is 0, Cramer's rule cannot be used.
For x, replace the first column by b; for y, replace the second column.
Check by substituting: 3·3 + 2·(−1) = 7 and 3 − (−1) = 4, so both equations hold.
Example 2: a 3×3 system
The determinant of the coefficient matrix is −1. It is nonzero, so the system has exactly one solution. The determinants of the matrices with each column replaced by b are shown below.
The solution is (x, y, z) = (2, 3, −1). Solving the same system by Gauss-Jordan elimination gives the same answer.
When Cramer's rule cannot be used
- When det(A) = 0: you cannot divide by zero. The system then has either no solution or infinitely many, and Cramer's rule cannot tell you which; you need elimination for that.
- When the number of equations differs from the number of unknowns: the coefficient matrix is not square, so it has no determinant.
Why Cramer's rule is rarely used in practice
Solving for n variables requires n + 1 determinants of n×n matrices. Determinants are already expensive, so the work grows quickly as n increases. On exams it is best kept to two or three variables; beyond that, elimination is far faster. If you only need a single variable, however, Cramer's rule can be the better choice.
Common mistakes
- Replacing the wrong column with b. x uses column 1, y column 2, z column 3.
- Dividing without first checking whether det(A) is 0.
- Sign errors in the determinants. In a 3×3 expansion, double-check the + − + pattern.
- Replacing a row instead of a column with b. It is the column that gets replaced.
FAQ
Does det(A) = 0 mean there is no solution?
No. There may be no solution or infinitely many. You have to row-reduce the augmented matrix with elimination to decide which.
Can Cramer's rule be used to find an inverse?
The inverse formula using the adjugate rests on the same principle as Cramer's rule. It is covered in Inverse by cofactors and the adjugate.
Can I check this with the calculator?
Yes. Enter the coefficients and constants in the linear system solver and you will get the same solution.
Related guides