Computing Determinants by Cofactor Expansion

How can we compute the determinant of a large matrix? We want to do this without writing out all of its permutation terms. For an n×nn \times n matrix, the Leibniz Permutation Formula sums n!n! signed products. This number explodes catastrophically. A modest 10×1010 \times 10 matrix already has 3,628,8003{,}628{,}800 terms. We need a method that trades this single enormous sum for a manageable recursive procedure. This procedure should mirror how humans and machines actually compute determinants. This applies to computation by hand or in exact arithmetic. Cofactor expansion, also called Laplace expansion, answers this need. It expresses the determinant of an n×nn \times n matrix as a signed sum. This sum involves nn determinants of (n−1)×(n−1)(n-1)\times(n-1) matrices. These are chosen along any single row or column. Applied recursively, it reduces the computation of any determinant to a base case. That base case is 1×11\times 1 matrices. This gives both a concrete algorithm and a powerful proof technique. That technique helps establish properties of determinants by induction on size. The idea matters because it bridges two views of the determinant. One is the abstract, permutation-based definition that guarantees existence and uniqueness. The other is a hands-on recursive formula suitable for direct computation and for inductive proofs. Historically, Laplace's expansion predates a fully rigorous treatment of permutations. It remains the standard tool taught for computing determinants by hand. This applies to matrices of size 33 or 44. It is also used for proving structural facts by induction on matrix size. These facts include multilinearity in rows, the effect of row operations, and the formula for the inverse via the adjugate. This article gives the precise definition of a minor and a cofactor. It states and proves the Laplace expansion theorem along an arbitrary row or column. This proof comes directly from the Leibniz formula. It also works through two nontrivial numerical examples. It examines what goes wrong if expansion is attempted along a "row" that does not exist in the matrix. It previews how cofactor expansion sets up further study. This includes Determinant Properties and Row Operations and the construction of the adjugate matrix in The Adjugate and Cofactor Matrix.

Key takeaways
  • The minor MijM_{ij} of an n×nn\times n matrix AA is the determinant of the (n−1)×(n−1)(n-1)\times(n-1) matrix left after deleting row ii and column jj.
  • The cofactor is the signed minor: Cij=(−1)i+jMijC_{ij} = (-1)^{i+j} M_{ij}.
  • Laplace expansion along row ii: det⁡A=∑j=1naijCij\det A = \sum_{j=1}^n a_{ij} C_{ij}; an analogous formula holds along any column.
  • Every choice of row or column gives the same number — the determinant is well-defined independent of the expansion line.
  • The proof is a direct algebraic regrouping of the n!n! terms of the Leibniz Permutation Formula by the entry each permutation selects in the chosen row.
  • Key idea: cofactor expansion turns one giant sum of n!n! signed products into nn smaller determinants, giving both a recursive algorithm and an induction tool.

Where this lives today

Cofactor expansion remains the standard method for computing determinants of small matrices by hand — 2×22\times 2 and 3×33\times 3 cases appear throughout physics (moment of inertia tensors, Levi-Civita/cross-product computations) and engineering (stiffness and stress tensors). In symbolic computation and computer algebra systems, cofactor-based (Laplace) expansion is used for matrices over general commutative rings (not necessarily fields) where division-based Gaussian elimination is unavailable or introduces unwanted denominators; this matters in exact symbolic computation and in algorithms for computing resultants and characteristic polynomials over polynomial rings. The recursive structure underlying the theorem is the standard inductive scaffold for proving deeper facts about determinants, including multilinearity in each row, the alternating property under row swaps, and the behavior of determinants under Determinant Properties and Row Operations. It also directly produces the entries of the adjugate matrix used in The Adjugate and Cofactor Matrix and in Cramer's Rule for solving linear systems and computing matrix inverses in closed form. In algebraic geometry and combinatorics, expansions by minors generalize to the Laplace expansion along several rows at once (the general Laplace expansion theorem), which underlies the Cauchy–Binet formula relating minors of a product of rectangular matrices. Cofactor-based reasoning also appears in graph theory, via the Matrix-Tree Theorem, where cofactors of the graph Laplacian count spanning trees.

Ask the tutor: Why does mismatching a row's entries with another row's cofactors always sum to zero, and how does that fact underlie the adjugate identity?

DefinitionMinor, Cofactor, and Cofactor Expansion

Let A=(aij)A = (a_{ij}) be an n×nn \times n matrix over a field F\mathbb{F}, with n≥2n \ge 2.

Minor. For indices 1≤i,j≤n1 \le i, j \le n, the (i,j)(i,j) minor of AA, denoted MijM_{ij}, is the determinant of the (n−1)×(n−1)(n-1)\times(n-1) matrix obtained from AA by deleting row ii and column jj.

Cofactor. The (i,j)(i,j) cofactor of AA is the signed minor

Cij=(−1)i+jMij.C_{ij} = (-1)^{i+j} M_{ij}.

Cofactor expansion along row ii: the expression

∑j=1naijCij.\sum_{j=1}^{n} a_{ij} C_{ij}.

Cofactor expansion along column jj: the expression

∑i=1naijCij.\sum_{i=1}^{n} a_{ij} C_{ij}.

For n=1n = 1, we take det⁡A=a11\det A = a_{11} by convention (base case; no minors are defined).

Intuition

Think of the determinant of an n×nn \times n matrix as a signed volume of the parallelepiped spanned by its rows (or columns). Cofactor expansion says: to compute this volume, pick one row, and for each entry in that row, weight the volume of the "opposite" (n−1)(n-1)-dimensional parallelepiped (the minor, obtained by deleting that entry's row and column) by the entry itself, alternating signs as you move across the row. Summing these signed, weighted sub-volumes reconstructs the whole volume. The alternating sign pattern (−1)i+j(-1)^{i+j} is not arbitrary — it is exactly the correction needed so that swapping two rows of AA still flips the overall sign, consistent with the alternating property built into the Leibniz formula. Geometrically, the checkerboard sign pattern below shows where each cofactor's sign comes from.

Figure
Checkerboard sign pattern (−1)i+j(-1)^{i+j} for a 4×44\times 4 matrix
+−+− −+−+ +−+− −+−+

The recursive nature of this expansion means a determinant of size nn reduces, in one step, to nn determinants of size n−1n-1; iterating, it bottoms out at 1×11\times 1 determinants (single entries). This recursion is the natural setting for induction proofs about determinants, and it is also literally how the formula is derived from the Leibniz sum.

TheoremLaplace Cofactor Expansion

Let A=(aij)A = (a_{ij}) be an n×nn \times n matrix over a field F\mathbb{F}, n≥2n \ge 2, and let det⁡A\det A be defined by the Leibniz formula

det⁡A=∑σ∈Snsgn⁡(σ)∏k=1nak,σ(k).\det A = \sum_{\sigma \in S_n} \operatorname{sgn}(\sigma) \prod_{k=1}^{n} a_{k,\sigma(k)}.

Then for every fixed row index i∈{1,…,n}i \in \{1,\dots,n\},

det⁡A=∑j=1naij Cij=∑j=1n(−1)i+jaij Mij,\det A = \sum_{j=1}^{n} a_{ij}\, C_{ij} = \sum_{j=1}^{n} (-1)^{i+j} a_{ij}\, M_{ij},

and for every fixed column index j∈{1,…,n}j \in \{1,\dots,n\},

det⁡A=∑i=1naij Cij=∑i=1n(−1)i+jaij Mij.\det A = \sum_{i=1}^{n} a_{ij}\, C_{ij} = \sum_{i=1}^{n} (-1)^{i+j} a_{ij}\, M_{ij}.

In particular, the value obtained by expanding along any row or any column is the same, and equals det⁡A\det A.

Proof

We prove the row-expansion formula for a fixed row index ii; the column formula follows by the identical argument applied to ATA^T, using det⁡A=det⁡AT\det A = \det A^T (a fact itself provable directly from the Leibniz formula by the substitution σ↦σ−1\sigma \mapsto \sigma^{-1}, which we invoke here as an already-established property of the permutation sum, not as a consequence of cofactor expansion, so there is no circularity).

Step 1: Group the Leibniz sum by the value σ(i)\sigma(i). Fix ii. Every permutation σ∈Sn\sigma \in S_n sends ii to some unique value j=σ(i)∈{1,…,n}j = \sigma(i) \in \{1,\dots,n\}. Partition SnS_n into the disjoint blocks

Sn=⨆j=1nSn(i,j),Sn(i,j):={σ∈Sn:σ(i)=j}.S_n = \bigsqcup_{j=1}^{n} S_n^{(i,j)}, \qquad S_n^{(i,j)} := \{\sigma \in S_n : \sigma(i) = j\}.

Then

det⁡A=∑j=1n∑σ∈Sn(i,j)sgn⁡(σ)∏k=1nak,σ(k)=∑j=1naij∑σ∈Sn(i,j)sgn⁡(σ)∏k≠iak,σ(k),\det A = \sum_{j=1}^{n} \sum_{\sigma \in S_n^{(i,j)}} \operatorname{sgn}(\sigma) \prod_{k=1}^{n} a_{k,\sigma(k)} = \sum_{j=1}^{n} a_{ij} \sum_{\sigma \in S_n^{(i,j)}} \operatorname{sgn}(\sigma) \prod_{k \ne i} a_{k,\sigma(k)},

where we pulled ai,σ(i)=aija_{i,\sigma(i)} = a_{ij} out of the product since it is constant on Sn(i,j)S_n^{(i,j)}. It remains to show that the inner sum

Tij:=∑σ∈Sn(i,j)sgn⁡(σ)∏k≠iak,σ(k)T_{ij} := \sum_{\sigma \in S_n^{(i,j)}} \operatorname{sgn}(\sigma) \prod_{k \ne i} a_{k,\sigma(k)}

equals Cij=(−1)i+jMijC_{ij} = (-1)^{i+j} M_{ij}.

Step 2: Bijection between Sn(i,j)S_n^{(i,j)} and Sn−1S_{n-1}. Let A(i∣j)A(i|j) denote the (n−1)×(n−1)(n-1)\times(n-1) matrix obtained from AA by deleting row ii and column jj; by definition Mij=det⁡A(i∣j)M_{ij} = \det A(i|j). Index the rows of A(i∣j)A(i|j) by k∈{1,…,n}∖{i}k \in \{1,\dots,n\}\setminus\{i\} and its columns by ℓ∈{1,…,n}∖{j}\ell \in \{1,\dots,n\}\setminus\{j\}, in their original (increasing) order, so its (p,q)(p,q) entry (for p,q=1,…,n−1p,q = 1,\dots,n-1 in the compressed indexing) equals ak,ℓa_{k,\ell} where kk is the pp-th element and ℓ\ell is the qq-th element of the respective index sets. Given σ∈Sn(i,j)\sigma \in S_n^{(i,j)}, define τ:{1,…,n}∖{i}→{1,…,n}∖{j}\tau: \{1,\dots,n\}\setminus\{i\} \to \{1,\dots,n\}\setminus\{j\} by τ(k)=σ(k)\tau(k) = \sigma(k) for k≠ik \ne i; this is well defined because σ\sigma is a bijection sending i→ji \to j, so it must send {1,…,n}∖{i}\{1,\dots,n\}\setminus\{i\} bijectively onto {1,…,n}∖{j}\{1,\dots,n\}\setminus\{j\}. Composing with the order-preserving relabelings of {1,…,n}∖{i}\{1,\dots,n\}\setminus\{i\} and {1,…,n}∖{j}\{1,\dots,n\}\setminus\{j\} as {1,…,n−1}\{1,\dots,n-1\}, we obtain a permutation τ′∈Sn−1\tau' \in S_{n-1}. The map σ↦τ′\sigma \mapsto \tau' is a bijection Sn(i,j)→Sn−1S_n^{(i,j)} \to S_{n-1}, since σ\sigma is completely determined by σ(i)=j\sigma(i)=j together with its restriction to {1,…,n}∖{i}\{1,\dots,n\}\setminus\{i\}. Under this bijection,

∏k≠iak,σ(k)=∏p=1n−1(entry (p,τ′(p)) of A(i∣j)),\prod_{k \ne i} a_{k,\sigma(k)} = \prod_{p=1}^{n-1} (\text{entry } (p, \tau'(p)) \text{ of } A(i|j)),

so

∑σ∈Sn(i,j)sgn⁡(σ)∏k≠iak,σ(k)=(a fixed sign factor ϵij)∑τ′∈Sn−1sgn⁡(τ′)∏p=1n−1ap,τ′(p)(i∣j)=ϵij Mij,\sum_{\sigma \in S_n^{(i,j)}} \operatorname{sgn}(\sigma)\prod_{k\ne i} a_{k,\sigma(k)} = \Big(\text{a fixed sign factor } \epsilon_{ij}\Big) \sum_{\tau' \in S_{n-1}} \operatorname{sgn}(\tau') \prod_{p=1}^{n-1} a^{(i|j)}_{p,\tau'(p)} = \epsilon_{ij}\, M_{ij},

where ϵij\epsilon_{ij} is the constant by which sgn⁡(σ)\operatorname{sgn}(\sigma) differs from sgn⁡(τ′)\operatorname{sgn}(\tau') (constant across the block because it depends only on i,ji,j, not on the particular σ\sigma, as shown next).

Step 3: Compute the sign factor ϵij=(−1)i+j\epsilon_{ij} = (-1)^{i+j}. We compute ϵij\epsilon_{ij} by relating σ\sigma to τ′\tau' through explicit transpositions. First handle the case i=j=ni = j = n: here σ(n)=n\sigma(n) = n, so σ\sigma restricted to {1,…,n−1}\{1,\dots,n-1\} is literally an element of Sn−1S_{n-1} (no relabeling needed), and sgn⁡(σ)=sgn⁡(τ′)\operatorname{sgn}(\sigma) = \operatorname{sgn}(\tau') directly from the definition of sign via inversions restricted to {1,…,n−1}\{1,\dots,n-1\} (the pair (k,n)(k,n) for k<nk<n contributes no inversion since σ(k)<n=σ(n)\sigma(k) < n = \sigma(n) never holds... more precisely, since σ(n)=n\sigma(n)=n is the maximum value, no inversion involves index nn). Hence ϵn,n=1=(−1)n+n\epsilon_{n,n} = 1 = (-1)^{n+n}. For general i,ji,j, construct σ\sigma from τ′\tau' (viewed, after relabeling, as a bijection {1,…,n}∖{i}→{1,…,n}∖{j}\{1,\dots,n\}\setminus\{i\} \to \{1,\dots,n\}\setminus\{j\}) by setting σ(i)=j\sigma(i) = j and σ(k)=τ′(k)\sigma(k) = \tau'(k) for k≠ik \ne i. We relate σ\sigma to a permutation of the form handled above by conjugating with cyclic shifts: let ci∈Snc_i \in S_n be the cycle (i  i+1  ⋯  n)(i \; i+1 \; \cdots \; n), which moves position nn to position ii by a cyclic shift, i.e. cic_i has sign (−1)n−i(-1)^{n-i} (a cycle of length n−i+1n-i+1 has sign (−1)(n−i+1)−1=(−1)n−i(-1)^{(n-i+1)-1} = (-1)^{n-i}). Similarly let dj∈Snd_j \in S_n be the cycle (j  j+1  ⋯  n)(j\; j+1\;\cdots\; n) with sign (−1)n−j(-1)^{n-j}. One checks directly that σ=dj σ0 ci−1\sigma = d_j \, \sigma_0\, c_i^{-1} where σ0(n)=n\sigma_0(n) = n and σ0\sigma_0 restricted to {1,…,n−1}\{1,\dots,n-1\} corresponds to τ′\tau' under the appropriate relabeling; taking signs,

sgn⁡(σ)=sgn⁡(dj)sgn⁡(σ0)sgn⁡(ci−1)=(−1)n−jsgn⁡(τ′)(−1)n−i=(−1)2n−i−jsgn⁡(τ′)=(−1)i+jsgn⁡(τ′),\operatorname{sgn}(\sigma) = \operatorname{sgn}(d_j)\operatorname{sgn}(\sigma_0)\operatorname{sgn}(c_i^{-1}) = (-1)^{n-j}\operatorname{sgn}(\tau')(-1)^{n-i} = (-1)^{2n-i-j}\operatorname{sgn}(\tau') = (-1)^{i+j}\operatorname{sgn}(\tau'),

using (−1)2n=1(-1)^{2n} = 1 and (−1)−i−j=(−1)i+j(-1)^{-i-j} = (-1)^{i+j}. Hence ϵij=(−1)i+j\epsilon_{ij} = (-1)^{i+j} for all i,ji,j, independent of the particular σ∈Sn(i,j)\sigma \in S_n^{(i,j)}, confirming the constant claimed in Step 2.

Step 4: Conclude. Combining Steps 1–3,

Tij=ϵijMij=(−1)i+jMij=Cij,T_{ij} = \epsilon_{ij} M_{ij} = (-1)^{i+j} M_{ij} = C_{ij},

and therefore

det⁡A=∑j=1naijTij=∑j=1naijCij,\det A = \sum_{j=1}^{n} a_{ij} T_{ij} = \sum_{j=1}^n a_{ij} C_{ij},

which is exactly the row-ii cofactor expansion. Since ii was an arbitrary fixed row index, this holds for every row. For columns, apply the row result to ATA^T: the (i,j)(i,j) minor of ATA^T equals the (j,i)(j,i) minor of AA (deleting row jj, column ii of AA is the same submatrix, transposed, as deleting row ii, column jj of ATA^T, and transposition does not change a determinant by the already-cited fact det⁡B=det⁡BT\det B = \det B^T applied to the smaller matrices). Hence expanding det⁡(AT)\det(A^T) along its row jj gives ∑i(AT)ji(−1)j+iMijAT-minor=∑iaij(−1)i+jMij\sum_i (A^T)_{ji} (-1)^{j+i} M_{ij}^{A^T\text{-minor}} = \sum_i a_{ij}(-1)^{i+j}M_{ij}, and since det⁡AT=det⁡A\det A^T = \det A, this is the column-jj expansion of AA. Since the right-hand side was shown equal to det⁡A\det A (the Leibniz sum) for every choice of ii, and likewise for every choice of jj, all 2n2n expansions (over nn rows and nn columns) give the same value, namely det⁡A\det A. ■\blacksquare

∎

Worked examples

Example 1 — a 3×33\times 3 matrix, expansion along a chosen row. Let

A=(2−1305−2416).A = \begin{pmatrix} 2 & -1 & 3 \\ 0 & 5 & -2 \\ 4 & 1 & 6 \end{pmatrix}.

We expand along row 2, chosen deliberately (not the first row) to illustrate that any row works, and this row has a zero entry that simplifies the arithmetic. The cofactors needed are C21,C22,C23C_{21}, C_{22}, C_{23}.

M21=det⁡(−1316)=(−1)(6)−(3)(1)=−6−3=−9,C21=(−1)2+1(−9)=9.M_{21} = \det\begin{pmatrix} -1 & 3 \\ 1 & 6 \end{pmatrix} = (-1)(6) - (3)(1) = -6 - 3 = -9, \qquad C_{21} = (-1)^{2+1}(-9) = 9.
M22=det⁡(2346)=(2)(6)−(3)(4)=12−12=0,C22=(−1)2+2(0)=0.M_{22} = \det\begin{pmatrix} 2 & 3 \\ 4 & 6 \end{pmatrix} = (2)(6) - (3)(4) = 12 - 12 = 0, \qquad C_{22} = (-1)^{2+2}(0) = 0.
M23=det⁡(2−141)=(2)(1)−(−1)(4)=2+4=6,C23=(−1)2+3(6)=−6.M_{23} = \det\begin{pmatrix} 2 & -1 \\ 4 & 1 \end{pmatrix} = (2)(1) - (-1)(4) = 2 + 4 = 6, \qquad C_{23} = (-1)^{2+3}(6) = -6.

Row-2 expansion:

det⁡A=a21C21+a22C22+a23C23=(0)(9)+(5)(0)+(−2)(−6)=0+0+12=12.\det A = a_{21}C_{21} + a_{22}C_{22} + a_{23}C_{23} = (0)(9) + (5)(0) + (-2)(-6) = 0 + 0 + 12 = 12.

Check by expanding along column 1 instead, to confirm the theorem's claim of row/column independence.

M11=det⁡(5−216)=30−(−2)=32,C11=(+1)(32)=32.M_{11} = \det\begin{pmatrix}5 & -2\\ 1& 6\end{pmatrix} = 30 - (-2) = 32, \quad C_{11} = (+1)(32) = 32.
M21=−9 (computed above),C21=9.M_{21} = -9 \text{ (computed above)}, \quad C_{21} = 9.
M31=det⁡(−135−2)=(−1)(−2)−(3)(5)=2−15=−13,C31=(+1)(−13)=−13.M_{31} = \det\begin{pmatrix}-1 & 3 \\ 5 & -2\end{pmatrix} = (-1)(-2) - (3)(5) = 2 - 15 = -13, \quad C_{31} = (+1)(-13) = -13.

Column-1 expansion:

det⁡A=a11C11+a21C21+a31C31=(2)(32)+(0)(9)+(4)(−13)=64+0−52=12.\det A = a_{11}C_{11} + a_{21}C_{21} + a_{31}C_{31} = (2)(32) + (0)(9) + (4)(-13) = 64 + 0 - 52 = 12.

Both expansions agree: det⁡A=12\det A = 12.

Example 2 — a 4×44\times 4 matrix, exploiting a sparse column and full recursion. Let

B=(120−130140−2502103).B = \begin{pmatrix} 1 & 2 & 0 & -1 \\ 3 & 0 & 1 & 4 \\ 0 & -2 & 5 & 0 \\ 2 & 1 & 0 & 3 \end{pmatrix}.

Column 3 has entries 0,1,5,00, 1, 5, 0: only two nonzero entries, so we expand along column 3 to minimize work.

det⁡B=a13C13+a23C23+a33C33+a43C43=(0)C13+(1)C23+(5)C33+(0)C43=C23+5 C33.\det B = a_{13}C_{13} + a_{23}C_{23} + a_{33}C_{33} + a_{43}C_{43} = (0)C_{13} + (1)C_{23} + (5)C_{33} + (0)C_{43} = C_{23} + 5\,C_{33}.

Compute M23M_{23}: delete row 2, column 3 of BB:

M23=det⁡(12−10−20213).M_{23} = \det\begin{pmatrix} 1 & 2 & -1 \\ 0 & -2 & 0 \\ 2 & 1 & 3 \end{pmatrix}.

Expand this 3×33\times 3 determinant along its row 2 (again sparse: 0,−2,00,-2,0):

M23=0⋅C21′+(−2)⋅(−1)2+2det⁡(1−123)+0⋅C23′=−2[(1)(3)−(−1)(2)]=−2(3+2)=−10.M_{23} = 0 \cdot C'_{21} + (-2)\cdot(-1)^{2+2}\det\begin{pmatrix}1 & -1\\ 2 & 3\end{pmatrix} + 0\cdot C'_{23} = -2\big[(1)(3)-(-1)(2)\big] = -2(3+2) = -10.

So C23=(−1)2+3M23=(−1)(−10)=10C_{23} = (-1)^{2+3} M_{23} = (-1)(-10) = 10. Compute M33M_{33}: delete row 3, column 3 of BB:

M33=det⁡(12−1304213).M_{33} = \det\begin{pmatrix} 1 & 2 & -1 \\ 3 & 0 & 4 \\ 2 & 1 & 3 \end{pmatrix}.

Expand along row 2 (entries 3,0,43, 0, 4):

M33=3⋅(−1)2+1det⁡(2−113)+0+4⋅(−1)2+3det⁡(1221).M_{33} = 3\cdot(-1)^{2+1}\det\begin{pmatrix}2 & -1\\ 1 & 3\end{pmatrix} + 0 + 4\cdot(-1)^{2+3}\det\begin{pmatrix}1 & 2\\ 2& 1\end{pmatrix}.

Compute the two 2×22\times 2 determinants:

det⁡(2−113)=6−(−1)=7,det⁡(1221)=1−4=−3.\det\begin{pmatrix}2 & -1\\ 1 & 3\end{pmatrix} = 6 - (-1) = 7, \qquad \det\begin{pmatrix}1 & 2\\ 2 & 1\end{pmatrix} = 1 - 4 = -3.

So

M33=3(−1)(7)+4(−1)(−3)=−21+12=−9.M_{33} = 3(-1)(7) + 4(-1)(-3) = -21 + 12 = -9.

Then C33=(−1)3+3M33=−9C_{33} = (-1)^{3+3}M_{33} = -9. Finally,

det⁡B=C23+5C33=10+5(−9)=10−45=−35.\det B = C_{23} + 5C_{33} = 10 + 5(-9) = 10 - 45 = -35.

Verification via a different column. As a check, expand along column 1 of BB, entries 1,3,0,21,3,0,2.

M11=det⁡(014−250103).M_{11} = \det\begin{pmatrix}0 & 1 & 4\\ -2 & 5 & 0\\ 1 & 0 & 3\end{pmatrix}.

Expand along row 1 (0,1,40,1,4):

M11=0+1⋅(−1)1+2det⁡(−2013)+4⋅(−1)1+3det⁡(−2510).M_{11} = 0 + 1\cdot(-1)^{1+2}\det\begin{pmatrix}-2 & 0\\ 1 & 3\end{pmatrix} + 4\cdot(-1)^{1+3}\det\begin{pmatrix}-2 & 5\\ 1 & 0\end{pmatrix}.
det⁡(−2013)=−6,det⁡(−2510)=0−5=−5.\det\begin{pmatrix}-2&0\\1&3\end{pmatrix} = -6, \qquad \det\begin{pmatrix}-2&5\\1&0\end{pmatrix} = 0 - 5 = -5.
M11=1(−1)(−6)+4(1)(−5)=6−20=−14,C11=M11=−14.M_{11} = 1(-1)(-6) + 4(1)(-5) = 6 - 20 = -14, \qquad C_{11} = M_{11} = -14.
M21=det⁡(20−1−250103).M_{21} = \det\begin{pmatrix}2 & 0 & -1\\ -2 & 5 & 0\\ 1 & 0 & 3\end{pmatrix}.

Expand along column 2 (entries 0,5,00,5,0):

M21=5⋅(−1)2+2det⁡(2−113)=5(2⋅3−(−1)(1))=5(6+1)=35.M_{21} = 5\cdot(-1)^{2+2}\det\begin{pmatrix}2 & -1\\ 1 & 3\end{pmatrix} = 5(2\cdot3 - (-1)(1)) = 5(6+1)=35.

C21=(−1)2+1(35)=−35.C_{21} = (-1)^{2+1}(35) = -35.

M41=det⁡(20−1014−250).M_{41} = \det\begin{pmatrix}2 & 0 & -1\\ 0 & 1 & 4\\ -2 & 5 & 0\end{pmatrix}.

Expand along row 1 (entries 2,0,−12,0,-1):

M41=2⋅(−1)1+1det⁡(1450)+(−1)(−1)1+3det⁡(01−25).M_{41} = 2\cdot(-1)^{1+1}\det\begin{pmatrix}1&4\\5&0\end{pmatrix} + (-1)(-1)^{1+3}\det\begin{pmatrix}0&1\\-2&5\end{pmatrix}.
det⁡(1450)=0−20=−20,det⁡(01−25)=0−(−2)=2.\det\begin{pmatrix}1&4\\5&0\end{pmatrix} = 0-20=-20, \qquad \det\begin{pmatrix}0&1\\-2&5\end{pmatrix} = 0-(-2)=2.
M41=2(−20)+(−1)(2)=−40−2=−42,C41=(−1)4+1(−42)=42.M_{41} = 2(-20) + (-1)(2) = -40-2=-42, \qquad C_{41} = (-1)^{4+1}(-42) = 42.

Column-1 expansion, using a11=1,a21=3,a31=0,a41=2a_{11}=1, a_{21}=3, a_{31}=0, a_{41}=2:

det⁡B=1⋅(−14)+3⋅(−35)+0⋅C31+2⋅42=−14−105+0+84=−35.\det B = 1\cdot(-14) + 3\cdot(-35) + 0\cdot C_{31} + 2\cdot 42 = -14 - 105 + 0 + 84 = -35.

Both expansions give det⁡B=−35\det B = -35, confirming the theorem.

CounterexampleWhy the deleted row/column must correspond to an actual entry — expanding along a "generalized diagonal" fails

The theorem requires expanding along a genuine row or column of the matrix, using the actual matrix entries aija_{ij} paired with the correctly indexed cofactor CijC_{ij} (same ii for a row, same jj for a column). If one instead tries to build an "expansion" by pairing entries from a row with cofactors computed for a different row, the resulting sum is generally not the determinant — this shows the hypothesis "sum over jj with fixed ii used consistently in both aija_{ij} and CijC_{ij}" cannot be dropped or mismatched. Take

A=(1234),det⁡A=1⋅4−2⋅3=−2.A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \qquad \det A = 1\cdot 4 - 2 \cdot 3 = -2.

The row-1 cofactors are C11=4C_{11} = 4, C12=−3C_{12} = -3. The correct row-1 expansion is

a11C11+a12C12=(1)(4)+(2)(−3)=4−6=−2=det⁡A,a_{11}C_{11} + a_{12}C_{12} = (1)(4) + (2)(-3) = 4 - 6 = -2 = \det A,

matching the theorem. Now mismatch row 2's entries with row 1's cofactors:

a21C11+a22C12=(3)(4)+(4)(−3)=12−12=0≠det⁡A=−2.a_{21}C_{11} + a_{22}C_{12} = (3)(4) + (4)(-3) = 12 - 12 = 0 \ne \det A = -2.

This "false expansion" (entries of one row paired with cofactors of another) does not compute det⁡A\det A; in fact this particular sum equals zero, which is not a coincidence — it is the determinant of the matrix obtained by replacing row 1 with a copy of row 2 (a matrix with two equal rows, hence determinant 00, by the alternating property of the Leibniz sum). This illustrates precisely why the proof needed the index ii to match between aija_{ij} and CijC_{ij}: the bijection in Step 2 of the proof is built entirely around a single fixed row ii, and breaking that match destroys the identity.

Scope, edge cases & common traps

SituationWhat to doCommon pitfall
n=1n = 1det⁡A=a11\det A = a_{11}, no expansion neededTrying to "expand" a 1×11\times 1 matrix
n=2n = 2Cofactor expansion reduces to a11a22−a12a21a_{11}a_{22} - a_{12}a_{21}Forgetting the sign on off-diagonal cofactors
Row/column with zerosExpand along it to reduce arithmeticChoosing a dense row out of habit, wasting effort
Choosing sign (−1)i+j(-1)^{i+j}Use the checkerboard pattern, start with ++ at (1,1)(1,1)Misplacing which corner is ++; sign errors compound recursively
Large nn (e.g. n≥5n \ge 5)Cofactor expansion is O(n!)O(n!) in the worst case; combine with row reductionTreating cofactor expansion as an efficient general algorithm
Mixing rows/columns mid-computationNot standard; each single expansion must use one fixed row or columnPairing aija_{ij} with CkjC_{kj} for k≠ik \ne i (see counterexample)

The mathematician behind it

Origins · 1 minPierre-Simon Laplace and how this was discovered
PL
Pierre-Simon Laplace
1749–1827 · Enlightenment-era France, celestial mechanics and probability

Laplace was a towering figure of French mathematical physics and probability theory, known for his work on celestial mechanics (culminating in Mécanique Céleste) and for foundational contributions to probability (Théorie Analytique des Probabilités). His 1772 memoir on the theory of elimination among linear equations introduced the expansion of determinants by minors along a row or column, which is why the technique bears his name — although determinant-like calculations for solving linear systems were already implicit in earlier work by Leibniz and, independently and more systematically, by Cramer and Vandermonde.

History
- 1693: Gottfried Wilhelm Leibniz describes determinant-like elimination expressions in correspondence, anticipating the permutation formula.
- 1750: Gabriel Cramer publishes his rule for solving linear systems using ratios of determinants.
- 1772: Pierre-Simon Laplace publishes a memoir developing expansion of determinants along a row or column by minors, generalizing earlier special cases.
- 1812: Augustin-Louis Cauchy systematizes determinant theory, introduces the term "determinant" in its modern sense, and proves the multiplication theorem det⁡(AB)=det⁡(A)det⁡(B)\det(AB) = \det(A)\det(B).
- 1841: Carl Gustav Jacobi popularizes determinants (including the Jacobian) in a widely read treatise, cementing cofactor expansion as a standard computational tool.
Does it matter which row or column I choose to expand along?

No — the Laplace expansion theorem guarantees that expanding along any row or any column of an n×nn\times n matrix produces the same value, namely det⁡A\det A. This is not an assumption but a proven fact, following from regrouping the n!n! terms of the Leibniz formula by the entry selected in the chosen row (or column) and matching the remaining terms bijectively with a smaller symmetric group. In practice you should choose the row or column with the most zero entries, since each zero entry eliminates the need to compute its corresponding minor entirely, saving substantial arithmetic.

Why does the sign pattern alternate as (−1)i+j(-1)^{i+j} rather than some other rule?

The sign (−1)i+j(-1)^{i+j} is forced by the requirement that the cofactor expansion reproduce the alternating Leibniz sum exactly. In the proof, this sign arises as the parity difference between a permutation σ∈Sn\sigma \in S_n fixing σ(i)=j\sigma(i) = j and the induced permutation τ′∈Sn−1\tau' \in S_{n-1} on the remaining indices, computed via explicit cyclic shifts moving position ii and jj to the last slot. The checkerboard pattern (starting with ++ at position (1,1)(1,1)) is simply the visual encoding of this parity computation.

Is cofactor expansion an efficient way to compute large determinants?

No. Naive cofactor expansion has worst-case cost growing like n!n!, since each level of recursion multiplies the number of subproblems by roughly nn. For an n×nn\times n matrix with no helpful zero entries, this becomes computationally infeasible beyond roughly n=10n = 10 or 1212 even on fast computers. In practice, determinants of large matrices are computed via Gaussian elimination (LU decomposition) in O(n3)O(n^3) time, tracking the sign changes from row swaps, as developed under Determinant Properties and Row Operations. Cofactor expansion remains valuable for small matrices, symbolic computation, and theoretical proofs by induction.

Can I combine cofactor expansion with row operations to simplify a computation?

Yes, and this is standard practice. Since row operations such as adding a multiple of one row to another do not change the determinant (a fact studied under Determinant Properties and Row Operations), you can first use such operations to introduce zeros into a row or column, then expand along that sparsified row or column with much less arithmetic. This hybrid approach is often the most efficient hand-computation method for matrices of size 44 to 66.

What is the relationship between cofactor expansion and the adjugate matrix?

The adjugate (or classical adjoint) of AA is the transpose of the matrix of cofactors, adj⁡(A)=(Cji)\operatorname{adj}(A) = (C_{ji}). The Laplace expansion theorem is precisely the statement that multiplying AA by its own cofactor matrix in the matching-index way gives det⁡A\det A on the diagonal; the off-diagonal terms of A⋅adj⁡(A)A \cdot \operatorname{adj}(A) vanish by the "false expansion" phenomenon illustrated in the counterexample above (entries of one row paired with cofactors of a different row sum to zero). This identity, A⋅adj⁡(A)=det⁡(A)IA \cdot \operatorname{adj}(A) = \det(A) I, is developed fully in The Adjugate and Cofactor Matrix and yields a closed-form inverse when det⁡A≠0\det A \ne 0.

Does cofactor expansion work over rings that are not fields, such as the integers or polynomial rings?

Yes. The Leibniz formula and hence the Laplace expansion theorem require only a commutative ring, since the proof uses only addition, multiplication, and the sign of permutations — no division is used anywhere in the argument. This is precisely why cofactor expansion (rather than Gaussian elimination, which requires dividing by pivots) is the preferred method for computing determinants symbolically over polynomial rings, e.g. when computing a characteristic polynomial det⁡(A−λI)\det(A - \lambda I).

What happens if two rows of the matrix are identical — does cofactor expansion still work?

Cofactor expansion still computes the determinant correctly in this case, and the answer will always come out to 00, consistent with the alternating property of determinants (swapping two identical rows leaves the matrix unchanged but must flip the sign of the determinant, forcing det⁡A=−det⁡A\det A = -\det A, hence det⁡A=0\det A = 0). You can verify this using cofactor expansion directly, though the arithmetic will not simplify automatically — the vanishing emerges only after full cancellation in the signed sum, exactly as illustrated in the counterexample block.

Before this

Where this leads