Skip to main content
Mathematics LibreTexts

3.1: The Cofactor Expansion

  • Page ID
    58841
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    In Section [sec:2_4] we defined the determinant of a \(2 \times 2\) matrix \(A = \left[ \begin{array}{cc} a & b \\ c & d \end{array} \right]\) as follows:1

    \[\det A = \left| \begin{array}{cc} a & b \\ c & d \end{array} \right| = ad - bc \nonumber \]

    and showed (in Example [exa:004261]) that \(A\) has an inverse if and only if det \(A \neq 0\). One objective of this chapter is to do this for any square matrix A. There is no difficulty for \(1 \times 1\) matrices: If \(A = \left[ a \right]\), we define \(\det A = \det \left[ a \right] = a\) and note that \(A\) is invertible if and only if \(a \neq 0\).

    If \(A\) is \(3 \times 3\) and invertible, we look for a suitable definition of \(\det A\) by trying to carry \(A\) to the identity matrix by row operations. The first column is not zero (\(A\) is invertible); suppose the (1, 1)-entry \(a\) is not zero. Then row operations give

    \[A = \left[ \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} \right] \rightarrow \left[ \begin{array}{ccc} a & b & c \\ ad & ae & af \\ ag & ah & ai \end{array} \right] \rightarrow \left[ \begin{array}{ccc} a & b & c \\ 0 & ae-bd & af-cd \\ 0 & ah-bg & ai-cg \end{array} \right] = \left[ \begin{array}{ccc} a & b & c \\ 0 & u & af-cd \\ 0 & v & ai-cg \end{array} \right] \nonumber \]

    where \(u = ae - bd\) and \(v = ah - bg\). Since \(A\) is invertible, one of \(u\) and \(v\) is nonzero (by Example [exa:004627]); suppose that \(u \neq 0\). Then the reduction proceeds

    \[A \rightarrow \left[ \begin{array}{ccc} a & b & c \\ 0 & u & af-cd \\ 0 & v & ai-cg \end{array} \right] \rightarrow \left[ \begin{array}{ccc} a & b & c \\ 0 & u & af-cd \\ 0 & uv & u(ai-cg) \end{array} \right] \rightarrow \left[ \begin{array}{ccc} a & b & c \\ 0 & u & af-cd \\ 0 & 0 & w \end{array} \right] \nonumber \]

    where \(w = u(ai - cg)- v(af - cd) = a(aei + bfg + cdh - ceg - afh - bdi)\). We define

    \[\label{eq:detdefinition} \det A = aei + bfg + cdh - ceg - afh - bdi \]

    and observe that \(\det A \neq 0\) because \(a \det A = w \neq 0\) (is invertible).

    To motivate the definition below, collect the terms in Equation [eq:detdefinition] involving the entries \(a\), \(b\), and \(c\) in row 1 of \(A\):

    \[\begin{aligned} \det A = \left| \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} \right| &= aei + bfg + cdh - ceg - afh - bdi \\ &= a (ei-fh) - b(di-fg) + c(dh-eg) \\ &= a \left| \begin{array}{cc} e & f \\ h & i \end{array} \right| - b \left| \begin{array}{cc} d & f \\ g & i \end{array} \right| + c \left| \begin{array}{cc} d & e \\ g & h \end{array} \right|\end{aligned} \nonumber \]

    This last expression can be described as follows: To compute the determinant of a \(3 \times 3\) matrix \(A\), multiply each entry in row 1 by a sign times the determinant of the \(2 \times 2\) matrix obtained by deleting the row and column of that entry, and add the results. The signs alternate down row 1, starting with \(+\). It is this observation that we generalize below.

    007706

    \[\begin{aligned} \det \left[ \begin{array}{rrr} 2 & 3 & 7 \\ -4 & 0 & 6 \\ 1 & 5 & 0 \end{array} \right] &= 2 \left| \begin{array}{rr} 0 & 6 \\ 5 & 0 \end{array} \right| - 3 \left| \begin{array}{rr} -4 & 6 \\ 1 & 0 \end{array} \right| + 7 \left| \begin{array}{rr} -4 & 0 \\ 1 & 5 \end{array} \right| \\ &= 2 (-30) - 3(-6) + 7(-20) \\ &= -182\end{aligned} \nonumber \]

    This suggests an inductive method of defining the determinant of any square matrix in terms of determinants of matrices one size smaller. The idea is to define determinants of \(3 \times 3\) matrices in terms of determinants of \(2 \times 2\) matrices, then we do \(4 \times 4\) matrices in terms of \(3 \times 3\) matrices, and so on.

    To describe this, we need some terminology.

    Cofactors of a Matrix007711 Assume that determinants of \((n - 1) \times (n - 1)\) matrices have been defined. Given the \(n \times n\) matrix \(A\), let

    \[A_{ij} \mbox{ denote the } (n - 1) \times (n - 1) \mbox{ matrix obtained from } A \mbox{ by deleting row } i \mbox{ and column } j. \nonumber \]

    Then the \((i,j)\)-cofactor \(c_{ij}(A)\) is the scalar defined by

    \[c_{ij}(A) = (-1)^{i+j} \det (A_{ij}) \nonumber \]

    Here \((-1)^{i+j}\) is called the sign of the \((i, j)\)-position.

    The sign of a position is clearly \(1\) or \(-1\), and the following diagram is useful for remembering it:

    \[\left[ \begin{array}{ccccc} + & - & + & - & \cdots \\ - & + & - & + & \cdots \\ + & - & + & - & \cdots \\ - & + & - & + & \cdots \\ \vdots & \vdots & \vdots & \vdots & \\ \end{array}\right] \nonumber \]

    Note that the signs alternate along each row and column with \(+\) in the upper left corner.

    007723 Find the cofactors of positions \((1, 2), (3, 1)\), and \((2, 3)\) in the following matrix.

    \[A = \left[ \begin{array}{rrr} 3 & -1 & 6 \\ 5 & 2 & 7 \\ 8 & 9 & 4 \end{array} \right] \nonumber \]

    Here \(A_{12}\) is the matrix \(\left[ \begin{array}{rr} 5 & 7 \\ 8 & 4 \end{array} \right]\) that remains when row \(1\) and column \(2\) are deleted. The sign of position \((1, 2)\) is \((-1)^{1+2} = -1\) (this is also the \((1, 2)\)-entry in the sign diagram), so the \((1, 2)\)-cofactor is

    \[c_{12}(A) = (-1)^{1+2} \left| \begin{array}{rr} 5 & 7 \\ 8 & 4 \end{array} \right| = (-1)(5 \cdot 4 - 7 \cdot 8) = (-1)(-36)=36 \nonumber \]

    Turning to position \((3, 1)\), we find

    \[c_{31}(A) = (-1)^{3+1}A_{31}= (-1)^{3+1} \left| \begin{array}{rr} -1 & 6 \\ 2 & 7 \end{array} \right| =(+1)(-7-12)=-19 \nonumber \]

    Finally, the \((2, 3)\)-cofactor is

    \[c_{23}(A) = (-1)^{2+3}A_{23}= (-1)^{2+3} \left| \begin{array}{rr} 3 & -1 \\ 8 & 9 \end{array} \right| = (-1)(27+8)=-35 \nonumber \]

    Clearly other cofactors can be found—there are nine in all, one for each position in the matrix.

    We can now define \(\det A\) for any square matrix \(A\)

    Cofactor expansion of a Matrix007740 Assume that determinants of \((n - 1) \times (n - 1)\) matrices have been defined. If \(A = \left[ a_{ij} \right]\) is \(n \times n\) define

    \[\det A = a_{11}c_{11}(A) + a_{12}c_{12}(A) + \cdots + a_{1n}c_{1n}(A) \nonumber \]

    This is called the cofactor expansion of \(\det A\) along row \(1\).

    It asserts that \(\det A\) can be computed by multiplying the entries of row \(1\) by the corresponding cofactors, and adding the results. The astonishing thing is that \(\det A\) can be computed by taking the cofactor expansion along any row or column: Simply multiply each entry of that row or column by the corresponding cofactor and add.

    Cofactor Expansion Theorem007747 The determinant of an \(n \times n\) matrix \(A\) can be computed by using the cofactor expansion along any row or column of \(A\). That is \(\det A\) can be computed by multiplying each entry of the row or column by the corresponding cofactor and adding the results.

    The proof will be given in Section [sec:3_6].

    007753 Compute the determinant of \(A = \left[ \begin{array}{rrr} 3 & 4 & 5 \\ 1 & 7 & 2 \\ 9 & 8 & -6 \end{array} \right]\).

    The cofactor expansion along the first row is as follows:

    \[\begin{aligned} \det A &= 3c_{11}(A) + 4c_{12}(A) + 5c_{13}(A) \\ &= 3 \left| \begin{array}{rr} 7 & 2 \\ 8 & -6 \end{array} \right| - 4 \left| \begin{array}{rr} 1 & 2 \\ 9 & -6 \end{array} \right| + 5 \left| \begin{array}{rr} 1 & 7 \\ 9 & 8 \end{array} \right| \\ &= 3 (-58) - 4(-24) + 5(-55) \\ &= -353\end{aligned} \nonumber \]

    Note that the signs alternate along the row (indeed along any row or column). Now we compute \(\det A\) by expanding along the first column.

    \[\begin{aligned} \det A &= 3c_{11}(A) + 1c_{21}(A) + 9c_{31}(A) \\ &= 3 \left| \begin{array}{rr} 7 & 2 \\ 8 & -6 \end{array} \right| - \left| \begin{array}{rr} 4 & 5 \\ 8 & -6 \end{array} \right| + 9 \left| \begin{array}{rr} 4 & 5 \\ 7 & 2 \end{array} \right| \\ &= 3 (-58) - (-64) + 9(-27) \\ &= -353\end{aligned} \nonumber \]

    The reader is invited to verify that \(\det A\) can be computed by expanding along any other row or column.

    The fact that the cofactor expansion along any row or column of a matrix \(A\) always gives the same result (the determinant of \(A\)) is remarkable, to say the least. The choice of a particular row or column can simplify the calculation.

    007765 Compute \(\det A\) where \(A = \left[ \begin{array}{rrrr} 3 & 0 & 0 & 0 \\ 5 & 1 & 2 & 0 \\ 2 & 6 & 0 & -1 \\ -6 & 3 & 1 & 0 \end{array} \right]\).

    The first choice we must make is which row or column to use in the cofactor expansion. The expansion involves multiplying entries by cofactors, so the work is minimized when the row or column contains as many zero entries as possible. Row \(1\) is a best choice in this matrix (column \(4\) would do as well), and the expansion is

    \[\begin{aligned} \det A &= 3c_{11}(A) + 0c_{12}(A) + 0c_{13}(A) + 0c_{14}(A) \\ &= 3 \left| \begin{array}{rrr} 1 & 2 & 0 \\ 6 & 0 & -1 \\ 3 & 1 & 0 \end{array} \right|\end{aligned} \nonumber \]

    This is the first stage of the calculation, and we have succeeded in expressing the determinant of the \(4 \times 4\) matrix \(A\) in terms of the determinant of a \(3 \times 3\) matrix. The next stage involves this \(3 \times 3\) matrix. Again, we can use any row or column for the cofactor expansion. The third column is preferred (with two zeros), so

    \[\begin{aligned} \det A &= 3 \left( 0 \left| \begin{array}{rr} 6 & 0 \\ 3 & 1 \end{array} \right| - (-1) \left| \begin{array}{rr} 1 & 2 \\ 3 & 1 \end{array} \right| + 0 \left| \begin{array}{rr} 1 & 2 \\ 6 & 0 \end{array} \right| \right) \\ &= 3 [ 0 + 1(-5) + 0] \\ &= -15\end{aligned} \nonumber \]

    This completes the calculation.

    Computing the determinant of a matrix \(A\) can be tedious. For example, if \(A\) is a \(4 \times 4\) matrix, the cofactor expansion along any row or column involves calculating four cofactors, each of which involves the determinant of a \(3 \times 3\) matrix. And if \(A\) is \(5 \times 5\), the expansion involves five determinants of \(4 \times 4\) matrices! There is a clear need for some techniques to cut down the work.2

    The motivation for the method is the observation (see Example [exa:007765]) that calculating a determinant is simplified a great deal when a row or column consists mostly of zeros. (In fact, when a row or column consists entirely of zeros, the determinant is zero—simply expand along that row or column.)

    Recall next that one method of creating zeros in a matrix is to apply elementary row operations to it. Hence, a natural question to ask is what effect such a row operation has on the determinant of the matrix. It turns out that the effect is easy to determine and that elementary column operations can be used in the same way. These observations lead to a technique for evaluating determinants that greatly reduces the labour involved. The necessary information is given in Theorem [thm:007779].

    007779 Let \(A\) denote an \(n \times n\) matrix.

    1. If A has a row or column of zeros, \(\det A = 0\).
    2. If two distinct rows (or columns) of \(A\) are interchanged, the determinant of the resulting matrix is \(- \det A\).
    3. If a row (or column) of \(A\) is multiplied by a constant \(u\), the determinant of the resulting matrix is \(u(\det A)\).
    4. If two distinct rows (or columns) of \(A\) are identical, \(\det A = 0\).
    5. If a multiple of one row of \(A\) is added to a different row (or if a multiple of a column is added to a different column), the determinant of the resulting matrix is \(\det A\).

    We prove properties 2, 4, and 5 and leave the rest as exercises.

    Property 2. If \(A\) is \(n \times n\), this follows by induction on \(n\). If \(n = 2\), the verification is left to the reader. If \(n > 2\) and two rows are interchanged, let \(B\) denote the resulting matrix. Expand \(\det A\) and \(\det B\) along a row other than the two that were interchanged. The entries in this row are the same for both \(A\) and \(B\), but the cofactors in \(B\) are the negatives of those in \(A\) (by induction) because the corresponding \((n - 1) \times (n - 1)\) matrices have two rows interchanged. Hence, \(\det B = - \det A\), as required. A similar argument works if two columns are interchanged.

    Property 4. If two rows of \(A\) are equal, let \(B\) be the matrix obtained by interchanging them. Then \(B = A\), so \(\det B = det A\). But \(\det B = -\det A\) by property 2, so \(\det A = \det B = 0\). Again, the same argument works for columns.

    Property 5. Let \(B\) be obtained from \(A = \left[ a_{ij}\right]\) by adding \(u\) times row \(p\) to row \(q\). Then row \(q\) of \(B\) is

    \[(a_{q1} + ua_{p1},a_{q2} + ua_{p2}, \dots , a_{qn} + ua_{pn}) \nonumber \]

    The cofactors of these elements in \(B\) are the same as in \(A\) (they do not involve row \(q\)): in symbols, \(c_{qj}(B) = c_{qj}(A)\) for each \(j\). Hence, expanding \(B\) along row \(q\) gives

    \[\begin{aligned} \det B &= (a_{q1} + ua_{p1})c_{q1}(A) + (a_{q2} + ua_{p2})c_{q2}(A) + \cdots + (a_{qn}+ua_{pn})c_{qn}(A) \\ &= [a_{q1}c_{q1}(A) + a_{q2}c_{q2}(A) + \cdots + a_{qn}c_{qn}(A)] + u[a_{p1}c_{q1}(A) + a_{p2}c_{q2}(A) + \cdots + a_{pn}c_{qn}(A)] \\ &= \det A + u \det C\end{aligned} \nonumber \]

    where \(C\) is the matrix obtained from \(A\) by replacing row \(q\) by row \(p\) (and both expansions are along row \(q\)). Because rows \(p\) and \(q\) of \(C\) are equal, \(\det C = 0\) by property 4. Hence, \(\det B = \det A\), as required. As before, a similar proof holds for columns.

    To illustrate Theorem [thm:007779], consider the following determinants.

    lX[2] \(\left| \begin{array}{rrr} 3 & -1 & 2 \\ 2 & 5 & 1 \\ 0 & 0 & 0 \end{array} \right| =0\) & (because the last row consists of zeros)

    \(\left| \begin{array}{rrr} 3 & -1 & 5 \\ 2 & 8 & 7 \\ 1 & 2 & -1 \end{array} \right| = - \left| \begin{array}{rrr} 5 & -1 & 3 \\ 7 & 8 & 2 \\ -1 & 2 & 1 \end{array}\right|\) & (because two columns are interchanged)

    \(\left| \begin{array}{rrr} 8 & 1 & 2 \\ 3 & 0 & 9 \\ 1 & 2 & -1 \end{array} \right| = 3 \left| \begin{array}{rrr} 8 & 1 & 2 \\ 1 & 0 & 3 \\ 1 & 2 & -1 \end{array} \right|\) & (because the second row of the matrix on the left is \(3\) times the second row of the matrix on the right)

    \(\left| \begin{array}{rrr} 2 & 1 & 2 \\ 4 & 0 & 4 \\ 1 & 3 & 1 \end{array} \right| =0\) & (because two columns are identical)

    \(\left| \begin{array}{rrr} 2 & 5 & 2 \\ -1 & 2 & 9 \\ 3 & 1 & 1 \end{array} \right| = \left| \begin{array}{rrr} 0 & 9 & 20 \\ -1 & 2 & 9 \\ 3 & 1 & 1 \end{array} \right|\) & (because twice the second row of the matrix on the left was added to the first row)

    The following four examples illustrate how Theorem [thm:007779] is used to evaluate determinants.

    007817 Evaluate \(\det A\) when \(A = \left[ \begin{array}{rrr} 1 & -1 & 3 \\ 1 & 0 & -1 \\ 2 & 1 & 6 \end{array} \right]\).

    The matrix does have zero entries, so expansion along (say) the second row would involve somewhat less work. However, a column operation can be used to get a zero in position \((2, 3\))—namely, add column 1 to column 3. Because this does not change the value of the determinant, we obtain

    \[\det A = \left| \begin{array}{rrr} 1 & -1 & 3 \\ 1 & 0 & -1 \\ 2 & 1 & 6 \end{array} \right| = \left| \begin{array}{rrr} 1 & -1 & 4 \\ 1 & 0 & 0 \\ 2 & 1 & 8 \end{array} \right| = - \left| \begin{array}{rr} -1 & 4 \\ 1 & 8 \end{array} \right| =12 \nonumber \]

    where we expanded the second \(3 \times 3\) matrix along row 2.

    007825 If \(\det \left[ \begin{array}{rrr} a & b & c \\ p & q & r \\ x & y & z \end{array} \right] = 6\), evaluate \(\det A\) where \(A = \left[ \begin{array}{ccc} a+x & b+y & c+z \\ 3x & 3y & 3z \\ -p & -q & -r \end{array}\right]\).

    First take common factors out of rows 2 and 3.

    \[\det A = 3(-1) \det \left[ \begin{array}{ccc} a+x & b+y & c+z \\ x & y & z \\ p & q & r \end{array} \right] \nonumber \]

    Now subtract the second row from the first and interchange the last two rows.

    \[\det A = -3 \det \left[ \begin{array}{ccc} a & b & c \\ x & y & z \\ p & q & r \end{array} \right] = 3 \det \left[ \begin{array}{ccc} a & b & c \\ p & q & r \\ x & y & z \end{array} \right] = 3 \cdot 6 = 18 \nonumber \]

    The determinant of a matrix is a sum of products of its entries. In particular, if these entries are polynomials in \(x\), then the determinant itself is a polynomial in \(x\). It is often of interest to determine which values of \(x\) make the determinant zero, so it is very useful if the determinant is given in factored form. Theorem [thm:007779] can help.

    007837 Find the values of \(x\) for which \(\det A = 0\), where \(A = \left[ \begin{array}{ccc} 1 & x & x \\ x & 1 & x \\ x & x & 1 \end{array} \right]\).

    To evaluate \(\det A\), first subtract \(x\) times row 1 from rows 2 and 3.

    \[\det A = \left| \begin{array}{ccc} 1 & x & x \\ x & 1 & x \\ x & x & 1 \end{array} \right| = \left| \begin{array}{ccc} 1 & x & x \\ 0 & 1-x^2 & x-x^2 \\ 0 & x-x^2 & 1-x^2 \end{array} \right| = \left| \begin{array}{cc} 1-x^2 & x-x^2 \\ x-x^2 & 1-x^2 \end{array} \right| \nonumber \]

    At this stage we could simply evaluate the determinant (the result is \(2x^3-3x^2+1\)). But then we would have to factor this polynomial to find the values of \(x\) that make it zero. However, this factorization can be obtained directly by first factoring each entry in the determinant and taking a common factor of \((1-x)\) from each row.

    \[\begin{aligned} \det A = \left| \begin{array}{cc} (1-x)(1+x) & x(1-x) \\ x(1-x) & (1-x)(1+x) \end{array} \right| &= (1-x)^2 \left| \begin{array}{cc} 1+x & x \\ x & 1+x \end{array} \right| \\ &= (1-x)^2(2x+1)\end{aligned} \nonumber \]

    Hence, \(\det A = 0\) means \((1 - x)^2(2x + 1) = 0\), that is \(x = 1\) or \(x = -\frac{1}{2}\).

    007851 If \(a_1\), \(a_2\), and \(a_3\) are given show that

    \[\det \left[ \begin{array}{ccc} 1 & a_1 & a_1^2 \\ 1 & a_2 & a_2^2 \\ 1 & a_3 & a_3^2 \end{array} \right] = (a_3-a_1)(a_3-a_2)(a_2-a_1) \nonumber \]

    Begin by subtracting row 1 from rows 2 and 3, and then expand along column 1:

    \[\det \left[ \begin{array}{ccc} 1 & a_1 & a_1^2 \\ 1 & a_2 & a_2^2 \\ 1 & a_3 & a_3^2 \end{array} \right] = \det \left[ \begin{array}{ccc} 1 & a_1 & a_1^2 \\ 0 & a_2-a_1 & a_2^2-a_1^2 \\ 0 & a_3-a_1 & a_3^2-a_1^2 \end{array} \right] = \det \left[ \begin{array}{cc} a_2-a_1 & a_2^2-a_1^2 \\ a_3-a_1 & a_3^2-a_1^2 \end{array} \right] \nonumber \]

    Now \((a_2 - a_1)\) and \((a_3 - a_1)\) are common factors in rows 1 and 2, respectively, so

    \[\begin{aligned} \det \left[ \begin{array}{ccc} 1 & a_1 & a_1^2 \\ 1 & a_2 & a_2^2 \\ 1 & a_3 & a_3^2 \end{array} \right] &= (a_2-a_1)(a_3-a_1)\det \left[ \begin{array}{cc} 1& a_2+a_1 \\ 1 & a_3+a_1 \end{array} \right] \\ &= (a_2-a_1)(a_3-a_1)(a_3-a_2)\end{aligned} \nonumber \]

    The matrix in Example [exa:007851] is called a Vandermonde matrix, and the formula for its determinant can be generalized to the \(n \times n\) case (see Theorem [thm:008552]).

    If \(A\) is an \(n \times n\) matrix, forming \(uA\) means multiplying every row of \(A\) by \(u\). Applying property 3 of Theorem [thm:007779], we can take the common factor \(u\) out of each row and so obtain the following useful result.

    007870 If A is an \(n \times n\) matrix, then \(\det (uA) = u^n \det A\) for any number \(u\).

    The next example displays a type of matrix whose determinant is easy to compute.

    007875 Evaluate \(\det A\) if \(A = \left[ \begin{array}{rrrr} a & 0 & 0 & 0 \\ u & b & 0 & 0 \\ v & w & c & 0 \\ x & y & z & d \end{array} \right]\).

    Expand along row 1 to get \(\det A = a \left| \begin{array}{rrr} b & 0 & 0 \\ w & c & 0 \\ y & z & d \end{array} \right|\). Now expand this along the top row to get \(\det A = ab \left| \begin{array}{cc} c & 0 \\ z & d \end{array} \right| = abcd\), the product of the main diagonal entries.

    A square matrix is called a lower triangular matrix if all entries above the main diagonal are zero (as in Example [exa:007875]). Similarly, an upper triangular matrix is one for which all entries below the main diagonal are zero. A triangular matrix is one that is either upper or lower triangular. Theorem [thm:007885] gives an easy rule for calculating the determinant of any triangular matrix. The proof is like the solution to Example [exa:007875].

    007885 If A is a square triangular matrix, then det A is the product of the entries on the main diagonal.

    Theorem [thm:007885] is useful in computer calculations because it is a routine matter to carry a matrix to triangular form using row operations.

    Block matrices such as those in the next theorem arise frequently in practice, and the theorem gives an easy method for computing their determinants. This dovetails with Example [exa:004627].

    007890 Consider matrices \(\left[ \begin{array}{cc} A & X \\ 0 & B \end{array} \right]\) and \(\left[ \begin{array}{cc} A & 0 \\ Y & B \end{array} \right]\) in block form, where \(A\) and \(B\) are square matrices. Then

    \[\det \left[ \begin{array}{cc} A & X \\ 0 & B \end{array}\right] = \det A \det B \mbox{ and } \det \left[ \begin{array}{cc} A & 0 \\ Y & B \end{array}\right] = \det A \det B \nonumber \]

    Write \(T = \det \left[ \begin{array}{cc} A & X \\ 0 & B \end{array}\right]\) and proceed by induction on \(k\) where \(A\) is \(k \times k\). If \(k = 1\), it is the cofactor expansion along column 1. In general let \(S_i(T)\) denote the matrix obtained from \(T\) by deleting row \(i\) and column 1. Then the cofactor expansion of \(\det T\) along the first column is

    \[\label{eq:cofexpdeterminant} \det T = a_{11}\det (S_1(T))-a_{21}\det (S_2(T)) + \cdots \pm a_{k1}\det (S_k(T)) \]

    where \(a_{11}, a_{21}, \cdots, a_{k1}\) are the entries in the first column of \(A\). But \(S_i(T) = \left[ \begin{array}{cc} S_i(A) & X_i \\ 0 & B \end{array} \right]\) for each \(i = 1, 2, \cdots, k\), so \(\det (S_i(T)) = \det (S_i(A)) \cdot \det B\) by induction. Hence, Equation [eq:cofexpdeterminant] becomes

    \[\begin{aligned} \det T &= \left\{ a_{11}\det (S_1(T))-a_{21}\det (S_2(T)) + \cdots \pm a_{k1}\det (S_k(T))\right\} \det B \\ &= \left\{ \det A \right\} \det B\end{aligned} \nonumber \]

    as required. The lower triangular case is similar.

    007910

    \[\det \left[ \begin{array}{rrrr} 2 & 3 & 1 & 3 \\ 1 & -2 & -1 & 1 \\ 0 & 1 & 0 & 1 \\ 0 & 4 & 0 & 1 \end{array} \right] = - \left| \begin{array}{rrrr} 2 & 1 & 3 & 3 \\ 1 & -1 & -2 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 4 & 1 \end{array} \right| = -\left| \begin{array}{rr} 2 & 1 \\ 1 & -1 \end{array} \right| \left| \begin{array}{rr} 1 & 1 \\ 4 & 1 \end{array} \right| = - (-3)(-3) = -9 \nonumber \]

    The next result shows that \(\det A\) is a linear transformation when regarded as a function of a fixed column of \(A\). The proof is Exercise [ex:3_1_21].

    007914 Given columns \(\mathbf{c}_{1}, \cdots , \mathbf{c}_{j-1}, \mathbf{c}_{j+1}, \cdots , \mathbf{c}_{n}\) in \(\mathbb{R}^n\), define \(T: \mathbb{R}^n \to \mathbb{R}\) by

    \[T(\mathbf{x}) = \det \left[ \begin{array}{ccccccc} \mathbf{c}_1 & \cdots & \mathbf{c}_{j-1} & \mathbf{x} & \mathbf{c}_{j+1} & \cdots & \mathbf{c}_n \end{array} \right] \mbox{ for all } \mathbf{x} \mbox{ in } \mathbb{R}^n \nonumber \]

    Then, for all \(\mathbf{x}\) and \(\mathbf{y}\) in \(\mathbb{R}^n\) and all \(a\) in \(\mathbb{R}\),

    \[T(\mathbf{x}+\mathbf{y})= T(\mathbf{x}) + T(\mathbf{y}) \quad \mbox{ and } \quad T(a\mathbf{x}) = aT(\mathbf{x}) \nonumber \]


    1. Determinants are commonly written \(|A| = \det A\) using vertical bars. We will use both notations.↩
    2. If \(A = \left[ \begin{array}{rrr} a & b & c \\ d & e & f \\ g & h & i \end{array} \right]\) we can calculate \(\det A\) by considering \(\left[ \begin{array}{rrrrr} a & b & c & a & b\\ d & e & f & d & e \\ g & h & i & g & h \end{array} \right]\) obtained from \(A\) by adjoining columns \(1\) and \(2\) on the right. Then \(\det A = aei + bfg + cdh - ceg - afh - bdi\), where the positive terms \(aei, bfg,\) and \(cdh\) are the products down and to the right starting at \(a,b\), and \(c\), and the negative terms \(ceg, afh\), and \(bdi\) are the products down and to the left starting at \(c, a\), and \(b\). Warning: This rule does not apply to \(n \times n\) matrices where \(n > 3\) or \(n = 2\).↩

    This page titled 3.1: The Cofactor Expansion is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by W. Keith Nicholson (Lyryx Learning Inc.) via source content that was edited to the style and standards of the LibreTexts platform.