Section DM Determinant of a Matrix
Before we define the determinant of a matrix, we take a slight detour to introduce elementary matrices. These will bring us back to the beginning of the course and our old friend, row operations.
Subsection EM Elementary Matrices
Elementary matrices are very simple, as you might have suspected from their name. Their purpose is to effect row operations (Definition RO) on a matrix through matrix multiplication (Definition MM). Their definitions look much more complicated than they really are, so be sure to skip over them on your first reading and head right for the explanation that follows and the first example.
Definition ELEM. Elementary Matrices.
- For \(i\neq j\text{,}\) \(\elemswap{i}{j}\) is the square matrix of size \(n\) with\begin{equation*} \matrixentry{\elemswap{i}{j}}{k\ell}= \begin{cases} 0 & k\neq i, k\neq j, \ell\neq k\\ 1 & k\neq i, k\neq j, \ell=k\\ 0 & k=i, \ell\neq j\\ 1 & k=i, \ell=j\\ 0 & k=j, \ell\neq i\\ 1 & k=j, \ell=i \end{cases}\text{.} \end{equation*}
- For \(\alpha\neq 0\text{,}\) \(\elemmult{\alpha}{i}\) is the square matrix of size \(n\) with\begin{equation*} \matrixentry{\elemmult{\alpha}{i}}{k\ell}= \begin{cases} 0 & \ell\neq k\\ 1 & k\neq i, \ell=k\\ \alpha & k=i, \ell=i \end{cases}\text{.} \end{equation*}
- For \(i\neq j\text{,}\) \(\elemadd{\alpha}{i}{j}\) is the square matrix of size \(n\) with\begin{equation*} \matrixentry{\elemadd{\alpha}{i}{j}}{k\ell}= \begin{cases} 0 & k\neq j, \ell\neq k\\ 1 & k\neq j, \ell=k\\ 0 & k=j, \ell\neq i, \ell\neq j\\ 1 & k=j, \ell=j\\ \alpha & k=j, \ell=i\\ \end{cases}\text{.} \end{equation*}
Again, these matrices are not as complicated as their definitions suggest, since they are just small perturbations of the \(n\times n\) identity matrix (Definition IM). \(\elemswap{i}{j}\) is the identity matrix with rows \(i\) and \(j\) trading places, \(\elemmult{\alpha}{i}\) is the identity matrix where the diagonal entry in row \(i\) and column \(i\) has been replaced by \(\alpha\text{,}\) and \(\elemadd{\alpha}{i}{j}\) is the identity matrix where the entry in row \(j\) and column \(i\) has been replaced by \(\alpha\text{.}\) (Yes, those subscripts look backwards in the description of \(\elemadd{\alpha}{i}{j}\)). Notice that our notation makes no reference to the size of the elementary matrix, since this will always be apparent from the context, or unimportant.
The raison d'etre for elementary matrices is to “do” row operations on matrices with matrix multiplication. So here is an example where we will both see some elementary matrices and see how they accomplish row operations when used with matrix multiplication.
Example EMRO. Elementary matrices and row operations.
We will perform a sequence of row operations (Definition RO) on the \(3\times 4\) matrix \(A\text{,}\) while also multiplying the matrix on the left by the appropriate \(3\times 3\) elementary matrix.
The next three theorems establish that each elementary matrix effects a row operation via matrix multiplication.
Theorem EMDRO. Elementary Matrices Do Row Operations.
Suppose that \(A\) is an \(m\times n\) matrix, and \(B\) is a matrix of the same size that is obtained from \(A\) by a single row operation (Definition RO). Then there is an elementary matrix of size \(m\) that will convert \(A\) to \(B\) via matrix multiplication on the left. More precisely,
- If the row operation swaps rows \(i\) and \(j\text{,}\) then \(B=\elemswap{i}{j}A\text{.}\)
- If the row operation multiplies row \(i\) by \(\alpha\text{,}\) then \(B=\elemmult{\alpha}{i}A\text{.}\)
- If the row operation multiplies row \(i\) by \(\alpha\) and adds the result to row \(j\text{,}\) then \(B=\elemadd{\alpha}{i}{j}A\text{.}\)
Proof.
In each of the three conclusions, performing the row operation on \(A\) will create the matrix \(B\) where only one or two rows will have changed. So we will establish the equality of the matrix entries row by row, first for the unchanged rows, then for the changed rows, showing in each case that the result of the matrix product is the same as the result of the row operation. Here we go.
Row \(k\) of the product \(\elemswap{i}{j}A\text{,}\) where \(k\neq i\text{,}\) \(k\neq j\text{,}\) is unchanged from \(A\text{,}\)
Row \(i\) of the product \(\elemswap{i}{j}A\) is row \(j\) of \(A\text{,}\)
Row \(j\) of the product \(\elemswap{i}{j}A\) is row \(i\) of \(A\text{,}\)
So the matrix product \(\elemswap{i}{j}A\) is the same as the row operation that swaps rows \(i\) and \(j\text{.}\)
Row \(k\) of the product \(\elemmult{\alpha}{i}A\text{,}\) where \(k\neq i\text{,}\) is unchanged from \(A\text{,}\)
Row \(i\) of the product \(\elemmult{\alpha}{i}A\) is \(\alpha\) times row \(i\) of \(A\text{,}\)
So the matrix product \(\elemmult{\alpha}{i}A\) is the same as the row operation that swaps multiplies row \(i\) by \(\alpha\text{.}\)
Row \(k\) of the product \(\elemadd{\alpha}{i}{j}A\text{,}\) where \(k\neq j\text{,}\) is unchanged from \(A\text{,}\)
Row \(j\) of the product \(\elemadd{\alpha}{i}{j}A\text{,}\) is \(\alpha\) times row \(i\) of \(A\) and then added to row \(j\) of \(A\text{,}\)
So the matrix product \(\elemadd{\alpha}{i}{j}A\) is the same as the row operation that multiplies row \(i\) by \(\alpha\) and adds the result to row \(j\text{.}\)
Later in this section we will need two facts about elementary matrices.
Theorem EMN. Elementary Matrices are Nonsingular.
If \(E\) is an elementary matrix, then \(E\) is nonsingular.
Proof.
We show that we can row-reduce each elementary matrix to the identity matrix. Given an elementary matrix of the form \(\elemswap{i}{j}\text{,}\) perform the row operation that swaps row \(j\) with row \(i\text{.}\) Given an elementary matrix of the form \(\elemmult{\alpha}{i}\text{,}\) with \(\alpha\neq 0\text{,}\) perform the row operation that multiplies row \(i\) by \(1/\alpha\text{.}\) Given an elementary matrix of the form \(\elemadd{\alpha}{i}{j}\text{,}\) with \(\alpha\neq 0\text{,}\) perform the row operation that multiplies row \(i\) by \(-\alpha\) and adds it to row \(j\text{.}\) In each case, the result of the single row operation is the identity matrix. So each elementary matrix is row-equivalent to the identity matrix, and by Theorem NMRRI is nonsingular.
Notice that we have now made use of the nonzero restriction on \(\alpha\) in the definition of \(\elemmult{\alpha}{i}\text{.}\) One more key property of elementary matrices.
Theorem NMPEM. Nonsingular Matrices are Products of Elementary Matrices.
Suppose that \(A\) is a nonsingular matrix. Then there exists elementary matrices \(E_1,\,E_2,\,E_3,\,\dots,\,E_t\) so that \(A=E_1 E_2 E_3\dots E_t\text{.}\)
Proof.
Since \(A\) is nonsingular, it is row-equivalent to the identity matrix by Theorem NMRRI, so there is a sequence of \(t\) row operations that converts \(I\) to \(A\text{.}\) For each of these row operations, form the associated elementary matrix from Theorem EMDRO and denote these matrices by \(E_1,\,E_2,\,E_3,\,\dots,\,E_t\text{.}\) Applying the first row operation to \(I\) yields the matrix \(E_1I\text{.}\) The second row operation yields \(E_2(E_1I)\text{,}\) and the third row operation creates \(E_3E_2E_1I\text{.}\) The result of the full sequence of \(t\) row operations will yield \(A\text{,}\) so
Other than the cosmetic matter of re-indexing these elementary matrices in the opposite order, this is the desired result.
Sage EM. Elementary Matrices.
Each of the three types of elementary matrices can be constructed easily, with syntax similar to methods for performing row operations on matrices. Here we have three \(4\times 4\) elementary matrices, in order: \(\elemswap{1}{3}\text{,}\) \(\elemmult{7}{2}\text{,}\) \(\elemadd{9}{2}{4}\text{.}\) Notice the change in numbering on the rows, and the order of the parameters.
Notice that row1
is always the row that is being changed. The keywords can be removed, but the scale
keyword must be used to create the second type of elementary matrix, to avoid confusion with the first type.
We can illustrate some of the results of this section with two examples. First, we convert a matrix into a second matrix which is row-equivalent, and then accomplish the same thing with matrix multiplication and a product of elementary matrices.
The matrix R
, the product of three elementary matrices, can be construed as the collective effect of the three row operations employed. With more row operations, R
might look even less like an identity matrix. As the product of nonsingular matrices (Theorem EMN), R
is nonsingular (Theorem NPNF).
The matrix B
above is not in reduced row-echelon form (it was just row-equivalent to A
). What if we were to begin with a matrix and track all of the row operations required to bring the matrix to reduced row-echelon form? As above, we could form the associated elementary matrices and form their product, creating a single matrix R
that captures all of the row operations.
It turns out we have already done this. Extended echelon form is the subject of Theorem PEEF, whose second conclusion says that \(B=JA\text{,}\) where \(A\) is the original matrix, and \(B\) is the row-equivalent matrix in reduced row-echelon form. Then \(J\) is a square nonsingular matrix that is the product of the sequence of elementary matrices associated with the sequence of row operations converting \(A\) into \(B\text{.}\) There may be many, many different sequences of row operations that convert \(A\) to \(B\text{,}\) but the requirement that extended echelon form be in reduced row-echelon form guarantees that \(J\) is unique.
Subsection DD Definition of the Determinant
We will now turn to the definition of a determinant and do some sample computations. The definition of the determinant function is recursive, that is, the determinant of a large matrix is defined in terms of the determinant of smaller matrices. To this end, we will make a few definitions.
Definition SM. SubMatrix.
Suppose that \(A\) is an \(m\times n\) matrix. Then the submatrix \(\submatrix{A}{i}{j}\) is the \((m-1)\times (n-1)\) matrix obtained from \(A\) by removing row \(i\) and column \(j\text{.}\)
Example SS. Some submatrices.
For the matrix
we have the submatrices
Definition DM. Determinant of a Matrix.
Suppose \(A\) is a square matrix. Then its determinant, \(\detname{A}=\detbars{A}\text{,}\) is an element of \(\complexes\) defined recursively by:
- If \(A\) is a \(1\times 1\) matrix, then \(\detname{A}=\matrixentry{A}{11}\text{.}\)
- If \(A\) is a matrix of size \(n\) with \(n\geq 2\text{,}\) then\begin{align*} \detname{A}&= \matrixentry{A}{11}\detname{\submatrix{A}{1}{1}} -\matrixentry{A}{12}\detname{\submatrix{A}{1}{2}} +\matrixentry{A}{13}\detname{\submatrix{A}{1}{3}}-\\ &\quad \matrixentry{A}{14}\detname{\submatrix{A}{1}{4}} +\cdots +(-1)^{n+1}\matrixentry{A}{1n}\detname{\submatrix{A}{1}{n}}\text{.} \end{align*}
So to compute the determinant of a \(5\times 5\) matrix we must build 5 submatrices, each of size \(4\text{.}\) To compute the determinants of each the \(4\times 4\) matrices we need to create 4 submatrices each, these now of size \(3\) and so on. To compute the determinant of a \(10\times 10\) matrix would require computing the determinant of \(10!=10\times 9\times 8\times 7\times 6\times 5\times 4\times 3\times 2=3,628,800\) \(1\times 1\) matrices. Fortunately there are better ways. However this does suggest an excellent computer programming exercise to write a recursive procedure to compute a determinant.
Let us compute the determinant of a reasonably sized matrix by hand.
Example D33M. Determinant of a \(3\times 3\) matrix.
Suppose that we have the \(3\times 3\) matrix
Then
In practice it is a bit silly to decompose a \(2\times 2\) matrix down into a couple of \(1\times 1\) matrices and then compute the exceedingly easy determinant of these puny matrices. So here is a simple theorem.
Theorem DMST. Determinant of Matrices of Size Two.
Suppose that \(A=\begin{bmatrix}a&b\\c&d\end{bmatrix}\text{.}\) Then \(\detname{A}=ad-bc\text{.}\)
Proof.
Applying Definition DM,
Do you recall seeing the expression \(ad-bc\) before? (Hint: Theorem TTMI.)
Subsection CD Computing Determinants
There are a variety of ways to compute the determinant. We will establish first that we can choose to mimic our definition of the determinant, but by using matrix entries and submatrices based on a row other than the first one.
Theorem DER. Determinant Expansion about Rows.
Suppose that \(A\) is a square matrix of size \(n\text{.}\) Then for \(1\leq i\leq n\text{,}\)
which is known as expansion about row \(i\text{.}\)
Proof.
First, the statement of the theorem coincides with Definition DM when \(i=1\text{,}\) so throughout, we need only consider \(i\gt 1\text{.}\)
Given the recursive definition of the determinant, it should be no surprise that we will use induction for this proof (Proof Technique I). When \(n=1\text{,}\) there is nothing to prove since there is but one row. When \(n=2\text{,}\) we just examine expansion about the second row,
So the theorem is true for matrices of size \(n=1\) and \(n=2\text{.}\) Now assume the result is true for all matrices of size \(n-1\) as we derive an expression for expansion about row \(i\) for a matrix of size \(n\text{.}\) We will abuse our notation for a submatrix slightly, so \(\submatrix{A}{i_1,i_2}{j_1,j_2}\) will denote the matrix formed by removing rows \(i_1\) and \(i_2\text{,}\) along with removing columns \(j_1\) and \(j_2\text{.}\) Also, as we take a determinant of a submatrix, we will need to “jump up” the index of summation partway through as we “skip over” a missing column. To do this smoothly we will set
Now,
We can also obtain a formula that computes a determinant by expansion about a column, but this will be simpler if we first prove a result about the interplay of determinants and transposes. Notice how the following proof makes use of the ability to compute a determinant by expanding about any row.
Theorem DT. Determinant of the Transpose.
Suppose that \(A\) is a square matrix. Then \(\detname{\transpose{A}}=\detname{A}\text{.}\)
Proof.
With our definition of the determinant (Definition DM) and theorems like Theorem DER, using induction (Proof Technique I) is a natural approach to proving properties of determinants. And so it is here. Let \(n\) be the size of the matrix \(A\text{,}\) and we will use induction on \(n\text{.}\)
For \(n=1\text{,}\) the transpose of a matrix is identical to the original matrix, so vacuously, the determinants are equal.
Now assume the result is true for matrices of size \(n-1\text{.}\) Then,
Now we can easily get the result that a determinant can be computed by expansion about any column as well.
Theorem DEC. Determinant Expansion about Columns.
Suppose that \(A\) is a square matrix of size \(n\text{.}\) Then for \(1\leq j\leq n\)
which is known as expansion about column \(j\text{.}\)
Proof.
We have
That the determinant of an \(n\times n\) matrix can be computed in \(2n\) different (albeit similar) ways is nothing short of remarkable. For the doubters among us, we will do an example, computing a \(4\times 4\) matrix in two different ways.
Example TCSD. Two computations, same determinant.
Let
Then expanding about the fourth row (Theorem DER with \(i=4\)) yields,
Expanding about column 3 (Theorem DEC with \(j=3\)) gives
Notice how much easier the second computation was. By choosing to expand about the third column, we have two entries that are zero, so two \(3\times 3\) determinants need not be computed at all!
When a matrix has all zeros above (or below) the diagonal, exploiting the zeros by expanding about the proper row or column makes computing a determinant insanely easy.
Example DUTM. Determinant of an upper triangular matrix.
Suppose that
We will compute the determinant of this \(5\times 5\) matrix by consistently expanding about the first column for each submatrix that arises and does not have a zero entry multiplying it.
When you consult other texts in your study of determinants, you may run into the terms minor and cofactor, especially in a discussion centered on expansion about rows and columns. We have chosen not to make these definitions formally since we have been able to get along without them. However, informally, a minor is a determinant of a submatrix, specifically \(\detname{\submatrix{A}{i}{j}}\) and is usually referenced as the minor of the matrix entry \(\matrixentry{A}{ij}\text{.}\) A cofactor is a signed minor, specifically the cofactor of the matrix entry \(\matrixentry{A}{ij}\) is \((-1)^{i+j}\detname{\submatrix{A}{i}{j}}\text{.}\)
Sage DM. Determinant of a Matrix.
Computing the determinant in Sage is straightforward.
Random matrices, even with small entries, can have very large determinants.
Sage is incredibly fast at computing determinants with rational entries. Try the following two compute cells on whatever computer you might be using right now. The one unfamilar command clears the value of the determinant that Sage caches, so we get accurate timing information across multiple evaluations.
Reading Questions DM Reading Questions
1.
Construct the elementary matrix that will effect the row operation \(\rowopadd{-6}{2}{3}\) on a \(4\times 7\) matrix.
2.
Compute the determinant of the matrix
3.
Compute the determinant of the matrix
Exercises DM Exercises
C21.
Doing the computations by hand, find the determinant of the matrix below.
Using the formula in Theorem DMST we have
C22.
Doing the computations by hand, find the determinant of the matrix below.
Using the formula in Theorem DMST we have
C23.
Doing the computations by hand, find the determinant of the matrix below.
We can compute the determinant by expanding about any row or column; the most efficient ones to choose are either the second column or the third row. In any case, the determinant will be \(-4\text{.}\)
C24.
Doing the computations by hand, find the determinant of the matrix below.
We will expand about the first row since there are no zeros to exploit,
C25.
Doing the computations by hand, find the determinant of the matrix below.
We can expand about any row or column, so the zero entry in the middle of the last row is attractive. Let us expand about column 2. By Theorem DER and Theorem DEC you will get the same result by expanding about a different row or column. We will use Theorem DMST twice.
C26.
Doing the computations by hand, find the determinant of the matrix \(A\text{.}\)
With two zeros in column 2, we choose to expand about that column (Theorem DEC),
C27.
Doing the computations by hand, find the determinant of the matrix \(A\text{.}\)
Expanding on the first row, we have
C28.
Doing the computations by hand, find the determinant of the matrix \(A\text{.}\)
Expanding along the first row, we have
C29.
Doing the computations by hand, find the determinant of the matrix \(A\text{.}\)
Expanding along the first column, we have
Now, expanding along the first column again, we have
\begin{align*} &= 2\left( \begin{vmatrix} 1 & 2 & 3\\ 2 & 1 & 0\\ 0 & 1 & 2 \end{vmatrix} - 0 + \begin{vmatrix} 1 & 1 & 2\\ 1 & 2 & 3\\ 0 & 1 & 2 \end{vmatrix} - 0 \right)\\ &= 2\left( [1 \cdot 1 \cdot 2 + 2 \cdot 0 \cdot 0 + 3 \cdot 2 \cdot 1 - 0 \cdot 1 \cdot 3 - 1 \cdot 0 \cdot 1 - 2 \cdot 2 \cdot 2] + \right.\\ &\quad\left.[1 \cdot 2 \cdot 2 + 1 \cdot 3 \cdot 0 +2 \cdot 1 \cdot 1 -0 \cdot 2 \cdot 2 - 1 \cdot 3 \cdot 1 - 2 \cdot 1 \cdot 1]\right)\\ &= 2([2 +0 + 6 - 0 - 0 - 8] + [4 + 0 + 2 - 0 - 3 - 2])\\ &= 2\text{.} \end{align*}C30.
Doing the computations by hand, find the determinant of the matrix \(A\text{.}\)
In order to exploit the zeros, let us expand along row 3. We then have
Notice that the second matrix here is singular since two rows are identical and thus it cannot row-reduce to an identity matrix. We now have
\begin{align*} &= \begin{vmatrix} 2 & 1 & 0 & 1 \\ 2 & 1 & -1 & 1\\ 1 & 0 & 1 & 1\\ 2 & 1 & 2 & 1 \end{vmatrix} + 0\\ \end{align*}and now we expand on the first row of the first matrix:
\begin{align*} &= 2 \begin{vmatrix} 1 & -1 & 1\\ 0 & 1 & 1\\ 1 & 2 & 1 \end{vmatrix} - \begin{vmatrix} 2 & -1 & 1\\ 1 & 1 & 1\\ 2 & 2 & 1 \end{vmatrix} + 0 - \begin{vmatrix} 2 & 1 & -1 \\ 1 & 0 & 1\\ 2 & 1 & 2 \end{vmatrix}\\ &= 2(-3) - (-3) - (-3) = 0\text{.} \end{align*}M10.
Find a value of \(k\) so that the matrix
has \(\det(A) = 0\text{,}\) or explain why it is not possible.
There is only one value of \(k\) that will make this matrix have a zero determinant.
so \(\detname{A} = 0\) only when \(k = 6\text{.}\)
M11.
Find a value of \(k\) so that the matrix
has \(\det(A) = 0\text{,}\) or explain why it is not possible.
We find
Thus, \(\detname{A} = 0\) only when \(k = \frac{7}{4}\text{.}\)
M15.
Given the matrix
find all values of \(x\) that are solutions of \(\det(B) = 0\text{.}\)
Using the formula for the determinant of a \(2\times 2\) matrix given in Theorem DMST, we have
and thus \(\det{(B)} = 0\) only when \(x=0\) or \(x=4\text{.}\)
M16.
Given the matrix
find all values of \(x\) that are solutions of \(\det(B) = 0\text{.}\)
We find
And thus, \(\detname{B}=0\) when \(x = 0\text{,}\) \(x = 2\text{,}\) or \(x = -4\text{.}\)
M30.
The two matrices below are row-equivalent. How would you confirm this? Since the matrices are row-equivalent, there is a sequence of row operations that converts \(X\) into \(Y\text{,}\) which would be a product of elementary matrices, \(M\text{,}\) such that \(MX=Y\text{.}\) Find \(M\text{.}\) (This approach could be used to find the “9 scalars” of the very early Exercise RREF.M40.)
Hint: Compute the extended echelon form for both matrices, and then use the property from Theorem PEEF that reads \(B=JA\text{,}\) where \(A\) is the original matrix, \(B\) is the echelon form of the matrix and \(J\) is a nonsingular matrix obtained from extended echelon form. Combine the two square matrices in the right way to obtain \(M\text{.}\)