In precalculus you computed $2 \times 2$ and $3 \times 3$ determinants. The determinant is a single number that tells whether a square matrix is invertible (it is exactly when $\det A \neq 0$), and, as we will see, how much the matrix stretches area or volume. Cofactor expansion computes it for any size by breaking it into smaller determinants.
For a $2 \times 2$ matrix, $\det\begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc$. For a larger $A$, let $A_{ij}$ be the matrix left after deleting row $i$ and column $j$. Its determinant $M_{ij} = \det A_{ij}$ is the minor, and $C_{ij} = (-1)^{i+j}M_{ij}$ is the cofactor.
Key idea
The signs $(-1)^{i+j}$ form a checkerboard that starts with $+$ in the top-left corner: $$\begin{bmatrix} + & - & + & - \\ - & + & - & + \\ + & - & + & - \\ - & + & - & + \end{bmatrix}$$
Why it works
Worked example: Choosing a good row
- Row 2 has a zero, so expand along it. Its signs are $-\ +\ -$.
- $a_{21} = 1$: $C_{21}$ $= -\begin{vmatrix} -1 & 3 \\ 1 & 5 \end{vmatrix}$ $= -\big((-1)(5) - (3)(1)\big)$ $= -(-8)$ $= 8$.
- $a_{22} = 4$: $C_{22}$ $= +\begin{vmatrix} 2 & 3 \\ -2 & 5 \end{vmatrix}$ $= (2)(5) - (3)(-2)$ $= 16$.
- $a_{23} = 0$ contributes nothing.
- $\det A = 1(8) + 4(16) + 0 = 72$.
Answer: $72$
Worked example: A 4 × 4 with a sparse row
- Row 3 has only one nonzero entry, $b_{33} = 5$, with sign $(-1)^{3+3} = +$.
- $\det B = 5\cdot\begin{vmatrix} 3 & 0 & -1 \\ 1 & 2 & 4 \\ 2 & 1 & 3 \end{vmatrix}$ (delete row 3 and column 3).
- Expand the $3 \times 3$ along row 1: $3\begin{vmatrix} 2 & 4 \\ 1 & 3 \end{vmatrix} - 0 + (-1)\begin{vmatrix} 1 & 2 \\ 2 & 1 \end{vmatrix}$ $= 3(2) - (1 - 4)$ $= 6 + 3$ $= 9$.
- $\det B = 5 \cdot 9 = 45$.
Answer: $45$
Common mistake
A useful special case: if $A$ is triangular (all zeros below or above the diagonal), expanding down the first column again and again shows that $\det A$ is the product of the diagonal entries.