Cramer's Rule — Definition, Formula & Examples
Cramers Rule
A method for solving a linear system of equations using determinants. Cramers rule may only be used when the system is square and the coefficient matrix is invertible.


See also
Key Formula
xi=det(A)det(Ai)
Where:
- xi = The value of the i-th unknown variable in the system
- A = The coefficient matrix of the system
- Ai = The matrix formed by replacing the i-th column of A with the constant vector b
- det = The determinant of a matrix
Worked Example
Problem: Solve the system using Cramer's Rule:
2x + 3y = 8
x − 4y = −3
Step 1: Write the coefficient matrix A and compute its determinant.
A=(213−4),det(A)=(2)(−4)−(3)(1)=−8−3=−11
Step 2: Since det(A) = −11 ≠ 0, the system has a unique solution. Form A_x by replacing the first column (the x-coefficients) with the constants (8, −3).
Ax=(8−33−4),det(Ax)=(8)(−4)−(3)(−3)=−32+9=−23
Step 3: Form A_y by replacing the second column (the y-coefficients) with the constants.
Ay=(218−3),det(Ay)=(2)(−3)−(8)(1)=−6−8=−14
Step 4: Apply Cramer's Rule to find x and y.
x=det(A)det(Ax)=−11−23=1123,y=det(A)det(Ay)=−11−14=1114
Answer: x = 23/11 and y = 14/11
Another Example
This example extends Cramer's Rule to a 3×3 system, showing how to compute 3×3 determinants by cofactor expansion and how the same replacement process applies to each variable.
Problem: Solve the 3×3 system using Cramer's Rule:
x + 2y + z = 9
2x − y + 3z = 8
3x + y − z = 2
Step 1: Write the coefficient matrix A and compute its determinant using expansion by cofactors along the first row.
A = \begin{pmatrix} 1 & 2 & 1 \\ 2 & -1 & 3 \\ 3 & 1 & -1 \end{pmatrix}$$$$\det(A) = 1\bigl((-1)(-1)-(3)(1)\bigr) - 2\bigl((2)(-1)-(3)(3)\bigr) + 1\bigl((2)(1)-(-1)(3)\bigr)$$$$= 1(1-3) - 2(-2-9) + 1(2+3) = -2 + 22 + 5 = 25
Step 2: Form A_x by replacing column 1 with the constants (9, 8, 2) and compute its determinant.
A_x = \begin{pmatrix} 9 & 2 & 1 \\ 8 & -1 & 3 \\ 2 & 1 & -1 \end{pmatrix}$$$$\det(A_x) = 9(1-3) - 2(-8-6) + 1(8+2) = 9(-2) - 2(-14) + 10 = -18 + 28 + 10 = 20
Step 3: Form A_y by replacing column 2 with the constants and compute its determinant.
A_y = \begin{pmatrix} 1 & 9 & 1 \\ 2 & 8 & 3 \\ 3 & 2 & -1 \end{pmatrix}$$$$\det(A_y) = 1(-8-6) - 9(-2-9) + 1(4-24) = -14 + 99 - 20 = 65
Step 4: Form A_z by replacing column 3 with the constants and compute its determinant.
A_z = \begin{pmatrix} 1 & 2 & 9 \\ 2 & -1 & 8 \\ 3 & 1 & 2 \end{pmatrix}$$$$\det(A_z) = 1(-2-8) - 2(4-24) + 9(2+3) = -10 + 40 + 45 = 75
Step 5: Apply Cramer's Rule for each variable.
x=2520=54,y=2565=513,z=2575=3
Answer: x = 4/5, y = 13/5, z = 3
Frequently Asked Questions
When can you not use Cramer's Rule?
You cannot use Cramer's Rule when the determinant of the coefficient matrix is zero, because division by zero is undefined. A zero determinant means the system either has no solution or infinitely many solutions. The rule also requires the system to be square — the number of equations must equal the number of unknowns.
Is Cramer's Rule efficient for large systems?
For large systems (say, 4×4 or bigger), Cramer's Rule is computationally expensive because it requires calculating many determinants. Methods like Gaussian elimination or matrix factorization are far more efficient in practice. Cramer's Rule is most useful for 2×2 and 3×3 systems or for theoretical purposes.
What is the difference between Cramer's Rule and Gaussian elimination?
Cramer's Rule uses determinants to express each variable as a fraction of two determinants, giving a direct formula for each unknown. Gaussian elimination transforms the system into row-echelon form through row operations and then solves by back-substitution. Gaussian elimination is generally faster and works even when the system is not square.
Cramer's Rule vs. Gaussian Elimination
| Cramer's Rule | Gaussian Elimination | |
|---|---|---|
| Approach | Uses ratios of determinants to find each variable directly | Uses row operations to reduce the system, then back-substitutes |
| Requirements | System must be square with det(A) ≠ 0 | Works on any system (square or non-square, any determinant) |
| Efficiency (n equations) | Requires computing n + 1 determinants; impractical for large n | O(n³) operations; efficient for large systems |
| Best used for | Small systems (2×2, 3×3) or finding one specific variable | Systems of any size; standard computational method |
| Output | Explicit formula for each variable | Row-echelon or reduced row-echelon form of the augmented matrix |
Why It Matters
Cramer's Rule appears in linear algebra and precalculus courses as a key application of determinants. It gives you a compact, closed-form expression for each variable, which is valuable in proofs and theoretical work — for instance, showing how a solution depends continuously on the system's coefficients. In engineering and physics, the rule is useful for quickly solving small systems that arise in circuit analysis, force equilibrium, and coordinate transformations.
Common Mistakes
Mistake: Replacing the wrong column when forming A_i
Correction: To solve for the i-th variable, you must replace the i-th column of the coefficient matrix with the constant vector b. A common error is replacing column 1 when solving for y. Double-check which variable corresponds to which column.
Mistake: Forgetting to check whether det(A) = 0 before applying the rule
Correction: Always compute det(A) first. If det(A) = 0, the coefficient matrix is not invertible and Cramer's Rule does not apply. The system is either inconsistent (no solution) or dependent (infinitely many solutions), and you need a different method.
Related Terms
- Linear System of Equations — The type of system Cramer's Rule solves
- Determinant — The core computation used in the rule
- Coefficient Matrix — The matrix whose columns are replaced
- Invertible Matrix — Required condition: det(A) ≠ 0
- Square System of Equations — Cramer's Rule requires equal equations and unknowns
- Expansion by Cofactors — Common technique for computing the determinants
- Cofactor — Building block of determinant computation
