Skip to main content

Section 9.4 Cofactor expansions for computing determinants

We now describe a way to compute determinants, using what are called cofactor expansions, that will be important for us in the next chapter.
To begin, the determinant of a \(2\times2\) matrix is
\begin{equation*} \det\left[\begin{array}{rr} a \amp b \\ c \amp d \\ \end{array}\right] = ad-bc\text{.} \end{equation*}
With a little bit of work, it can be shown that this number is the same as the signed area of the parallelogram we introduced earlier.
Using a cofactor expansion to find the determinant of a more general \(n\times n\) matrix is a little more work so we will demonstrate it with an example.

Example 9.4.1.

We illustrate how to use a cofactor expansion to find the determinant of \(A\) where
\begin{equation*} A = \left[\begin{array}{rrr} 1 \amp -1 \amp 2 \\ -2 \amp 2 \amp -6 \\ 3 \amp -1 \amp 10 \\ \end{array}\right]. \end{equation*}
To begin, we choose one row or column. It doesn’t matter which we choose because the result will be the same in any case. Here, we choose the second row
\begin{equation*} \left[\begin{array}{rrr} \lgray{1} \amp \lgray{-1} \amp \lgray{2} \\ -2 \amp 2 \amp -6 \\ \lgray{3} \amp \lgray{-1} \amp \lgray{10} \\ \end{array}\right]\text{.} \end{equation*}
The determinant will be found by creating a sum of terms, one for each entry in the row we have chosen. For each entry in the row, we form its term by multiplying
  • \((-1)^{i+j}\) where \(i\) and \(j\) are the row and column numbers, respectively, of the entry,
  • the entry itself, and
  • the determinant of the entries left over when we have crossed out the row and column containing the entry.
Since we are computing the determinant of this matrix
\begin{equation*} \left[\begin{array}{rrr} \gray{1} \amp \gray{-1} \amp \gray{2} \\ -2 \amp 2 \amp -6 \\ \gray{3} \amp \gray{-1} \amp \gray{10} \\ \end{array}\right] \end{equation*}
using the second row, the entry in the first column of this row is \(-2\text{.}\) Let’s see how to form the term from this entry.
The term itself is \(-2\text{,}\) and the matrix that is left over when we cross out the second row and first column is
\begin{equation*} \left[\begin{array}{rrr} \gray{1} \amp {-1} \amp {2} \\ \gray{-2} \amp \gray{2} \amp \gray{-6} \\ \gray{3} \amp {-1} \amp {10} \\ \end{array}\right] \end{equation*}
whose determinant is
\begin{equation*} \det\left[\begin{array}{rr} -1 \amp 2 \\ -1 \amp 10 \\ \end{array}\right] = -1(10) - 2 (-1) = -8\text{.} \end{equation*}
Since this entry is in the second row and first column, the term we construct is \((-1)^{2+1}(-2)(-8) = -16 \text{.}\)
Putting this together, we find the determinant to be
\begin{equation*} \begin{aligned} \left[\begin{array}{rrr} {1} \amp {-1} \amp {2} \\ -2 \amp {2} \amp {-6} \\ {3} \amp {-1} \amp {10} \\ \end{array}\right] {}={} \amp (-1)^{2+1}(-2)\det\left[\begin{array}{rr} -1 \amp 2 \\ -1 \amp 10 \\ \end{array}\right] \\ \amp {}+{} (-1)^{2+2}(2)\det\left[\begin{array}{rr} 1 \amp 2 \\ 3 \amp 10 \\ \end{array}\right] \\ \amp {}+{} (-1)^{2+3}(-6)\det\left[\begin{array}{rr} -1 \amp -1 \\ 3 \amp -1 \\ \end{array}\right] \\ \\ {}={} \amp (-1)(-2)(-1(10)-2(-1)) \\ \amp + (1)(2)(1(10)-2(3)) \\ \amp + (-1)(-6)((-1)(-1)-(-1)3) \\ \\ {}={} \amp -16 + 8 + 12 \\ {}={} \amp 4 \\ \end{aligned}\text{.} \end{equation*}
Notice that this agrees with the determinant that we found for this matrix using row operations in the last activity.

Activity 9.4.1.

We will explore cofactor expansions through some examples.
  1. Using a cofactor expansion, show that the determinant of the following matrix
    \begin{equation*} \det \left[\begin{array}{rrr} 2 \amp 0 \amp -1 \\ 3 \amp 1 \amp 2 \\ -2 \amp 4 \amp -3 \\ \end{array}\right] = -36\text{.} \end{equation*}
    Remember that you can choose any row or column to create the expansion, but the choice of a particular row or column may simplify the computation.
  2. Use a cofactor expansion to find the determinant of
    \begin{equation*} \left[\begin{array}{rrrr} -3 \amp 0 \amp 0 \amp 0 \\ 4 \amp 1 \amp 0 \amp 0 \\ -1 \amp 4 \amp -4 \amp 0\\ 0 \amp 3 \amp 2 \amp 3 \\ \end{array}\right]\text{.} \end{equation*}
    Explain how the cofactor expansion technique shows that the determinant of a triangular matrix is equal to the product of its diagonal entries.
  3. Use a cofactor expansion to determine whether the following vectors form a basis of \(\real^3\text{:}\)
    \begin{equation*} \threevec{2}{-1}{-2}, \threevec{1}{-1}{2}, \threevec{1}{0}{-4}\text{.} \end{equation*}
  4. Sage will compute the determinant of a matrix A with the command A.det(). Use Sage to find the determinant of the matrix
    \begin{equation*} \left[\begin{array}{rrrr} 2 \amp 1 \amp -2 \amp -3 \\ 3 \amp 0 \amp -1 \amp -2 \\ -3 \amp 4 \amp 1 \amp 2\\ 1 \amp 3 \amp 3 \amp -1 \\ \end{array}\right]\text{.} \end{equation*}
Solution.
  1. We will using a cofactor expanion along the first row so that
    \begin{equation*} \begin{array}{rl} \det\left[\begin{array}{rrr} 2 \amp 0 \amp -1 \\ 3 \amp 1 \amp 2 \\ -2 \amp 4 \amp -3 \\ \end{array}\right] = \amp (-1)^{1+1}\cdot 2 \det\left[\begin{array}{rr} 1 \amp 2 \\ 4 \amp -3 \\ \end{array}\right] \\ \amp + (-1)^{1+3}\cdot (-1) \det\left[\begin{array}{rr} 3 \amp 1 \\ -2 \amp 4 \\ \end{array}\right] \\ = \amp 2(-11) - 14 = -36\text{.} \end{array} \end{equation*}
  2. Expanding along the first row gives
    \begin{equation*} \begin{array}{rl} \det \left[\begin{array}{rrrr} -3 \amp 0 \amp 0 \amp 0 \\ 4 \amp 1 \amp 0 \amp 0 \\ -1 \amp 4 \amp -4 \amp 0\\ 0 \amp 3 \amp 2 \amp 3 \\ \end{array}\right] \amp = 3\det \left[\begin{array}{rrr} 1 \amp 0 \amp 0 \\ 4 \amp -4 \amp 0\\ 3 \amp 2 \amp 3 \\ \end{array}\right] \\ \amp =-3(1)\det \left[\begin{array}{rr} -4 \amp 0 \\ 2 \amp 3 \\ \end{array}\right] \\ \amp =-3(1)(-4)(3) = 36\text{.} \end{array} \end{equation*}
  3. We form the matrix \(A\) whose columns are the three given vectors. Expanding along either the second row or third column to take advantage of the zero in the \((2,3)\) entry, we see that \(\det(A) = 0\text{,}\) which means that \(A\) is not invertible. Therefore, the vectors do not form a basis for \(\real^3\text{.}\)
  4. Sage tells us that \(\det(A) = 72\text{.}\)