Linear AlgebraDeterminants

Cramer's Rule and the Adjugate

Solve small systems and invert with determinants.

Not started Jump to practice

Determinants give a formula for each unknown of a square system and for each entry of an inverse. These formulas are rarely the fastest way to compute, but they show exactly how the answer depends on the data, which matters in theory and in hand calculations with symbols.

For an $n \times n$ invertible $A$ and a vector $\mathbf{b}$, let $A_i(\mathbf{b})$ be $A$ with column $i$ replaced by $\mathbf{b}$.

Key idea

Cramer's rule. The unique solution of $A\mathbf{x} = \mathbf{b}$ has $x_i = \dfrac{\det A_i(\mathbf{b})}{\det A}$. Adjugate formula. $A^{-1} = \dfrac{1}{\det A}\operatorname{adj} A$, where $\operatorname{adj} A$ is the transpose of the matrix of cofactors: its $(i, j)$ entry is $C_{ji}$.

Why it works

Let $I_i(\mathbf{x})$ be the identity with column $i$ replaced by $\mathbf{x}$. Expanding along row $i$ shows $\det I_i(\mathbf{x}) = x_i$. Now $A\,I_i(\mathbf{x})$ has columns $A\mathbf{e}_1, \dots, A\mathbf{x}, \dots, A\mathbf{e}_n$, which are the columns of $A$ except that column $i$ is $A\mathbf{x} = \mathbf{b}$. So $A\,I_i(\mathbf{x}) = A_i(\mathbf{b})$. Take determinants with the product rule: $\det A \cdot x_i = \det A_i(\mathbf{b})$. Divide by $\det A$. Applying this to $A\mathbf{x} = \mathbf{e}_j$ (column $j$ of $A^{-1}$) gives the adjugate formula.

Worked example: Cramer for a 2 × 2 system

Solve $3x - 2y = 4$, $5x + y = 11$.
  1. $\det A = \begin{vmatrix} 3 & -2 \\ 5 & 1 \end{vmatrix} = 3 + 10 = 13$.
  2. $\det A_1(\mathbf{b})$ $= \begin{vmatrix} 4 & -2 \\ 11 & 1 \end{vmatrix}$ $= 4 + 22$ $= 26$, so $x = \frac{26}{13} = 2$.
  3. $\det A_2(\mathbf{b})$ $= \begin{vmatrix} 3 & 4 \\ 5 & 11 \end{vmatrix}$ $= 33 - 20$ $= 13$, so $y = \frac{13}{13} = 1$.
  4. Check: $3(2) - 2(1) = 4$ ✓ and $5(2) + 1 = 11$ ✓.

Answer: $(x, y) = (2, 1)$

Worked example: One entry of an inverse

For $A = \begin{bmatrix} 1 & 2 & 0 \\ 0 & 1 & 3 \\ 2 & 0 & 1 \end{bmatrix}$, find the entry of $A^{-1}$ in row 1, column 3.
  1. $\det A$ $= 1\begin{vmatrix} 1 & 3 \\ 0 & 1 \end{vmatrix} - 2\begin{vmatrix} 0 & 3 \\ 2 & 1 \end{vmatrix} + 0$ $= 1 - 2(-6)$ $= 13$.
  2. Entry $(1, 3)$ of $\operatorname{adj} A$ is the cofactor $C_{31}$ (indices swapped): $C_{31} = (+1)\begin{vmatrix} 2 & 0 \\ 1 & 3 \end{vmatrix} = 6$.
  3. So $(A^{-1})_{13} = \frac{6}{13}$.

Answer: $\frac{6}{13}$

For a $2 \times 2$ matrix the adjugate is the familiar swap-and-negate: $\operatorname{adj}\begin{bmatrix} a & b \\ c & d \end{bmatrix}$ $= \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}$, which is where the $2 \times 2$ inverse formula comes from.

Common mistake

Using $C_{ij}$ instead of $C_{ji}$ in position $(i, j)$: the adjugate is the transpose of the cofactor matrix. Check: multiply $A$ by your adjugate; you should get $(\det A)I$.
The system from the first example: the lines cross at $(2, 1)$, the point Cramer's rule found.

Cramer's rule also explains how sensitive a solution can be. Every unknown is a ratio with $\det A$ in the denominator. When $\det A$ is tiny compared with the entries, small changes in $\mathbf{b}$ can cause big swings in $\mathbf{x}$: in the picture, the two lines are nearly parallel, and nudging one of them slides the crossing point far along the other.

For an $n \times n$ system, Cramer's rule needs $n + 1$ determinants. Row reduction is far cheaper for anything beyond small systems, so use Cramer for theory, $2 \times 2$ cases and systems with letters in them. One theoretical payoff: every entry of $A^{-1}$ is a polynomial in the entries of $A$ divided by $\det A$, so the inverse changes smoothly as long as $\det A$ stays away from $0$.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

This is one of the top rungs of Linear Algebra.

Sources and further reading

  • Lay, Lay and McDonald, Linear Algebra and Its Applications, §3.3 Cramer's Rule, Volume, and Linear Transformations
  • MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang, Spring 2010), Lecture 20: Cramer's Rule, Inverse Matrix, and Volume
@teddyrookbook GitHub