M301 Linear Algebra · Week 7

Introduction to Determinants

Review of matrix algebra · Section 3.1: Introduction to determinants

By the end of this week you will be able to:

  • add, scale, transpose and multiply matrices with confidence, and explain where each entry of a product comes from;
  • state the definition of the determinant of an \(n\times n\) matrix and use it for \(2\times 2\) and \(3\times 3\) matrices;
  • compute cofactors and expand a determinant across any row or down any column;
  • choose a row or column with many zeros to shorten the computation, and write down the determinant of a triangular matrix at once;
  • use the diagonal rule for \(3\times 3\) determinants and explain why it is only for \(3\times 3\).
This week's schedule

Monday starts with the midterm review, then the note begins. Wednesday continues with Section 3.1. There is no lecture on Friday (fall break). Chapter 3 continues next week with Sections 3.2 and 3.3. This note has two days; the homework covers Section 3.1 only.

Day 1: Matrix Algebra Review and the Definition of the Determinant

Today we go over the four matrix operations with an interactive tool, recall the \(2\times 2\) determinant, and define the determinant of an \(n\times n\) matrix.

1.1 Sums, scalar multiples and transposes

Reminder: the operations and when they are defined
  • An \(m\times n\) matrix has \(m\) rows and \(n\) columns. The entry in row \(i\) and column \(j\) of \(A\) is \(a_{ij}\).
  • Sum \(A+B\): defined only when \(A\) and \(B\) have the same size. Add corresponding entries: \((A+B)_{ij}=a_{ij}+b_{ij}\).
  • Scalar multiple \(cA\): multiply every entry by \(c\): \((cA)_{ij}=c\,a_{ij}\). We write \(A-B\) for \(A+(-1)B\).
  • Transpose \(A^T\): the rows of \(A\) become the columns of \(A^T\). If \(A\) is \(m\times n\), then \(A^T\) is \(n\times m\) and \((A^T)_{ij}=a_{ji}\).
Example 1 (sum and scalar multiple)

Let

\[A=\begin{bmatrix}4&0&5\\-1&3&2\end{bmatrix},\qquad B=\begin{bmatrix}1&1&1\\3&5&7\end{bmatrix},\qquad C=\begin{bmatrix}2&-3\\0&1\end{bmatrix}.\]

Compute, if defined:

(a) \(A+B\)
(b) \(3A\)
(c) \(A-2B\)
(d) \(A+C\)

Solution

(a) Both matrices are \(2\times 3\), so the sum is defined. Add entry by entry: \[A+B=\begin{bmatrix}4+1&0+1&5+1\\-1+3&3+5&2+7\end{bmatrix}=\begin{bmatrix}5&1&6\\2&8&9\end{bmatrix}.\]
(b) Multiply every entry of \(A\) by 3: \[3A=\begin{bmatrix}12&0&15\\-3&9&6\end{bmatrix}.\]
(c) First form \(2B\), then subtract entry by entry: \[2B=\begin{bmatrix}2&2&2\\6&10&14\end{bmatrix},\qquad A-2B=\begin{bmatrix}4-2&0-2&5-2\\-1-6&3-10&2-14\end{bmatrix}=\begin{bmatrix}2&-2&3\\-7&-7&-12\end{bmatrix}.\]
(d) \(A\) is \(2\times 3\) and \(C\) is \(2\times 2\). The sizes are different, so \(A+C\) is not defined.
Example 2 (transposes)

Find the transposes of

\[B=\begin{bmatrix}-5&2\\1&-3\\0&4\end{bmatrix},\qquad C=\begin{bmatrix}1&1&1&1\\-3&5&-2&7\end{bmatrix}.\]

Solution

Row 1 of \(B\) is \((-5,\,2)\); it becomes column 1 of \(B^T\). Row 2, \((1,\,-3)\), becomes column 2, and row 3, \((0,\,4)\), becomes column 3. So \(B^T\) is \(2\times 3\). The same rule gives \(C^T\), which is \(4\times 2\):

\[B^T=\begin{bmatrix}-5&1&0\\2&-3&4\end{bmatrix},\qquad C^T=\begin{bmatrix}1&-3\\1&5\\1&-2\\1&7\end{bmatrix}.\]

Check one entry: \((B^T)_{13}=b_{31}=0\). The row and column indices swap.

1.2 Matrix multiplication

Reminder: the product \(AB\)

If \(A\) is \(m\times n\) and \(B\) is \(n\times p\), the product \(AB\) is the \(m\times p\) matrix whose \((i,j)\)-entry is

\[(AB)_{ij}=a_{i1}b_{1j}+a_{i2}b_{2j}+\cdots+a_{in}b_{nj},\]

that is, row \(i\) of \(A\) times column \(j\) of \(B\): multiply the entries pairwise and add. The product is defined only when the number of columns of \(A\) equals the number of rows of \(B\). The result has as many rows as \(A\) and as many columns as \(B\):

\[\underset{m\times n}{A}\ \ \underset{n\times p}{B}=\underset{m\times p}{AB}.\]
Example 3 (every entry of a product)

Compute \(AB\), where

\[A=\begin{bmatrix}1&-2&3\\0&4&-1\end{bmatrix},\qquad B=\begin{bmatrix}2&0\\1&5\\-3&1\end{bmatrix}.\]

Solution

\(A\) is \(2\times 3\) and \(B\) is \(3\times 2\). The inner sizes agree (3 and 3), so \(AB\) is defined and it is \(2\times 2\). Each entry is a row of \(A\) times a column of \(B\):

\((AB)_{11}\): row 1 of \(A\), column 1 of \(B\): \(1\cdot 2+(-2)\cdot 1+3\cdot(-3)=2-2-9=-9\).
\((AB)_{12}\): row 1 of \(A\), column 2 of \(B\): \(1\cdot 0+(-2)\cdot 5+3\cdot 1=0-10+3=-7\).
\((AB)_{21}\): row 2 of \(A\), column 1 of \(B\): \(0\cdot 2+4\cdot 1+(-1)\cdot(-3)=0+4+3=7\).
\((AB)_{22}\): row 2 of \(A\), column 2 of \(B\): \(0\cdot 0+4\cdot 5+(-1)\cdot 1=0+20-1=19\).
\[AB=\begin{bmatrix}-9&-7\\7&19\end{bmatrix}.\]

Note that \(BA\) is also defined here (\(B\) is \(3\times 2\), \(A\) is \(2\times 3\)), but it is a \(3\times 3\) matrix. \(AB\) and \(BA\) do not even have the same size.

Example 4 (\(AB\) and \(BA\) are different)

Let \(A=\begin{bmatrix}1&2\\3&-1\end{bmatrix}\) and \(B=\begin{bmatrix}0&4\\2&5\end{bmatrix}\). Compute \(AB\) and \(BA\).

Solution

\[AB=\begin{bmatrix}1\cdot 0+2\cdot 2&1\cdot 4+2\cdot 5\\3\cdot 0+(-1)\cdot 2&3\cdot 4+(-1)\cdot 5\end{bmatrix}=\begin{bmatrix}4&14\\-2&7\end{bmatrix}\] \[BA=\begin{bmatrix}0\cdot 1+4\cdot 3&0\cdot 2+4\cdot(-1)\\2\cdot 1+5\cdot 3&2\cdot 2+5\cdot(-1)\end{bmatrix}=\begin{bmatrix}12&-4\\17&-1\end{bmatrix}\]

The two products are different. In \(AB\) the rows of \(A\) meet the columns of \(B\); in \(BA\) the rows of \(B\) meet the columns of \(A\). The order of the factors matters.

Three warnings
  1. In general \(AB\neq BA\). One of the products may not even be defined.
  2. \(AB=AC\) does not give \(B=C\). There is no cancellation.
  3. \(AB=0\) does not give \(A=0\) or \(B=0\).
Matrix operations lab

Choose an operation. The given matrices can be edited; "New example" fills them with random integers. Press Open result boxes: the result appears as a matrix of empty boxes, one box for each entry. Click a box to see which entries of the given matrices it uses (they are highlighted) and the computation it needs. Click the same box again, or press Fill entry, to write the value in the box. Entries may be integers, decimals or simple fractions such as 3/2.

Open the result boxes and click a box.
Exercise 1.A (a product and a transpose)

Self-check only. These exercises are not graded. Entries may be typed as integers, decimals (1.5 or 1,5) or simple fractions (3/2).

Let \(A=\begin{bmatrix}1&-2\\3&4\end{bmatrix}\) and \(B=\begin{bmatrix}2&0&-1\\1&3&5\end{bmatrix}\).

(a) Compute \(AB\).
\(AB=\)
(b) Is \(BA\) defined?  
(c) Write \(B^T\).
\(B^T=\)
(a) \(A\) is \(2\times 2\) and \(B\) is \(2\times 3\), so \(AB\) is \(2\times 3\). Row 1 of \(A\) is \((1,-2)\) and row 2 is \((3,4)\): \[AB=\begin{bmatrix}1\cdot2-2\cdot1&1\cdot0-2\cdot3&1\cdot(-1)-2\cdot5\\3\cdot2+4\cdot1&3\cdot0+4\cdot3&3\cdot(-1)+4\cdot5\end{bmatrix}=\begin{bmatrix}0&-6&-11\\10&12&17\end{bmatrix}.\]
(b) No. \(B\) has 3 columns and \(A\) has 2 rows, so the inner sizes do not match.
(c) The rows \((2,0,-1)\) and \((1,3,5)\) of \(B\) become the columns of \(B^T\): \[B^T=\begin{bmatrix}2&1\\0&3\\-1&5\end{bmatrix}.\]

1.3 The \(2\times 2\) determinant

Reminder: the determinant of a \(2\times 2\) matrix

For \(A=\begin{bmatrix}a&b\\c&d\end{bmatrix}\), the determinant is the number

\[\det A=ad-bc.\]

\(A\) is invertible if and only if \(\det A\neq 0\), and in that case

\[A^{-1}=\frac{1}{ad-bc}\begin{bmatrix}d&-b\\-c&a\end{bmatrix}.\]
Example 5 (\(2\times 2\) determinants)

Compute the determinant of each matrix and decide if the matrix is invertible.

(a) \(\begin{bmatrix}3&5\\1&2\end{bmatrix}\)
(b) \(\begin{bmatrix}0&-3\\5&2\end{bmatrix}\)
(c) \(\begin{bmatrix}-6&4\\9&-6\end{bmatrix}\)

Solution

(a) \(\det=3\cdot 2-5\cdot 1=6-5=1\neq 0\). Invertible, with inverse \(\begin{bmatrix}2&-5\\-1&3\end{bmatrix}\).
(b) \(\det=0\cdot 2-(-3)\cdot 5=0+15=15\neq 0\). Invertible.
(c) \(\det=(-6)(-6)-4\cdot 9=36-36=0\). Not invertible.

Figure 1 shows the columns of the matrices in (b) and (c). For a \(2\times 2\) matrix, \(ad-bc=0\) happens exactly when one column is a multiple of the other, so that both columns lie on one line through the origin. In (c), \((4,-6)=-\tfrac23\,(-6,9)\).

-6 -3 3 -6 -3 3 6 9 (0, 5) (−3, 2) Example 5(b): det = 15 -6 -3 3 -6 -3 3 6 9 (−6, 9) (4, −6) Example 5(c): det = 0
Figure 1. Left: the columns \((0,5)\) and \((-3,2)\) of the matrix in Example 5(b) point in different directions (\(\det=15\)). Right: the columns \((-6,9)\) and \((4,-6)\) of the matrix in Example 5(c) lie on the same line through the origin (\(\det=0\)).
Exercise 1.B (\(2\times 2\) determinants)

Self-check only.

Compute each determinant and decide if the matrix is invertible.

(a) \(\begin{bmatrix}2&7\\1&4\end{bmatrix}\):   \(\det=\)  
(b) \(\begin{bmatrix}2&-4\\-3&6\end{bmatrix}\):   \(\det=\)  
(c) \(\begin{bmatrix}6&5\\-7&9\end{bmatrix}\):   \(\det=\)  
(a) \(\det=2\cdot 4-7\cdot 1=1\). Invertible.
(b) \(\det=2\cdot 6-(-4)(-3)=12-12=0\). Not invertible (the second column is \(-2\) times the first).
(c) \(\det=6\cdot 9-5\cdot(-7)=54+35=89\). Invertible.

1.4 Towards the \(n\times n\) determinant

For a \(2\times 2\) matrix, the determinant tells us whether the matrix is invertible. We want a number with the same job for an \(n\times n\) matrix. The \(3\times 3\) case shows what this number has to be.

Take \(A=[a_{ij}]\) with \(a_{11}\neq 0\) and row reduce it. Multiply rows 2 and 3 by \(a_{11}\) and subtract suitable multiples of row 1 from them. Then one more row replacement clears the \((3,2)\)-position. The result is an echelon form

\[A\sim\begin{bmatrix}a_{11}&a_{12}&a_{13}\\0&a_{11}a_{22}-a_{12}a_{21}&a_{11}a_{23}-a_{13}a_{21}\\0&0&a_{11}\Delta\end{bmatrix},\]

where

\[\Delta=a_{11}a_{22}a_{33}+a_{12}a_{23}a_{31}+a_{13}a_{21}a_{32}-a_{11}a_{23}a_{32}-a_{12}a_{21}a_{33}-a_{13}a_{22}a_{31}.\]

If \(A\) is invertible, it has three pivots, so the \((3,3)\)-entry \(a_{11}\Delta\) is nonzero, and so \(\Delta\neq 0\). The number \(\Delta\) is the determinant of the \(3\times 3\) matrix \(A\). The formula has six terms, and it looks hard to remember. But the terms can be grouped by the entries of the first row:

\[\Delta=a_{11}(a_{22}a_{33}-a_{23}a_{32})-a_{12}(a_{21}a_{33}-a_{23}a_{31})+a_{13}(a_{21}a_{32}-a_{22}a_{31}).\]

Each bracket is a \(2\times 2\) determinant:

\[\Delta=a_{11}\det\begin{bmatrix}a_{22}&a_{23}\\a_{32}&a_{33}\end{bmatrix}-a_{12}\det\begin{bmatrix}a_{21}&a_{23}\\a_{31}&a_{33}\end{bmatrix}+a_{13}\det\begin{bmatrix}a_{21}&a_{22}\\a_{31}&a_{32}\end{bmatrix}.\]

The first \(2\times 2\) matrix is what remains of \(A\) when row 1 and column 1 are deleted; the second one, when row 1 and column 2 are deleted; the third, when row 1 and column 3 are deleted. This is the pattern we use to define determinants of any size.

Definition: submatrix \(A_{ij}\)

For a square matrix \(A\), let \(A_{ij}\) denote the submatrix obtained from \(A\) by deleting the \(i\)th row and the \(j\)th column. If \(A\) is \(n\times n\), then \(A_{ij}\) is \((n-1)\times(n-1)\).

Example 6 (a submatrix)

Let

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

Find \(A_{32}\) and \(A_{14}\).

Solution

\(A_{32}\) is obtained by crossing out row 3 and column 2 (Figure 2). What remains is

\[A_{32}=\begin{bmatrix}1&5&0\\2&4&-1\\0&-2&0\end{bmatrix}.\]

For \(A_{14}\), cross out row 1 and column 4:

\[A_{14}=\begin{bmatrix}2&0&4\\3&1&0\\0&4&-2\end{bmatrix}.\]
A = 1 −2 5 0 2 0 4 −1 3 1 0 7 0 4 −2 0 delete row 3, column 2 A32 = 1 5 0 2 4 −1 0 −2 0
Figure 2. Crossing out row 3 and column 2 of the \(4\times 4\) matrix \(A\) of Example 6 leaves the \(3\times 3\) submatrix \(A_{32}\).
Definition: the determinant

For \(n\geq 2\), the determinant of an \(n\times n\) matrix \(A=[a_{ij}]\) is the sum of \(n\) terms of the form \(\pm a_{1j}\det A_{1j}\), with plus and minus signs alternating, where \(a_{11},a_{12},\dots,a_{1n}\) are the entries of the first row of \(A\). In symbols,

\[\det A=a_{11}\det A_{11}-a_{12}\det A_{12}+\cdots+(-1)^{1+n}a_{1n}\det A_{1n}=\sum_{j=1}^{n}(-1)^{1+j}a_{1j}\det A_{1j}.\]

For a \(1\times 1\) matrix \(A=[a_{11}]\) we define \(\det A=a_{11}\).

The definition is recursive: a \(3\times 3\) determinant is computed from \(2\times 2\) determinants, a \(4\times 4\) determinant from \(3\times 3\) determinants, and so on. For \(n=2\) it gives \(a_{11}\det[a_{22}]-a_{12}\det[a_{21}]=a_{11}a_{22}-a_{12}a_{21}\), the formula \(ad-bc\) we already know.

Another common notation uses vertical lines instead of brackets: \(\det\begin{bmatrix}a&b\\c&d\end{bmatrix}\) is also written \(\begin{vmatrix}a&b\\c&d\end{vmatrix}\).

Example 7 (a \(3\times 3\) determinant from the definition)

Compute \(\det A\), where \(A=\begin{bmatrix}1&5&0\\2&4&-1\\0&-2&0\end{bmatrix}\).

Solution

The first row is \((1,\,5,\,0)\). The definition says \(\det A=a_{11}\det A_{11}-a_{12}\det A_{12}+a_{13}\det A_{13}\). Delete row 1 and column 1, 2, 3 in turn to get the three submatrices:

\[\det A=1\cdot\begin{vmatrix}4&-1\\-2&0\end{vmatrix}-5\cdot\begin{vmatrix}2&-1\\0&0\end{vmatrix}+0\cdot\begin{vmatrix}2&4\\0&-2\end{vmatrix}.\]

Evaluate each \(2\times 2\) determinant with \(ad-bc\):

\[\begin{vmatrix}4&-1\\-2&0\end{vmatrix}=4\cdot 0-(-1)(-2)=-2,\qquad \begin{vmatrix}2&-1\\0&0\end{vmatrix}=0-0=0,\] \[\begin{vmatrix}2&4\\0&-2\end{vmatrix}=-4-0=-4.\]

So \(\det A=1(-2)-5(0)+0(-4)=-2\). The last term is zero because \(a_{13}=0\); its \(2\times 2\) determinant did not have to be computed.

Example 8 (another \(3\times 3\) determinant)

Compute \(\det A\), where \(A=\begin{bmatrix}3&0&4\\2&3&2\\0&5&-1\end{bmatrix}\).

Solution

Expand along the first row, \((3,\,0,\,4)\). Remember the alternating signs: \(+,\,-,\,+\).

\[\det A=3\cdot\begin{vmatrix}3&2\\5&-1\end{vmatrix}-0\cdot\begin{vmatrix}2&2\\0&-1\end{vmatrix}+4\cdot\begin{vmatrix}2&3\\0&5\end{vmatrix}.\]

The middle term is zero. For the other two, \(\begin{vmatrix}3&2\\5&-1\end{vmatrix}=3(-1)-2\cdot 5=-13\) and \(\begin{vmatrix}2&3\\0&5\end{vmatrix}=2\cdot 5-3\cdot 0=10\). Therefore

\[\det A=3(-13)+4(10)=-39+40=1.\]
Exercise 1.C (a \(3\times 3\) determinant)

Self-check only.

Use the definition (expansion along the first row) to compute

\[\det\begin{bmatrix}4&5&-8\\1&0&2\\7&3&6\end{bmatrix}.\]
\(\det=\)
\[\det=4\begin{vmatrix}0&2\\3&6\end{vmatrix}-5\begin{vmatrix}1&2\\7&6\end{vmatrix}+(-8)\begin{vmatrix}1&0\\7&3\end{vmatrix}\] \[=4(0-6)-5(6-14)-8(3-0)=-24+40-24=-8.\]

Day 2: Cofactor Expansion Along Any Row or Column

Today we learn that the determinant can be expanded along any row or any column, how to use zeros to shorten the work, and the diagonal rule for \(3\times 3\) matrices.

Facts used today
  • \(\det\begin{bmatrix}a&b\\c&d\end{bmatrix}=ad-bc\).
  • \(A_{ij}\) is the submatrix of \(A\) obtained by deleting row \(i\) and column \(j\).
  • Definition: \(\det A=a_{11}\det A_{11}-a_{12}\det A_{12}+\cdots+(-1)^{1+n}a_{1n}\det A_{1n}\) (expansion along the first row, signs alternating).

2.1 Cofactors

It is convenient to put the sign into the \(2\times 2\) (or smaller) determinant and give the signed quantity a name.

Definition: cofactor

Given \(A=[a_{ij}]\), the \((i,j)\)-cofactor of \(A\) is the number

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

With cofactors, the definition of the determinant reads

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

This is called the cofactor expansion across the first row. The next theorem is the main tool of this section. Its proof is long, and we omit it.

Theorem 1

The determinant of an \(n\times n\) matrix \(A\) can be computed by a cofactor expansion across any row or down any column. The expansion across the \(i\)th row is

\[\det A=a_{i1}C_{i1}+a_{i2}C_{i2}+\cdots+a_{in}C_{in},\]

and the expansion down the \(j\)th column is

\[\det A=a_{1j}C_{1j}+a_{2j}C_{2j}+\cdots+a_{nj}C_{nj}.\]

The sign \((-1)^{i+j}\) in the cofactor depends only on the position of \(a_{ij}\), not on the sign of \(a_{ij}\) itself. The positions form a checkerboard pattern:

\[\begin{bmatrix}+&-&+&-&\cdots\\-&+&-&+\\+&-&+&-\\-&+&-&+\\\vdots&&&&\ddots\end{bmatrix}\]

The \((1,1)\)-position is always \(+\), and the sign changes at every step to the right or downward. For instance, the \((3,2)\)-position has sign \((-1)^{5}=-\), and the \((2,4)\)-position has sign \((-1)^{6}=+\).

Example 1 (expansion across the third row)

Use a cofactor expansion across the third row to compute \(\det A\), where \(A=\begin{bmatrix}1&5&0\\2&4&-1\\0&-2&0\end{bmatrix}\).

Solution

The third row is \((0,\,-2,\,0)\), and the signs of the third row are \(+,\,-,\,+\). By Theorem 1,

\[\det A=a_{31}C_{31}+a_{32}C_{32}+a_{33}C_{33}\] \[=(-1)^{3+1}a_{31}\det A_{31}+(-1)^{3+2}a_{32}\det A_{32}+(-1)^{3+3}a_{33}\det A_{33}.\]

With the numbers, and deleting row 3 and column 1, 2, 3 for the submatrices:

\[\det A=0\cdot\begin{vmatrix}5&0\\4&-1\end{vmatrix}-(-2)\begin{vmatrix}1&0\\2&-1\end{vmatrix}+0\cdot\begin{vmatrix}1&5\\2&4\end{vmatrix}=0+2(-1)+0=-2.\]

This agrees with Day 1, Example 7, where we expanded along the first row. The third row was a better choice: it has two zeros, so only one \(2\times 2\) determinant had to be computed.

Example 2 (expansion down the second column)

Compute \(\det A\) for \(A=\begin{bmatrix}3&0&4\\2&3&2\\0&5&-1\end{bmatrix}\) by a cofactor expansion down the second column, and compare with Day 1, Example 8.

Solution

The second column is \((0,\,3,\,5)\). The signs of the second column are \(-,\,+,\,-\) (positions \((1,2)\), \((2,2)\), \((3,2)\)). So

\[\det A=a_{12}C_{12}+a_{22}C_{22}+a_{32}C_{32}=-0\cdot\det A_{12}+3\det A_{22}-5\det A_{32}.\]

Delete row 2 and column 2 for \(A_{22}\), and row 3 and column 2 for \(A_{32}\):

\[\det A_{22}=\begin{vmatrix}3&4\\0&-1\end{vmatrix}=-3-0=-3,\qquad \det A_{32}=\begin{vmatrix}3&4\\2&2\end{vmatrix}=6-8=-2.\]

Therefore \(\det A=0+3(-3)-5(-2)=-9+10=1\), the same value as in Example 8 of Day 1. Any row or column gives the same answer; the work differs.

Determinant calculator (step by step)

Enter a matrix (the entries can be edited, or press "New example"), choose a row or a column to expand along, and press Start. The computation then appears one step at a time: the signs and the terms, the submatrices, their determinants, and the sum. For a \(3\times 3\) matrix you can also choose the diagonal rule of Section 2.3 below.

2.2 Using zeros, and triangular matrices

Theorem 1 is most useful for a matrix with many zeros. If a row is mostly zeros, the cofactor expansion across that row has many terms that are zero, and the cofactors in those terms need not be computed. The same holds for a column with many zeros. From now on we omit the zero terms.

Example 3 (a \(5\times 5\) determinant with many zeros)

Compute \(\det A\), where

\[A=\begin{bmatrix}3&-7&8&9&-6\\0&2&-5&7&3\\0&0&1&5&0\\0&0&2&4&-1\\0&0&0&-2&0\end{bmatrix}.\]

Solution

The first column is \((3,0,0,0,0)\). Expanding down it, every term except the first is zero, and the sign of position \((1,1)\) is \(+\):

\[\det A=3\begin{vmatrix}2&-5&7&3\\0&1&5&0\\0&2&4&-1\\0&0&-2&0\end{vmatrix}.\]

The \(4\times 4\) determinant again has a first column with one nonzero entry. Expand down it:

\[\det A=3\cdot 2\begin{vmatrix}1&5&0\\2&4&-1\\0&-2&0\end{vmatrix}.\]

This \(3\times 3\) determinant was computed in Example 1: it equals \(-2\). Hence \(\det A=3\cdot 2\cdot(-2)=-12\).

The matrix in Example 3 is nearly triangular. For a triangular matrix the same idea works all the way down, and the determinant can be read off at once.

Theorem 2

If \(A\) is a triangular matrix, then \(\det A\) is the product of the entries on the main diagonal of \(A\).

Why. For an upper triangular matrix, expand down the first column: only \(a_{11}\) is nonzero there, and \(A_{11}\) is again upper triangular. Repeating the argument gives \(\det A=a_{11}a_{22}\cdots a_{nn}\). For a lower triangular matrix expand across the first row instead. The theorem includes diagonal matrices, and \(\det I_n=1\).

Example 4 (a triangular matrix)

Compute \(\det A\), where \(A=\begin{bmatrix}-1&2&0&3\\0&4&1&-2\\0&0&3&5\\0&0&0&2\end{bmatrix}\).

Solution

\(A\) is upper triangular. By Theorem 2, \(\det A=(-1)(4)(3)(2)=-24\). The same answer comes from expanding down the first column four times: \(\det A=(-1)\begin{vmatrix}4&1&-2\\0&3&5\\0&0&2\end{vmatrix}=(-1)(4)\begin{vmatrix}3&5\\0&2\end{vmatrix}=(-1)(4)(3)(2)\).

Another useful case: if an entire row or column of \(A\) is zero, expand along it. Every term is zero, so \(\det A=0\).

Example 5 (choosing the best row or column)

Compute \(\det A\), where \(A=\begin{bmatrix}7&6&8&4\\0&0&0&6\\8&7&9&3\\0&4&0&5\end{bmatrix}\). At each step, choose a row or column that involves the least computation.

Solution

Row 2 has three zeros, so expand across row 2. Only the \((2,4)\)-entry contributes. Its sign is \((-1)^{2+4}=+\), and \(A_{24}\) is obtained by deleting row 2 and column 4:

\[\det A=6\begin{vmatrix}7&6&8\\8&7&9\\0&4&0\end{vmatrix}.\]

In this \(3\times 3\) determinant, row 3 is \((0,4,0)\). Expand across row 3; the \((3,2)\)-position has sign \((-1)^{3+2}=-\):

\[\begin{vmatrix}7&6&8\\8&7&9\\0&4&0\end{vmatrix}=-4\begin{vmatrix}7&8\\8&9\end{vmatrix}=-4(63-64)=4.\]

Therefore \(\det A=6\cdot 4=24\). Two sign decisions were needed: \(+\) for position \((2,4)\) of the \(4\times 4\) matrix, and \(-\) for position \((3,2)\) of the \(3\times 3\) matrix. Each sign is decided within the matrix being expanded.

Example 6 (a column with one nonzero entry)

Compute \(\begin{vmatrix}5&-7&2&2\\0&3&0&-4\\-5&-8&0&3\\0&5&0&-6\end{vmatrix}\).

Solution

Column 3 is \((2,0,0,0)\). Expand down column 3. The only nonzero entry is in position \((1,3)\), with sign \((-1)^{1+3}=+\). Deleting row 1 and column 3:

\[\det A=2\begin{vmatrix}0&3&-4\\-5&-8&3\\0&5&-6\end{vmatrix}.\]

Now column 1 of the \(3\times 3\) matrix is \((0,-5,0)\). Expand down it; position \((2,1)\) has sign \((-1)^{2+1}=-\):

\[\begin{vmatrix}0&3&-4\\-5&-8&3\\0&5&-6\end{vmatrix}=-(-5)\begin{vmatrix}3&-4\\5&-6\end{vmatrix}=5(-18+20)=10.\]

So \(\det A=2\cdot 10=20\).

How much work is a determinant?

A cofactor expansion of an \(n\times n\) determinant with no zeros needs more than \(n!\) multiplications. For \(n=25\) that is about \(1.55\times 10^{25}\); a computer doing one trillion multiplications per second would need almost 500,000 years. Cofactor expansion is a definition and a tool for small matrices or matrices with many zeros. Faster methods come in Section 3.2.

Exercise 2.A (choose the best row or column)

Self-check only.

Compute the determinant by cofactor expansions. At each step, choose a row or column with as many zeros as possible, and decide the sign from the position.

\[\begin{vmatrix}4&0&-7&3&-5\\0&0&2&0&0\\7&3&-6&4&-8\\5&0&5&2&-3\\0&0&9&-1&2\end{vmatrix}\]
\(\det=\)

Row 2 is \((0,0,2,0,0)\). Expand across row 2; the sign of position \((2,3)\) is \((-1)^{5}=-\). Deleting row 2 and column 3:

\[\det=-2\begin{vmatrix}4&0&3&-5\\7&3&4&-8\\5&0&2&-3\\0&0&-1&2\end{vmatrix}.\]

In the \(4\times 4\) determinant, column 2 is \((0,3,0,0)\). Expand down column 2; position \((2,2)\) has sign \(+\). Deleting row 2 and column 2:

\[\begin{vmatrix}4&0&3&-5\\7&3&4&-8\\5&0&2&-3\\0&0&-1&2\end{vmatrix}=3\begin{vmatrix}4&3&-5\\5&2&-3\\0&-1&2\end{vmatrix}.\]

Expand the \(3\times 3\) determinant across row 3, \((0,-1,2)\); positions \((3,2)\) and \((3,3)\) have signs \(-\) and \(+\):

\[\begin{vmatrix}4&3&-5\\5&2&-3\\0&-1&2\end{vmatrix}=-(-1)\begin{vmatrix}4&-5\\5&-3\end{vmatrix}+2\begin{vmatrix}4&3\\5&2\end{vmatrix}=(-12+25)+2(8-15)=13-14=-1.\]

Altogether, \(\det=-2\cdot 3\cdot(-1)=6\).

2.3 The diagonal rule for \(3\times 3\) determinants

For a \(3\times 3\) matrix there is a device for remembering the six-term formula \(\Delta\) of Day 1. Write a second copy of the first two columns to the right of the matrix. Multiply the entries on the three downward diagonals and on the three upward diagonals (Figure 3).

+++−−− a11a12a13a11a12a21a22a23a21a22a31a32a33a31a32 copy of columns 1 and 2
Figure 3. The diagonal rule. Downward diagonals (solid) give the three products that are added; upward diagonals (dashed) give the three products that are subtracted.
The diagonal rule (\(3\times 3\) only) \[\det A=\underbrace{a_{11}a_{22}a_{33}+a_{12}a_{23}a_{31}+a_{13}a_{21}a_{32}}_{\text{downward diagonals}}\ -\ \underbrace{\big(a_{13}a_{22}a_{31}+a_{11}a_{23}a_{32}+a_{12}a_{21}a_{33}\big)}_{\text{upward diagonals}}\]

Add the three downward products and subtract the three upward products.

Warning

This rule works only for \(3\times 3\) matrices. It does not generalize to \(4\times 4\) or larger matrices in any reasonable way. For those, use cofactor expansion (or the methods of Section 3.2).

Example 7 (diagonal rule and cofactor expansion agree)

Compute \(\det A\), where \(A=\begin{bmatrix}1&0&4\\2&3&2\\0&5&-2\end{bmatrix}\), with the diagonal rule. Then check with a cofactor expansion.

Solution

Write the first two columns again on the right:

\[\begin{array}{ccc|cc}1&0&4&1&0\\2&3&2&2&3\\0&5&-2&0&5\end{array}\]

Downward products: \(1\cdot 3\cdot(-2)=-6\), \(\ 0\cdot 2\cdot 0=0\), \(\ 4\cdot 2\cdot 5=40\). Their sum is \(34\).

Upward products: \(4\cdot 3\cdot 0=0\), \(\ 1\cdot 2\cdot 5=10\), \(\ 0\cdot 2\cdot(-2)=0\). Their sum is \(10\).

So \(\det A=34-10=24\).

Check. Expand across the first row: \(\det A=1\begin{vmatrix}3&2\\5&-2\end{vmatrix}-0+4\begin{vmatrix}2&3\\0&5\end{vmatrix}=(-6-10)+4(10)=-16+40=24\).

Example 8 (diagonal rule with negative entries)

Compute \(\det A\), where \(A=\begin{bmatrix}2&-3&3\\3&2&2\\1&3&-1\end{bmatrix}\).

Solution

\[\begin{array}{ccc|cc}2&-3&3&2&-3\\3&2&2&3&2\\1&3&-1&1&3\end{array}\]

Downward: \(2\cdot 2\cdot(-1)=-4\), \(\ (-3)\cdot 2\cdot 1=-6\), \(\ 3\cdot 3\cdot 3=27\). Sum: \(17\).

Upward: \(3\cdot 2\cdot 1=6\), \(\ 2\cdot 2\cdot 3=12\), \(\ (-3)\cdot 3\cdot(-1)=9\). Sum: \(27\).

\(\det A=17-27=-10\). Keep the signs of the entries inside the products; the rule's own signs (add downward, subtract upward) are applied after.

Exercise 2.B (diagonal rule)

Self-check only. The three downward products may be entered in any order, and so may the three upward products.

Use the diagonal rule to compute \(\det A\), where \(A=\begin{bmatrix}4&3&0\\6&5&2\\9&7&3\end{bmatrix}\).

Downward products:
Upward products:
\(\det A=\)

Downward: \(4\cdot 5\cdot 3=60\), \(\ 3\cdot 2\cdot 9=54\), \(\ 0\cdot 6\cdot 7=0\). Upward: \(0\cdot 5\cdot 9=0\), \(\ 4\cdot 2\cdot 7=56\), \(\ 3\cdot 6\cdot 3=54\).

\(\det A=(60+54+0)-(0+56+54)=114-110=4\).

Exercise 2.C (determinants with little computation)

Self-check only. Each determinant can be found with at most one \(2\times 2\) determinant.

(a) \(\begin{vmatrix}2&-3&4&5\\0&5&3&-1\\0&0&-2&7\\0&0&0&4\end{vmatrix}\)   \(=\)
(b) \(\begin{vmatrix}1&0&4\\-2&0&7\\5&0&3\end{vmatrix}\)   \(=\)
(c) \(\begin{vmatrix}3&0&0&0\\7&-2&0&0\\2&6&3&0\\3&-8&4&-3\end{vmatrix}\)   \(=\)
(a) Upper triangular: \(2\cdot 5\cdot(-2)\cdot 4=-80\).
(b) The second column is zero. Expanding down it gives \(0\).
(c) Lower triangular: \(3\cdot(-2)\cdot 3\cdot(-3)=54\).

Homework 7

Instructions
  • Fill in your name and surname below before you save the PDF.
  • Show your work. For a cofactor expansion, write which row or column you expand along, the sign of each position you use, and each smaller determinant. An answer without the steps that lead to it does not receive full credit.
  • Every question has two answer modes: Type and Write by hand. In Write by hand mode the text boxes are replaced by a writing area where you can write with a pen, your finger or the mouse. For each question, only the answer of the selected mode goes into the PDF. Changing the mode does not delete what you entered in the other mode.
  • In Type mode, write a \(2\times 2\) determinant as |3 4; 0 -1| and a matrix as [1 2; 3 4] (rows separated by semicolons).
  • To submit: press "Save homework as PDF", choose "Save as PDF" in the print dialog, and upload the file to Canvas.
  • Your answers are saved automatically in this browser. If you open the page on a different computer or browser, they will not be there.

Question 120 points

Let

\[A=\begin{bmatrix}1&2&4\\3&1&1\\2&4&2\end{bmatrix}.\]

Compute \(\det A\) in three ways, showing each \(2\times 2\) determinant you use.

(a) By a cofactor expansion across the first row.
\(\det A=\)
(b) By a cofactor expansion down the second column. Write the sign of each position in the second column before you start.
\(\det A=\)
(c) By the diagonal rule. Write the three downward products and the three upward products.
\(\det A=\)

Question 220 points

Compute the determinant by cofactor expansions. At each step, choose a row or column that involves the least amount of computation, and say which one you chose and why.

\[\begin{vmatrix}1&-2&4&2\\0&0&3&0\\2&-4&-3&5\\2&0&3&5\end{vmatrix}\]
Determinant \(=\)

Question 320 points

Compute the determinant by cofactor expansions. At each step, choose a row or column that involves the least amount of computation. Write the sign of every position you use.

\[\begin{vmatrix}6&0&2&4&0\\9&0&-4&1&0\\8&-5&6&7&1\\2&0&0&0&0\\4&2&3&2&0\end{vmatrix}\]
Determinant \(=\)

Question 420 points

(a) Compute \(\begin{vmatrix}6&5&0\\4&3&-2\\2&0&1\end{vmatrix}\) by a cofactor expansion along a row or column of your choice. Say why you chose it.
Determinant \(=\)
(b) Compute \(\begin{vmatrix}1&4&5\\3&4&3\\3&3&4\end{vmatrix}\) with the diagonal rule. Write the six products.
Determinant \(=\)

Question 520 points

In each part, the second matrix is obtained from the first by one elementary row operation. Compute the determinant of both matrices (the entries \(a,b,c,d\) and the scalar \(k\) are arbitrary), state the row operation, and describe how it affects the determinant.

(a) \(\begin{bmatrix}a&b\\c&d\end{bmatrix}\) and \(\begin{bmatrix}a&b\\kc&kd\end{bmatrix}\)
(b) \(\begin{bmatrix}a&b\\c&d\end{bmatrix}\) and \(\begin{bmatrix}a+kc&b+kd\\c&d\end{bmatrix}\)