📚 Linear Algebra, Interactive Edition
⇩ Download ▾

4.2 Cofactor Expansion in Three Dimensions

The last section defined adbc for a 2×2 matrix and read it three ways: as an area, as an orientation, and as a test for invertibility. All three readings survive in higher dimensions, but the formula does not — there is no two-term expression for a 3×3 determinant. What there is instead is a rule that reduces the new case to the old one, applied three times.

Take

M = ( 2 1 0 1 3 1 0 1 2 )

The minor of an entry is the determinant of what remains when you delete that entry's row and column — a 2×2 determinant, which you can already do. Deleting the first row and first column of M leaves (3112), whose determinant is 3(2)1(1)=5. That 5 is the minor of the entry 2 in the corner. The cofactor of an entry is its minor with a sign attached, (1)i+j for the entry in row i and column j — so the cofactor of that corner 2 is +5, and the word in this section's title just means "expansion in terms of those signed minors".

Cofactor expansion says: walk along any one row or column, multiply each entry by its minor, and add the results with alternating signs. Along the first row of M the entries are 2, 1 and 0, so

det M = 2 · 5 1 · 2 + 0 · 1 = 8

where the three minors come from deleting the first row together with each column in turn.

5
The first minor ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The first minor, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

Delete the first row and first column of M and take the determinant of the 2×2 block left behind: 3(2)1(1)=5. Every cofactor expansion is built from determinants this small, which is what makes the rule usable by hand.

2
The second minor ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The second minor, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

Delete the first row and the second column and the remaining block is (1102), of determinant 2. This is the term that carries the minus sign, which is a property of its position — second along the row — and has nothing to do with its entries.

8
The whole determinant ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The whole determinant, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The full 3×3 determinant, computed by a computer algebra system: 8, matching the expansion 2(5)1(2)+0(1) done by hand above.

The signs, and choosing where to walk

The alternating signs follow a fixed checkerboard, starting with a plus in the top-left corner:

( + + + + + )

The sign attached to a term depends only on where the entry sits, never on the entry itself — a common early error is to let a negative entry flip a sign twice.

Because every row and every column gives the same answer, you get to choose, and the choice is worth making. Expanding M along its bottom row, whose entries are 0, 1 and 2 with signs +, , +:

det M = 0 · 1 1 · 2 + 2 · 5 = 8

the same 8 — and, as it happens, through the same three products 10, 2, 0 in a different order, since both walks use all three of the same minors. What changed is the work: the leading 0 multiplied its minor away, so that minor never had to be computed at all. Hence the practical rule: expand along the row or column with the most zeros.

Watching it vanish

Fix the top-left 2×2 block and put the bottom-right entry on a slider:

M g = ( 2 1 0 1 3 1 0 1 g )

Expanding along the bottom row again gives 0·11·2+g·5, so detMg=5g2: a straight line in g, hitting zero at g=0.4 and recovering the value 8 at g=2.

2+5·g
The whole family at once ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The whole family at once, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The determinant computed symbolically in g. It is linear, because g appears in exactly one entry and a cofactor expansion uses each entry at most once — determinants are linear in any single row or column, though emphatically not in the matrix as a whole.

A semi-transparent patch of a plane floating in space, spanned by a red arrow to (2, 1, 0) and a blue arrow to (1, 3, 1) that both start at the origin. A green arrow rises from the origin to (0, 1, g), where a slider sets g, and a dashed amber segment joins the green arrow's tip to a black dot at (0, 1, 0.4) lying in the parallelogram's plane. Dragging the slider down to 0.4 closes that gap, laying the green arrow flat into the parallelogram; there the determinant of the three columns is zero, and above or below it the determinant is the signed amount 5g - 2.Explore in 3D (opens in a new tab)
A patch of the plane spanned by the first two columns, (2,1,0) in red and (1,3,1) in blue. The green arrow is the third column (0,1,g), with g on a slider, and the dashed amber segment measures the gap between its tip and the black dot at (0,1,0.4) — where that column would have to sit to lie flat in the same plane.

Explore the figure

  1. At the default g=2 the green arrow stands well clear of the blue-and-red sheet, and detMg=5(2)2=8, the determinant you computed by hand.
  2. Drag g down and watch two things at once: the dashed gap shrinking, and the value 5g2 heading for zero. They arrive together — the geometry and the arithmetic are reporting the same event.
  3. At g=0.4 the gap closes and the green arrow lies in the sheet. The three columns are now dependent: as the algebra confirms, (0,1,0.4)=0.2(2,1,0)+0.4(1,3,1).
  4. Keep going to g=1. The green arrow has swung out below the sheet and detMg=5(1)2=7. As in the last section, passing through dependence is the only way for the sign to change. (Avoid stopping at exactly g=0 to judge this: there the third column is (0,1,0), which lies along the y-axis and is hard to pick out against it.)

An original work of XYZ Homework, built around interactive XYZ 3D figures. Its chapter sequence is aligned to Interactive Linear Algebra (Margalit & Rabinoff, Georgia Tech, GNU FDL); this work is original, copies nothing from it, and is not affiliated with or endorsed by its authors. License: CC-BY-NC-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.