##### Objectives
1. Learn to recognize which methods are best suited to compute the determinant of a given matrix.
2. Recipes: the determinant of a matrix, compute the determinant using cofactor expansions.
3. Vocabulary words: minor, cofactor.

In this section, we give a recursive formula for the determinant of a matrix, called a cofactor expansion. The formula is recursive in that we will compute the determinant of an matrix assuming we already know how to compute the determinant of an matrix.

At the end is a supplementary subsection on Cramer’s rule and a cofactor formula for the inverse of a matrix.

# Subsection4.2.1Cofactor Expansions

A recursive formula must have a starting point. For cofactor expansions, the starting point is the case of matrices. The definition of determinant directly implies that

To describe cofactor expansions, we need to introduce some notation.

##### Definition

Let be an matrix.

1. The minor, denoted is the matrix obtained from by deleting the th row and the th column.
2. The cofactor is defined in terms of the minor by

Note that the signs of the cofactors follow a “checkerboard pattern.” Namely, is pictured in this matrix:

The cofactors of an matrix are determinants of submatrices. Hence the following theorem is in fact a recursive procedure for computing the determinant.

##### Proof

Note that the theorem actually gives different formulas for the determinant: one for each row and one for each column. For instance, the formula for cofactor expansion along the first column is

Remember, the determinant of a matrix is just a number, defined by the four defining properties in Section 4.1, so to be clear:

You obtain the same number by expanding cofactors along row or column.

Now that we have a recursive formula for the determinant, we can finally prove the existence theorem in Section 4.1.

##### The determinant of a 2 × 2 matrix

Let us compute (again) the determinant of a general matrix

The minors are

The minors are all matrices. As we have seen that the determinant of a matrix is just the number inside of it, the cofactors are therefore

Expanding cofactors along the first column, we find that

which agrees with the formulas in this definition in Section 3.5 and this example in Section 4.1.

##### The determinant of a 3 × 3 matrix

We can also use cofactor expansions to find a formula for the determinant of a matrix. Let is compute the determinant of

by expanding along the first row. The minors and cofactors are:

The determinant is:

The formula for the determinant of a matrix looks too complicated to memorize outright. Fortunately, there is the following mnemonic device.

##### Recipe: Computing the Determinant of a 3 × 3 Matrix

To compute the determinant of a matrix, first draw a larger matrix with the first two columns repeated on the right. Then add the products of the downward diagonals together, and subtract the products of the upward diagonals:

Alternatively, it is not necessary to repeat the first two columns if you allow your diagonals to “wrap around” the sides of a matrix, like in Pac-Man or Asteroids.

Cofactor expansions are most useful when computing the determinant of a matrix that has a row or column with several zero entries. Indeed, if the entry of is zero, then there is no reason to compute the cofactor. In the following example we compute the determinant of a matrix with two zeros in the fourth column by expanding cofactors along the fourth column.

Cofactor expansions are also very useful when computing the determinant of a matrix with unknown entries. Indeed, it is inconvenient to row reduce in this case, because one cannot be sure whether an entry containing an unknown is a pivot or not.

It is often most efficient to use a combination of several techniques when computing the determinant of a matrix. Indeed, when expanding cofactors on a matrix, one can compute the determinants of the cofactors in whatever way is most convenient. Or, one can perform row and column operations to clear some entries of a matrix before expanding cofactors, as in the previous example.

##### Summary: methods for computing determinants

We have several ways of computing determinants:

1. Special formulas for and matrices.

This is usually the best way to compute the determinant of a small matrix, except for a matrix with several zero entries.

2. Cofactor expansion.

This is usually most efficient when there is a row or column with several zero entries, or if the matrix has unknown entries.

3. Row and column operations.

This is generally the fastest when presented with a large matrix which does not have a row or column with a lot of zeros in it.

4. Any combination of the above.

Cofactor expansion is recursive, but one can compute the determinants of the minors using whatever method is most convenient. Or, you can perform row and column operations to clear some entries of a matrix before expanding cofactors.

Remember, all methods for computing the determinant yield the same number.

# Subsection4.2.2Cramer’s Rule and Matrix Inverses¶ permalink

Recall from this proposition in Section 3.5 that one can compute the determinant of a matrix using the rule

We computed the cofactors of a matrix in this example; using we can rewrite the above formula as

It turns out that this formula generalizes to matrices.

The matrix of cofactors is sometimes called the adjugate matrix of and is denoted

Note that the cofactor goes in the entry the adjugate matrix, not the entry: the adjugate matrix is the transpose of the cofactor matrix.

It is clear from the previous example that (4.2.1) is a very inefficient way of computing the inverse of a matrix, compared to augmenting by the identity matrix and row reducing, as in this subsection in Section 3.5. However, it has its uses.

• If a matrix has unknown entries, then it is difficult to compute its inverse using row reduction, for the same reason it is difficult to compute the determinant that way: one cannot be sure whether an entry containing an unknown is a pivot or not.
• This formula is useful for theoretical purposes. Notice that the only denominators in (4.2.1) occur when dividing by the determinant: computing cofactors only involves multiplication and addition, never division. This means, for instance, that if the determinant is very small, then any measurement error in the entries of the matrix is greatly magnified when computing the inverse. In this way, (4.2.1) is useful in error analysis.

The proof of the theorem uses an interesting trick called Cramer’s Rule, which gives a formula for the entries of the solution of an invertible matrix equation.

##### Proof

Now we use Cramer’s rule to prove the first theorem of this subsection.