Cofactor Matrix — Formula, Signs, Examples

Cofactor Matrix — Formula, Signs, Examples

TL;DR

The cofactor matrix of a square matrix is built by replacing each entry with its cofactor — the determinant of the smaller matrix left after deleting that entry's row and column, signed by $(-1)^{i+j}$. This article covers minors versus cofactors, the checkerboard sign pattern, the formula, how the cofactor matrix builds the adjugate, determinant, and inverse, and six worked examples.

What Is a Cofactor Matrix?

The cofactor matrix of a square matrix $A$ is the matrix formed by replacing every entry $a_{ij}$ with its cofactor $C_{ij}$. To get there, two definitions stack:

$$C_{ij} = (-1)^{i+j}M_{ij}.$$

So a minor measures the size of the leftover determinant, and the cofactor adds the sign that the entry's position demands. The distinction matters: a minor is always just a determinant, while a cofactor can be a minor or its negative, depending on where the entry sits.

What Is the Cofactor Sign Pattern?

The factor $(-1)^{i+j}$ produces a checkerboard of signs. When $i + j$ is even the sign is $+$; when odd, the sign is $-$. Laid out, it never changes:

$$\begin{bmatrix} + & - & + \ - & + & - \ + & - & + \end{bmatrix}.$$

The top-left is always $+$, and the signs alternate from there in both directions. You do not need to recompute $(-1)^{i+j}$ each time — once the pattern is memorised, you read the sign straight off the position. This same pattern shows up in the determinant of a matrix, because cofactor expansion is how a determinant is computed.

What Is the Cofactor Matrix Formula?

For each entry, the cofactor is

$$C_{ij} = (-1)^{i+j}M_{ij},$$

and the cofactor matrix collects them all:

$$\text{cof}(A) = \begin{bmatrix} C_{11} & C_{12} & C_{13} \ C_{21} & C_{22} & C_{23} \ C_{31} & C_{32} & C_{33} \end{bmatrix}.$$

For a 2x2 matrix $A = \begin{bmatrix} a & b \ c & d \end{bmatrix}$, the minors are single entries, so the cofactor matrix is simply

$$\text{cof}(A) = \begin{bmatrix} d & -b \ -c & a \end{bmatrix}.$$

The procedure for any size is fixed: for each position, delete its row and column, take the determinant of the rest, then apply the checkerboard sign.

How Does the Cofactor Matrix Build the Adjugate, Determinant, and Inverse?

The cofactor matrix is rarely the final goal — it is the step that powers three bigger results:

So the cofactor matrix sits one transpose away from the adjugate, and one division away from the inverse. Get the cofactors right and everything downstream follows.

Examples of Cofactor Matrix

The set runs from a single minor, through the most common sign mistake, to a full 2x2 and 3x3 cofactor matrix, a cofactor expansion of the determinant, and building the adjugate.

Example 1

Find the minor $M_{11}$ of $A = \begin{bmatrix} 4 & 3 & 2 \ 1 & 5 & 6 \ 7 & 8 & 9 \end{bmatrix}$.

Delete row 1 and column 1, leaving $\begin{bmatrix} 5 & 6 \ 8 & 9 \end{bmatrix}$, and take its determinant:

$$M_{11} = (5)(9) - (6)(8) = 45 - 48 = -3.$$

Final answer: $M_{11} = -3$. Since position $(1,1)$ has sign $+$, here the cofactor equals the minor: $C_{11} = -3$.

Example 2

Find the cofactor $C_{21}$ of $A = \begin{bmatrix} 4 & 3 & 2 \ 1 & 5 & 6 \ 7 & 8 & 9 \end{bmatrix}$.

Wrong attempt. A student deletes row 2 and column 1, gets the minor $M_{21} = \det\begin{bmatrix} 3 & 2 \ 8 & 9 \end{bmatrix} = 27 - 16 = 11$, and writes $C_{21} = 11$. The minor is computed correctly — but the position's sign was never applied.

Check the position. Entry $(2,1)$ has $i + j = 3$, which is odd, so $(-1)^{2+1} = -1$. The cofactor cannot match the minor here.

Correct. Apply the sign:

$$C_{21} = (-1)^{2+1} M_{21} = -11.$$

Final answer: $C_{21} = -11$. The minor and the cofactor agree only when the position's sign is $+$.

Example 3

Find the cofactor matrix of $A = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix}$.

For a 2x2, each minor is the single remaining entry. Applying the signs:

$$\text{cof}(A) = \begin{bmatrix} 4 & -3 \ -2 & 1 \end{bmatrix}.$$

Final answer: $\begin{bmatrix} 4 & -3 \ -2 & 1 \end{bmatrix}$. Notice this is the "swap-and-negate" pattern from the 2x2 inverse — the same cofactors, before transposing and dividing.

Example 4

Find the cofactor matrix of $A = \begin{bmatrix} 1 & 0 & 2 \ 3 & 1 & 0 \ 0 & 2 & 1 \end{bmatrix}$.

Compute all nine signed minors. For example, $C_{11} = +\det\begin{bmatrix} 1 & 0 \ 2 & 1 \end{bmatrix} = 1$ and $C_{12} = -\det\begin{bmatrix} 3 & 0 \ 0 & 1 \end{bmatrix} = -3$. Continuing through every entry:

$$\text{cof}(A) = \begin{bmatrix} 1 & -3 & 6 \ 4 & 1 & -2 \ -2 & 6 & 1 \end{bmatrix}.$$

Final answer: the matrix above. Each entry was a signed 2x2 determinant — the checkerboard handles the alternation automatically.

Example 5

Use cofactor expansion along the first row to find $\det A$ for the matrix in Example 4.

The determinant is each first-row entry times its cofactor: $\det A = a_{11}C_{11} + a_{12}C_{12} + a_{13}C_{13}$. Using the cofactors $C_{11} = 1$, $C_{12} = -3$, $C_{13} = 6$ from Example 4:

$$\det A = (1)(1) + (0)(-3) + (2)(6) = 1 + 0 + 12 = 13.$$

Final answer: $\det A = 13$. The zero in position $(1,2)$ wiped out a whole cofactor term — choosing a row with zeros saves work.

Example 6

Build the adjugate of the matrix in Example 4 from its cofactor matrix.

The adjugate is the transpose of the cofactor matrix. Transposing $\text{cof}(A)$ from Example 4:

$$\text{adj}(A) = \text{cof}(A)^T = \begin{bmatrix} 1 & 4 & -2 \ -3 & 1 & 6 \ 6 & -2 & 1 \end{bmatrix}.$$

Final answer: the matrix above. Dividing this by $\det A = 13$ would give $A^{-1}$ — the cofactor matrix is two short steps from the inverse.

Why the Cofactor Matrix Earns Its Place

Cofactors come from the theory of determinants, shaped through the 1800s by figures including James Joseph Sylvester (1814–1897, England), who coined the word "matrix" in 1850 and worked on the minors that underlie cofactor expansion. The idea solved a real problem: a large determinant is impossible to compute directly, but cofactor expansion reduces it to a chain of small, manageable determinants.

Where the cofactor matrix does real work:

Where Students Trip Up on the Cofactor Matrix

Mistake 1: Confusing the minor with the cofactor

Where it slips in: Filling the cofactor matrix straight from the minors.

Don't do this: Copy each minor in as-is, ignoring the $(-1)^{i+j}$ sign.

The correct way: A cofactor is a signed minor. Apply the checkerboard sign to every position before placing the value.

Mistake 2: Deleting the wrong row or column

Where it slips in: Computing the minor $M_{ij}$.

Don't do this: Delete row $j$ and column $i$ (swapping the indices), or delete by value instead of by position.

The correct way: For $M_{ij}$, delete row $i$ and column $j$ — row first, then column, matching the subscript order. The rusher who works fast often transposes the indices and computes the wrong submatrix entirely.

Mistake 3: Forgetting to transpose when building the adjugate

Where it slips in: Going from the cofactor matrix to the adjugate (and then the inverse).

Don't do this: Use the cofactor matrix directly as the adjugate.

The correct way: The adjugate is the transpose of the cofactor matrix. Skip the transpose and the inverse comes out wrong everywhere except on the diagonal. The second-guesser who knows the rule still sometimes "un-transposes" on a recheck — trusting the one transpose keeps it right.

Key Takeaways