Cramer's Rule
Apply Cramer's Rule to solve n×n systems using ratios of determinants. Understand when Cramer's Rule is efficient (small systems) versus when Gaussian elimination is preferred, and connect to matrix inverses.
A lesson of Pre-Calculus, in Matrices and Linear Systems, about 10 minutes.
By the end of this lesson, you will be able to apply Cramer's Rule to solve 2×2 and 3×3 linear systems using determinants, and understand when Cramer's Rule applies vs. when it fails.
The Big Idea
Cramer's Rule provides an explicit formula for each variable in a linear system $AX = B$ using determinants. While Gaussian elimination is more efficient computationally, Cramer's Rule reveals the theoretical structure of the solution and is used in proving general results about linear systems.
Cramer's Rule for 2×2
For $AX = B$ where $A = \begin{pmatrix}a&b\c&d\end{pmatrix}$, $B = \begin{pmatrix}e\f\end{pmatrix}$:
$$x = \frac{\det(A_x)}{\det(A)}, \quad y = \frac{\det(A_y)}{\det(A)}$$
Where:
- $A_x$ = $A$ with the $x$-column replaced by $B$: $\begin{pmatrix}e&b\f&d\end{pmatrix}$
- $A_y$ = $A$ with the $y$-column replaced by $B$: $\begin{pmatrix}a&e\c&f\end{pmatrix}$
Applies only when $\det(A) \neq 0$ (system has a unique solution).
Example 1 — 2×2 System
$3x + 2y = 7$ and $x - y = 1$
$A = \begin{pmatrix}3&2\1&-1\end{pmatrix}$; $\det(A) = -3 - 2 = -5$
$A_x = \begin{pmatrix}7&2\1&-1\end{pmatrix}$; $\det(A_x) = -7-2 = -9$; $x = -9/-5 = 9/5$
$A_y = \begin{pmatrix}3&7\1&1\end{pmatrix}$; $\det(A_y) = 3-7 = -4$; $y = -4/-5 = 4/5$
Verify: $3(9/5) + 2(4/5) = 27/5 + 8/5 = 7$ ✓; $9/5 - 4/5 = 1$ ✓
Cramer's Rule for 3×3
For $AX = B$ with $X = \begin{pmatrix}x\y\z\end{pmatrix}$:
$$x = \frac{\det(A_x)}{\det(A)}, \quad y = \frac{\det(A_y)}{\det(A)}, \quad z = \frac{\det(A_z)}{\det(A)}$$
Where each $A_x$, $A_y$, $A_z$ replaces the corresponding column with $B$.
Example 2 — 3×3 System
$x + y = 4$, $2x + z = 5$, $y + 3z = 10$
$A = \begin{pmatrix}1&1&0\2&0&1\0&1&3\end{pmatrix}$
$\det(A) = 1(0\cdot3 - 1\cdot1) - 1(2\cdot3 - 1\cdot0) + 0 = -1 - 6 = -7$
$A_x = \begin{pmatrix}4&1&0\5&0&1\10&1&3\end{pmatrix}$
$\det(A_x) = 4(0-1) - 1(15-10) + 0 = -4 - 5 = -9$; wait: $4(0\cdot3-1\cdot1) - 1(5\cdot3-1\cdot10) + 0 = 4(-1) - 1(5) = -4-5 = -9$... but let me also compute: $5\cdot3=15$, $1\cdot10=10$, so $15-10=5$. Then: $-4 - 5 = -9$.
Hmm but $5\cdot3 = 15$ and $1\cdot10 = 10$, yes: $-9$. So $x = -9/-7 = 9/7$.
Actually let me recompute $\det(A)$ properly:
$\det(A) = 1(0\cdot3-1\cdot1) - 1(2\cdot3-1\cdot0) + 0(2\cdot1-0\cdot0) = 1(-1)-1(6)+0 = -7$ ✓
$x = -9/(-7) = 9/7$. This system gives fractional solutions — let me use the earlier worked example from Gaussian elimination instead.