Linear Algebra › Section C · Determinants › Topic C.1

Determinants and cofactor expansion

Every square matrix carries a single number, its determinant, that says at a glance whether the matrix can be inverted. This topic defines that number and shows how to compute it by expanding along any row or column.

One number for a square matrix

In the topic "The inverse of a matrix" you met the quantity \(ad - bc\): a 2 x 2 matrix is invertible exactly when it is not zero. The determinant extends that test to every square matrix. It is a single number, written \(\det A\) or \(|A|\), computed from the entries of an n x n matrix \(A\). It is defined only for square matrices. The headline fact, proved in the next topic, is that \(A\) is invertible exactly when \(\det A \ne 0\). Later topics show that the determinant also measures how a matrix stretches area and volume.

The 2 x 2 determinant

For a 2 x 2 matrix the definition is short:

\det\begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc

Multiply down the main diagonal, then subtract the product of the other diagonal. For example, the matrix with rows (5, 2) and (3, 4) has determinant \(5 \cdot 4 - 2 \cdot 3 = 14\), so it is invertible. The matrix with rows (2, 6) and (1, 3) has determinant \(6 - 6 = 0\): its second column is three times its first, and it has no inverse. Larger determinants are built from 2 x 2 ones.

Minors and cofactors

Take an n x n matrix \(A\) and delete row \(i\) and column \(j\). What remains is an \((n-1) \times (n-1)\) matrix, written \(A_{ij}\), and its determinant is the minor of entry \(a_{ij}\). The cofactor attaches a sign to the minor:

C_{ij} = (-1)^{i+j} \det A_{ij}

The sign depends only on the position. It is + when \(i + j\) is even and - when it is odd, giving a checkerboard that starts with + in the top-left corner: + - + along row 1, - + - along row 2, and so on. Position (2, 3), for instance, carries a minus sign because 2 + 3 is odd.

Cofactor expansion

The determinant of an n x n matrix is defined by expanding along the first row: multiply each entry of row 1 by its cofactor and add.

\det A = a_{11}C_{11} + a_{12}C_{12} + \cdots + a_{1n}C_{1n}

A key theorem, named after Pierre-Simon Laplace, who described the method in the 1770s, says you get the same number by expanding along any row or any column. Each cofactor is a smaller determinant, so the process repeats until only 2 x 2 determinants remain. The freedom to choose the row or column is what makes hand computation practical.

Worked example: a 3 x 3 determinant

Find the determinant of

A = \begin{bmatrix} 2 & -1 & 3 \\ 1 & 4 & 0 \\ -2 & 5 & 1 \end{bmatrix}

1. Expand along row 1. The cofactors are \(C_{11} = +(4 \cdot 1 - 0 \cdot 5) = 4\), \(C_{12} = -(1 \cdot 1 - 0 \cdot (-2)) = -1\) and \(C_{13} = +(1 \cdot 5 - 4 \cdot (-2)) = 13\). 2. Combine:

2(4) + (-1)(-1) + 3(13) = 8 + 1 + 39 = 48

3. Check by expanding down column 3, which contains a zero. Its cofactors are \(C_{13} = 13\) and \(C_{33} = +(2 \cdot 4 - (-1) \cdot 1) = 9\), so \(\det A = 3(13) + 0 + 1(9) = 48\). Both routes agree, and since 48 is not zero, \(A\) is invertible.

Worked example: let the zeros work

Find the determinant of

B = \begin{bmatrix} 2 & 0 & 0 & 1 \\ 5 & 3 & 0 & -2 \\ 1 & 7 & 4 & 0 \\ 0 & 0 & 0 & 6 \end{bmatrix}

1. Row 4 has only one non-zero entry, 6, in position (4, 4), whose sign is + because 4 + 4 is even. 2. Expanding along row 4 leaves \(\det B = 6 \det B_{44}\), where \(B_{44}\) has rows (2, 0, 0), (5, 3, 0) and (1, 7, 4). 3. Expand that along its first row, which also has two zeros: \(2(3 \cdot 4 - 0 \cdot 7) = 24\). 4. So \(\det B = 6 \times 24 = 144\). A 4 x 4 determinant took two small steps instead of four 3 x 3 cofactors.

Triangular matrices

A matrix is triangular if every entry below the main diagonal is zero (upper triangular) or every entry above it is zero (lower triangular). For such a matrix the determinant is simply the product of the diagonal entries. To see why for a lower triangular matrix, expand along the first row: only the diagonal entry survives, leaving a smaller triangular matrix, and the pattern repeats. (For an upper triangular matrix, expand down the first column instead.) The 3 x 3 matrix inside the last example was lower triangular, and indeed \(2 \cdot 3 \cdot 4 = 24\). Two consequences: \(\det I = 1\), and a triangular matrix with a zero on its diagonal has determinant 0.

Sarrus's rule and the cost of expansion

For 3 x 3 matrices only, there is a shortcut called Sarrus's rule: copy the first two columns to the right, add the three products running down to the right, and subtract the three running up to the right. It does not extend to 4 x 4 matrices. Cofactor expansion works for every size but becomes very slow. An n x n determinant expanded fully has n! terms: 3,628,800 for n = 10, and about \(1.6 \times 10^{25}\) for n = 25, years of work even for the fastest supercomputers. The next topic shows how row reduction computes determinants with roughly \(n^3\) operations instead.

A short history

Determinants are older than matrices. Seki Takakazu in Japan, in about 1683, and Gottfried Leibniz in Europe, in about 1693, independently used such expressions to decide when systems of equations could be solved. Augustin-Louis Cauchy gave the word "determinant" its modern meaning in the early 1800s, and only in the 1850s did Arthur Cayley's algebra of matrices give the determinant the home it has today.

Common mistakes to avoid

The most frequent slip is a wrong cofactor sign: the sign comes from the position \((-1)^{i+j}\), never from the entry itself, so a negative entry in a + position keeps its own sign and gains no extra one. The second is deleting the wrong row or column when forming a minor; cross out row \(i\) and column \(j\) of the entry you are using. The third is applying Sarrus's diagonal pattern to a 4 x 4 matrix, where it gives wrong answers. Finally, a determinant exists only for square matrices; a 2 x 3 matrix has none.

Key takeaways

The determinant is one number attached to a square matrix; for 2 x 2 it is \(ad - bc\). A minor is the determinant left after deleting a row and a column, and the cofactor \(C_{ij} = (-1)^{i+j}\det A_{ij}\) adds a checkerboard sign. Cofactor expansion along any row or column gives the same value, so expand along the line with the most zeros. A triangular matrix has determinant equal to the product of its diagonal. Sarrus's rule works only for 3 x 3, and full expansion needs n! terms, which is why larger determinants are found by row reduction.

Flashcards

Flashcard

det [[a, b], [c, d]]

ad − bc

Main diagonal product minus the other diagonal product.

Test your understanding

Question 1 of 5

What is the determinant of the matrix with rows (4, -3) and (2, 5)?

Question 2 of 5

For a 4 x 4 matrix A, how is the cofactor C₂₃ related to the minor det A₂₃?

Question 3 of 5

An upper triangular 3 x 3 matrix has diagonal entries 2, -1 and 5, and the entries above the diagonal are 7, 4 and 9. What is its determinant?

Question 4 of 5

A 4 x 4 matrix has a third column whose entries are 0, 0, 8 and 0. What is the most efficient first step?

Question 5 of 5

Which statement about computing determinants is true?

← Previous topicNext topic →