Back to the on-screen lesson ·

Determinants by cofactor expansion

Minors, the checkerboard of signs, why every row and column give the same number, and why the method stops scaling at about five by five.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to write the minor and the cofactor of any entry of a square matrix, expand a determinant along any row or column and know that the answer does not depend on which, choose the line that carries the most zeros and say how much that choice saves, read the determinant of a triangular matrix straight off its diagonal, and say why cofactor expansion is the definition of the determinant and not the way a large one is ever computed.

2. The number you already know for a two by two

You have met $ad - bc$ before: it decides whether $\begin{pmatrix} a & b \\ c & d \end{pmatrix}$ has an inverse, and it appears in the formula for that inverse. This lesson says what that number is the two-by-two case of, and how to compute the same thing for a matrix of any size.

3. Minor, cofactor, expansion

The minor $M_{ij}$ of a square matrix $A$ is the determinant of the smaller matrix left when row $i$ and column $j$ are deleted. The cofactor is $C_{ij} = (-1)^{i+j} M_{ij}$ — the minor with a sign attached that depends only on the position. An expansion along row $i$ is the sum $a_{i1}C_{i1} + a_{i2}C_{i2} + \dots + a_{in}C_{in}$; along a column it is the same sum taken down instead of across. A matrix whose determinant is zero is singular, and one whose determinant is not is invertible.

4. One number, computed any of many ways

The determinant of a $1 \times 1$ matrix is its entry. For larger matrices it is defined recursively: pick any row, multiply each entry by its cofactor, and add.

$$\det A = a_{i1}C_{i1} + a_{i2}C_{i2} + \dots + a_{in}C_{in}$$

Each cofactor is a determinant of a matrix one size smaller, so the definition unwinds down to $1 \times 1$ and stops. For $2 \times 2$ it gives $ad - bc$ straight away; for $3 \times 3$ it gives the familiar three terms.

The theorem that makes it usable: every one of the $2n$ possible expansions — one per row and one per column — gives the same number. The determinant therefore belongs to the matrix and not to the route taken to it.

That freedom is worth more than it first appears, because a zero entry contributes nothing at all: its whole term drops out before its cofactor has to be computed. A row with two zeros in a $3 \times 3$ matrix turns three $2 \times 2$ determinants into one. Choosing the emptiest line is not a trick; it is the only thing that makes the method survive past $3 \times 3$ by hand.

The signs are not alternating along a list — they are a checkerboard, $(-1)^{i+j}$, starting with $+$ in the top-left corner and flipping with every step in either direction:

$$\begin{pmatrix} + & - & + \\ - & + & - \\ + & - & + \end{pmatrix}$$

Another way: picture

Put a finger on the entry you are expanding about. Sweep it along its row and down its column, and everything it touches is deleted; what is left, closed up without moving anything about, is the minor. The sign comes from the checkerboard drawn over the matrix: if you can walk from the top-left corner to your finger in an even number of steps, the sign is $+$, and if an odd number, $-$.

Another way: steps

  1. Count the zeros in every row and every column, and pick the line with the most.
  2. For each non-zero entry in that line, delete its row and column and take the determinant of what is left.
  3. Attach the sign $(-1)^{i+j}$ from the entry's position, not from its place in the sum.
  4. Multiply each entry by its signed minor and add. Entries that are zero are skipped entirely.

5. Triangular matrices, and why they are the target

If every entry below the diagonal is zero, expand down the first column. Only the top-left entry is non-zero, so one term survives and its minor is again triangular. Repeating the argument strips one row and one column at a time, and what is left at the end is the product of the diagonal:

$$\det \begin{pmatrix} a & & \\ 0 & b & * \\ 0 & 0 & c \end{pmatrix} = abc$$

The entries marked $*$ never appear. The same holds for a lower-triangular matrix, expanding along the first row instead, and for a diagonal matrix by either argument.

This is the single most useful special case in the subject, and the next lesson is built on it: if row operations can turn any matrix into a triangular one while keeping track of what they do to the determinant, then every determinant is a product of $n$ numbers rather than a sum of $n!$ terms.

6. What cofactor expansion costs

Unwind the recursion and count. A $3 \times 3$ determinant is $3$ terms, each needing a $2 \times 2$ determinant, which is $2$ terms: $6$ products. A $4 \times 4$ is $4$ of those: $24$. In general the expansion has $n!$ terms, each a product of $n$ entries.

SizeTermsRoughly
$3 \times 3$$6$instant
$5 \times 5$$120$a long afternoon
$10 \times 10$$3{,}628{,}800$not by hand
$20 \times 20$$2.4 \times 10^{18}$not by any computer, ever

Elimination to triangular form costs about $n^3/3$ operations instead: $2{,}700$ for a $20 \times 20$ matrix, against $10^{18}$. So cofactor expansion is the definition and the method for small or mostly-empty matrices, and reduction is what anything larger actually uses. Knowing both, and knowing which is which, is the point of this unit.

7. Where the signs and the minors go wrong

The sign belongs to the position, not to the order of the sum. Expanding along row $2$, the first term carries $(-1)^{2+1} = -1$. A learner who alternates $+, -, +$ starting from the first term they wrote has the whole expansion negated, and nothing downstream will complain.

A minor is a determinant, not a matrix. $M_{ij}$ is a number. Writing the small matrix down is a step on the way; leaving it as a matrix and trying to add it to something is not.

A zero entry has a perfectly good cofactor. It just does not matter, because it is multiplied by zero. Computing the cofactors of the zeros is the commonest way to waste an hour on a $4 \times 4$.

Deleting the wrong line. $M_{23}$ deletes row $2$ and column $3$ — the row and column of the entry, not row $3$ and column $2$. The subscripts are read in the same order as everywhere else in the subject: row first.

A determinant is defined for square matrices only. There is no determinant of a $2 \times 3$ matrix, and no amount of rearranging produces one.

8. A three by three, expanded along the emptiest line

  1. $A = \begin{pmatrix} 2 & 0 & 5 \\ 1 & 0 & 3 \\ 4 & 7 & 6 \end{pmatrix}$. Column $2$ holds two zeros, so expand down it.

    Count zeros before computing anything.

  2. Only the entry $7$ at position $(3,2)$ survives. Its sign is $(-1)^{3+2} = -1$ and its minor deletes row $3$ and column $2$, leaving $\begin{pmatrix} 2 & 5 \\ 1 & 3 \end{pmatrix}$ with determinant $6 - 5 = 1$.

    One term, one small determinant.

  3. So $\det A = -7 \times 1 = -7$. Expanding along row $1$ instead gives $2(0 \cdot 6 - 3 \cdot 7) - 0 + 5(1 \cdot 7 - 0 \cdot 4) = -42 + 35 = -7$, as it must.

    Both routes, one number.

9. A four by four that is nearly triangular

  1. $B = \begin{pmatrix} 3 & 1 & 4 & 1 \\ 0 & 2 & 7 & 5 \\ 0 & 0 & 6 & 2 \\ 0 & 0 & 0 & 9 \end{pmatrix}$ is upper triangular, so nothing needs expanding at all.

    Recognise the shape first.

  2. Expanding down column $1$ leaves one term, $3$ times the determinant of the lower-right $3 \times 3$, which is itself triangular.

    The argument repeats.

  3. $\det B = 3 \times 2 \times 6 \times 9 = 324$. The twenty-four term expansion was never needed; six of the entries above the diagonal never appeared.

    Product of the diagonal.

10. Your turn: expand $\begin{pmatrix} 0 & 3 & 0 \\ 2 & 1 & 5 \\ 0 & 4 & 0 \end{pmatrix}$

  1. Column $1$ and column $3$ each hold two zeros. Take column $3$.

    Either will do; both are cheap.

  2. Only the entry $5$ at position $(2,3)$ survives. Its sign is $(-1)^{2+3} = -1$, and its minor deletes row $2$ and column $3$, leaving $\begin{pmatrix} 0 & 3 \\ 0 & 4 \end{pmatrix}$ with determinant $0$.

    The minor has a zero column.

  3. Your turn: work this step out. Its working is at the end of the packet.

    So the determinant is $-5 \times 0 = 0$: the matrix is singular. Column $1$ and column $3$ of the original are both zero, which is a faster way to see the same thing.

11. Guided practice

Write the minor $M_{12}$ of $\begin{pmatrix} 9 & 4 & 1 \\ 8 & 9 & 4 \\ 4 & 6 & 5 \end{pmatrix}$ — the $2 \times 2$ matrix left after deleting row $1$ and column $2$.

This task has no paper form; do it on a device.

12. Guided practice

Find $\det \begin{pmatrix} 1 & 3 & 0 \\ 5 & 2 & 0 \\ 0 & 0 & 3 \end{pmatrix}$.

Answer:

13. Practice

Each of these matrices is cheapest to expand along one particular line. Match each to the line you would choose.

Expand along row 1Expand along column 1Expand along row 3
$\begin{pmatrix} 3 & 4 & 8 \\ 6 & 4 & 3 \\ 0 & 0 & 7 \end{pmatrix}$
$\begin{pmatrix} 4 & 3 & 4 \\ 0 & 8 & 6 \\ 0 & 4 & 3 \end{pmatrix}$
$\begin{pmatrix} 0 & 6 & 0 \\ 3 & 4 & 8 \\ 6 & 4 & 3 \end{pmatrix}$

14. Practice

Write the matrix of cofactors of $\begin{pmatrix} 8 & 9 \\ 7 & 3 \end{pmatrix}$.

This task has no paper form; do it on a device.

15. Practice

Which statement about a cofactor expansion of an $4 \times 4$ matrix is true?

16. Somewhere new

For which values of $t$ is $\begin{pmatrix} t & 2 & 2 \\ 0 & 1 & 0 \\ 9 & 2 & 1 \end{pmatrix}$ singular? Give the solution set.

This task has no paper form; do it on a device.

17. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

18. Test question

Write the minor $M_{12}$ of $\begin{pmatrix} 4 & 5 & 7 \\ 8 & 6 & 7 \\ 5 & 2 & 4 \end{pmatrix}$ — the $2 \times 2$ matrix left after deleting row $1$ and column $2$.

This task has no paper form; do it on a device.

19. What you can do now

You can take minors and cofactors, expand along a well-chosen line, and write down a triangular determinant without expanding at all. Say in your own words why the sign attached to an entry depends on its position rather than on where it falls in your sum. Next: the row operations that turn any matrix into a triangular one, and what each of them costs.

Working for the steps left to you

10. Your turn: expand $\begin{pmatrix} 0 & 3 & 0 \\ 2 & 1 & 5 \\ 0 & 4 & 0 \end{pmatrix}$, step 3

A zero line always forces a zero determinant.