Skip to main content

MATH 345: Linear Algebra and Optimization

Section 2.5 Inverses and determinants

Subsection Matrix invertibility and linear systems

In this section we finish the square-matrix version of the Unit 2 story. A square matrix is invertible exactly when it β€œdoes not forget any nonzero input direction” and β€œevery output is reached once”. The inverse matrix gives the inverse map when it exists. The determinant, a fundamental quantity in linear algebra that we only briefly discuss in this course, gives a single-number test for invertibility.

Definition 2.5.1. Invertibility of Matrices.

An \(n \times n\) matrix \(A\) is called nonsingular, or invertible, if there exists an \(n \times n\) matrix \(B\) such that \(AB = BA = I_n\text{.}\) Such a \(B\) is called the inverse of \(A\text{.}\) If no such \(B\) exists, \(A\) is called singular or noninvertible.

Note 2.5.2.

The inverse of a matrix mimics the reciprocal of a real number.

Activity 2.5.1.

Let
\begin{equation*} A = \begin{bmatrix} 1 & 3 \\ 1 & 4 \end{bmatrix} \quad\text{and}\quad B = \begin{bmatrix} 4 & -3 \\ -1 & 1 \end{bmatrix}\text{.} \end{equation*}
Compute both \(AB\) and \(BA\text{,}\) and make a conclusion using the language of inverses.
Solution.
\begin{equation*} AB = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} = I_2 \quad\text{and}\quad BA = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} = I_2 \end{equation*}
Therefore, \(B\) is the inverse of \(A\text{.}\)

Activity 2.5.2.

Does \(A = \begin{bmatrix} 2 & 1 \\ 0 & 0 \end{bmatrix}\) have an inverse?
Solution.
Let’s suppose \(A\) had an inverse \(B = \begin{bmatrix} x & y \\ z & w \end{bmatrix}\text{.}\) Then:
\begin{align*} AB &= I_2\\ \begin{bmatrix} 2 & 1 \\ 0 & 0 \end{bmatrix}\begin{bmatrix} x & y \\ z & w \end{bmatrix} &= \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \end{align*}
This gives us the system of linear equations in four unknowns:
\begin{equation*} \begin{array}{ccccccccc} 2x \amp \amp \amp + \amp z \amp \amp \amp = \amp 1\\ \amp \amp 2y \amp \amp \amp + \amp w \amp = \amp 0\\ 0x \amp \amp \amp + \amp 0z \amp \amp \amp = \amp 0\\ \amp \amp 0y \amp \amp \amp + \amp 0w \amp = \amp 1 \end{array} \end{equation*}
The last equation states that \(0 = 1\text{,}\) which is impossible.
Therefore, \(A\) cannot have an inverse. This means \(A\) is singular.

Why is this true?.

It suffices to calculate that \((AB)(B^{-1}A^{-1}) = I_n\) and \((B^{-1}A^{-1})(AB) = I_n\text{.}\) Firstly,
\begin{equation*} (AB)(B^{-1}A^{-1}) = A(BB^{-1})A^{-1} = A I_n A^{-1} = AA^{-1} = I_n\text{.} \end{equation*}
Similarly,
\begin{equation*} (B^{-1}A^{-1})(AB) = B^{-1}(A^{-1}A)B = B^{-1} I_n B = B^{-1}B = I_n\text{.} \end{equation*}
Let \(T=T_A:\R^n\to\R^n\) be a matrix transformation induced by the \(n \times n\) matrix \(A\text{.}\) What does invertibility imply about the geometry of the transformation \(T_A\text{?}\)
Consider \(T'=T_{A^{-1}}\text{.}\) What happens when we compose them?

Activity 2.5.3.

Compute the composition of \(T\) and \(T'\) in both orders.
Solution.
Let’s examine the composition of \(T\) and \(T'\text{:}\)
\begin{align*} T \circ T'(\mathbf{x}) &= T_A(T_{A^{-1}}(\mathbf{x}))\\ &= T_A(A^{-1}\mathbf{x})\\ &= A(A^{-1}\mathbf{x})\\ &= (AA^{-1})\mathbf{x}\\ &= I_n\mathbf{x}\\ &= \mathbf{x} \end{align*}
Similarly, for the reverse composition:
\begin{align*} T' \circ T(\mathbf{x}) &= T_{A^{-1}}(T_A(\mathbf{x}))\\ &= T_{A^{-1}}(A\mathbf{x})\\ &= A^{-1}(A\mathbf{x})\\ &= (A^{-1}A)\mathbf{x}\\ &= I_n\mathbf{x}\\ &= \mathbf{x} \end{align*}

Definition 2.5.7.

Given a matrix transformation \(T:\R^n\to\R^n\text{,}\) if there exists a transformation \(S:\R^n\to\R^n\) such that \(S(T(\mathbf{x}))=T(S(\mathbf{x}))=\mathbf{x}\) for all \(\mathbf{x}\in \R^n\text{,}\) we say that \(T\) has an inverse.

Activity 2.5.4.

Consider \(T:\R^2\to\R^2\) given by reflection across the \(x\)-axis. Find the matrix representing this transformation, and find the inverse.
Solution.
\(T\) is given by matrix \(A = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}\)
Since \(A^2 = I_2\text{,}\) \(A\) is its own inverse, so \(T^{-1} = T\text{.}\)
For now, \(\det(A)=ad-bc\) is only the determinant of a \(2 \times 2\) matrix. We will define determinants for larger square matrices later in this section.

Activity 2.5.5. Reading determinant checks in code.

The following code computes determinants of two \(2\times 2\) matrices.
import numpy as np

A = np.array([
    [1., 1.],
    [0., 1.],
])

B = np.array([
    [1., 0.],
    [0., 0.],
])

detA = float(np.linalg.det(A))
detB = float(np.linalg.det(B))

detA, detB
Output:
(1.0, 0.0)
  1. Which matrix is invertible?
  2. Which matrix forgets a nonzero input direction?
  3. How does the determinant tell you?
Solution.
The output says
\begin{equation*} \det(A)=1, \qquad \det(B)=0. \end{equation*}
Matrix \(A\) is invertible because its determinant is nonzero. Matrix \(B\) is singular because its determinant is zero.
The matrix \(B\) forgets the nonzero input direction
\begin{equation*} \begin{bmatrix} 0\\ 1 \end{bmatrix}, \end{equation*}
since
\begin{equation*} B \begin{bmatrix} 0\\ 1 \end{bmatrix} = \begin{bmatrix} 0\\ 0 \end{bmatrix}. \end{equation*}
For a \(2\times 2\) matrix, a nonzero determinant means the matrix is invertible. A zero determinant means the matrix is singular and forgets some nonzero input direction.

Activity 2.5.6.

Find the inverse of each matrix, if possible.
(a)
\begin{equation*} A=\begin{bmatrix} -2 & -3 \\ 4 & 6 \end{bmatrix} \end{equation*}
Solution.
\begin{equation*} \det(A) = (-2)(6) - (-3)(4) = -12 - (-12) = 0\text{,} \end{equation*}
so \(A\) is not invertible.
(b)
\begin{equation*} B = \begin{bmatrix} 1 & 6 \\ 2 & 3 \end{bmatrix} \end{equation*}
Solution.
\begin{equation*} \det(B) = (1)(3) - (6)(2) = 3 - 12 = -9 \neq 0\text{,} \end{equation*}
so
\begin{equation*} B^{-1} = \frac{1}{-9}\begin{bmatrix} 3 & -6 \\ -2 & 1 \end{bmatrix} = \begin{bmatrix} -1/3 & 2/3 \\ 2/9 & -1/9 \end{bmatrix}\text{.} \end{equation*}
If \(A\) is an \(n \times n\) matrix, then the linear system \(A\mathbf{x} = \mathbf{b}\) is a system of \(n\) equations in \(n\) unknowns. Suppose \(A\) is nonsingular. How can we use \(A^{-1}\) to solve the system \(A\mathbf{x} = \mathbf{b}\text{?}\)

Activity 2.5.7.

Solve the system using the inverse of \(A\text{.}\)
Solution.
Multiply both sides of \(A\mathbf{x} = \mathbf{b}\) by \(A^{-1}\) on the left:
\begin{align*} A\mathbf{x} &= \mathbf{b}\\ A^{-1}(A\mathbf{x}) &= A^{-1}\mathbf{b}\\ (A^{-1}A)\mathbf{x} &= A^{-1}\mathbf{b}\\ I_n\mathbf{x} &= A^{-1}\mathbf{b}\\ \mathbf{x} &= A^{-1}\mathbf{b} \end{align*}
Therefore, when \(A\) is nonsingular, \(\mathbf{x} = A^{-1}\mathbf{b}\) is the solution to \(A\mathbf{x} = \mathbf{b}\text{.}\)
Consequences:
  • When \(A^{-1}\) exists, then \(A\mathbf{x} = \mathbf{b}\) has a unique solution.
  • If \(A\) is invertible/nonsingular, then the only solution to the homogeneous system \(A\mathbf{x} = \mathbf{0}\) is \(\mathbf{x} = \mathbf{0}\text{.}\)
  • Put differently, an invertible square matrix forgets no nonzero input direction.

Activity 2.5.8.

Suppose that
\begin{equation*} A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}, \quad A^{-1} = \begin{bmatrix} -2 & 1 \\ \frac{3}{2} & -\frac{1}{2} \end{bmatrix}, \quad \mathbf{b} = \begin{bmatrix} 4 \\ 2 \end{bmatrix}, \quad \mathbf{c} = \begin{bmatrix} 3 \\ 2 \end{bmatrix}\text{.} \end{equation*}
Use this information to calculate the following:
(a)
\(A\mathbf{x} = \mathbf{b}\)
Solution.
\begin{equation*} \mathbf{x} = A^{-1}\mathbf{b} = \begin{bmatrix} -6 \\ 5 \end{bmatrix} \end{equation*}
(b)
\(A\mathbf{x} = \mathbf{c}\)
Solution.
\begin{equation*} \mathbf{x} = A^{-1}\mathbf{c} = \begin{bmatrix} -4 \\ \frac{7}{2} \end{bmatrix} \end{equation*}
(c)
\(A\mathbf{x} = \mathbf{0}\)
Solution.
\begin{equation*} \mathbf{x} = A^{-1}\mathbf{0} = \begin{bmatrix} 0 \\ 0 \end{bmatrix} \end{equation*}

Activity 2.5.9.

Consider the transformation \(P:\R^2\to\R^2\) defined by
\begin{equation*} P\left(\begin{bmatrix} a_1 \\ a_2\end{bmatrix}\right)=\begin{bmatrix} a_1 \\ 0\end{bmatrix}\text{.} \end{equation*}
(a)
Is \(P\) a matrix transformation? If so, find the matrix \(A\) corresponding to \(P\text{.}\)
Solution.
Yes, \(P\) is a matrix transformation. It can be represented by the matrix
\begin{equation*} A = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix} \end{equation*}
To verify:
\begin{equation*} P\left(\begin{bmatrix} a_1 \\ a_2\end{bmatrix}\right) = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}\begin{bmatrix} a_1 \\ a_2\end{bmatrix} = \begin{bmatrix} a_1 \\ 0\end{bmatrix} \end{equation*}
(b)
Is \(P\) an invertible transformation?
Solution.
No, \(P\) is not invertible. Note that \(\det(A) = 0\text{,}\) and so \(A\) is not an invertible matrix, and so \(P\) cannot be an invertible transformation.

Subsubsection Calculating inverses

Consider vectors \(\mathbf{c}_1, \dots, \mathbf{c}_n\) in \(\R^m\text{,}\) and let \(A\) be the \(m \times n\) matrix whose columns are the vectors \(\mathbf{c}_1, \dots, \mathbf{c}_n\text{.}\)
Note that \(\{ \mathbf{c}_1, \dots, \mathbf{c}_n \}\) are linearly independent precisely when the equation \(A \mathbf{x} = \mathbf{0}\) has only the trivial solution.
Note that additionally, \(\spans \{ \mathbf{c}_1, \dots, \mathbf{c}_n \} = \R^m\) exactly when \(A \mathbf{x} = \mathbf{b}\) has a solution for all \(\mathbf{b}\) in \(\R^m\text{.}\)
We use these facts to extend our invertibility criteria for matrices.
Activity 2.5.10.
Let \(S = \{ \mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3 \}\text{,}\) where
\begin{equation*} \mathbf{v}_1 = \begin{bmatrix} 1 \\ 2 \\ 2 \end{bmatrix} \quad \mathbf{v}_2 = \begin{bmatrix} 0 \\ -1 \\ 2 \end{bmatrix} \quad \mathbf{v}_3 = \begin{bmatrix} 3 \\ 0 \\ -5 \end{bmatrix}\text{.} \end{equation*}
Is \(S\) linearly dependent?
Solution.
Put the vectors in the columns of a matrix:
\begin{equation*} A = \begin{bmatrix} 1 \amp 0 \amp 3 \\ 2 \amp -1 \amp 0 \\ 2 \amp 2 \amp -5 \end{bmatrix} \end{equation*}
Row reduction gives
\begin{align*} \begin{bmatrix} 1 \amp 0 \amp 3 \\ 2 \amp -1 \amp 0 \\ 2 \amp 2 \amp -5 \end{bmatrix} \amp \sim \begin{bmatrix} 1 \amp 0 \amp 3 \\ 0 \amp -1 \amp -6 \\ 0 \amp 2 \amp -11 \end{bmatrix}\\ \amp \sim \begin{bmatrix} 1 \amp 0 \amp 3 \\ 0 \amp -1 \amp -6 \\ 0 \amp 0 \amp -23 \end{bmatrix}\text{.} \end{align*}
This echelon form has a pivot in every column. Therefore the equation \(Ac=0\) has only the trivial solution, so no nontrivial linear combination of \(\mathbf{v}_1,\mathbf{v}_2,\mathbf{v}_3\) gives zero. Thus \(S\) is linearly independent, not linearly dependent.
For a given \(n \times n\) matrix \(A\text{,}\) if we are looking for an inverse for \(A\) (call this matrix \(X\)), we must have \(AX = I_n\text{.}\) We are solving \(n\) linear systems simultaneously:

Activity 2.5.11.

Describe the system of linear equations for finding the inverse.
Solution.
We need to solve these systems:
\begin{equation*} A\begin{bmatrix} x_{11} \\ x_{21} \\ \vdots \\ x_{n1} \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \\ \vdots \\ 0 \end{bmatrix}, \quad A\begin{bmatrix} x_{12} \\ x_{22} \\ \vdots \\ x_{n2} \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \\ \vdots \\ 0 \end{bmatrix}, \quad \cdots, \quad A\begin{bmatrix} x_{1n} \\ x_{2n} \\ \vdots \\ x_{nn} \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ \vdots \\ 1 \end{bmatrix} \end{equation*}
Since, to solve each system, we wish to reduce the matrix \(A\) down to its RREF each time, we can combine all the systems into one big augmented matrix:

Activity 2.5.12.

Write the augmented matrix for finding the inverse.
Solution.
\begin{equation*} [A \mid I_n] = \left[\begin{array}{cccc|cccc} a_{11} & a_{12} & \cdots & a_{1n} & 1 & 0 & \cdots & 0 \\ a_{21} & a_{22} & \cdots & a_{2n} & 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots & \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} & 0 & 0 & \cdots & 1 \end{array}\right] \end{equation*}
It follows from TheoremΒ 2.2.18 that if \([A \mid I_n]\) is row reducible to \([ B \mid C ]\text{,}\) then \(BX = C\text{.}\) In particular, if we can row reduce \([A \mid I_n]\) to \([I_n \mid C]\text{,}\) then it follows that \(X = C\text{.}\) Gaussian elimination (AlgorithmΒ 2.2.24) will reduce a given matrix to this form, provided that an inverse exists.

Activity 2.5.13.

Find \(A^{-1}\) where \(A = \begin{bmatrix} 1 & 1 & 4 \\ 2 & 3 & 2 \\ 0 & 0 & 1 \end{bmatrix}\text{.}\)
Solution.
Start with \([A \mid I_3]\text{:}\)
\begin{equation*} [A \mid I_3] = \left[\begin{array}{ccc|ccc} 1 & 1 & 4 & 1 & 0 & 0 \\ 2 & 3 & 2 & 0 & 1 & 0 \\ 0 & 0 & 1 & 0 & 0 & 1 \end{array}\right] \end{equation*}
Perform row operations:
\begin{equation*} R_2 \to R_2 - 2R_1 \end{equation*}
\begin{equation*} \left[\begin{array}{ccc|ccc} 1 & 1 & 4 & 1 & 0 & 0 \\ 0 & 1 & -6 & -2 & 1 & 0 \\ 0 & 0 & 1 & 0 & 0 & 1 \end{array}\right] \end{equation*}
\begin{equation*} R_1 \to R_1 - R_2 \end{equation*}
\begin{equation*} \left[\begin{array}{ccc|ccc} 1 & 0 & 10 & 3 & -1 & 0 \\ 0 & 1 & -6 & -2 & 1 & 0 \\ 0 & 0 & 1 & 0 & 0 & 1 \end{array}\right] \end{equation*}
\begin{gather*} R_1 \to R_1 - 10R_3\\ R_2 \to R_2 + 6R_3 \end{gather*}
\begin{equation*} \left[\begin{array}{ccc|ccc} 1 & 0 & 0 & 3 & -1 & -10 \\ 0 & 1 & 0 & -2 & 1 & 6 \\ 0 & 0 & 1 & 0 & 0 & 1 \end{array}\right] \end{equation*}
Therefore:
\begin{equation*} A^{-1} = \begin{bmatrix} 3 & -1 & -10 \\ -2 & 1 & 6 \\ 0 & 0 & 1 \end{bmatrix} \end{equation*}

Subsection General determinants

In this section we consider square \(n \times n\) matrices. Our goal is to find a number, called the determinant that we can calculate for any matrix, which tells us whether or not the matrix is invertible.
Let’s start with the \(2 \times 2\) case. Recall that in TheoremΒ 2.5.9 we defined the determinant of a \(2 \times 2\) matrix
\begin{equation*} A = \begin{bmatrix} a \amp b \\ c \amp d \end{bmatrix} \end{equation*}
to be \(\det(A) = ad - bc\text{.}\) It has the required properties of the determinant that we will now define for more general matrices.

Activity 2.5.14.

Find the determinant of the following matrices:
(a)
\begin{equation*} A = \begin{bmatrix} 3 \amp 1 \\ 4 \amp 2 \end{bmatrix} \end{equation*}
Solution.
\begin{equation*} \det(A) = 3(2) - 1(4) = 6 - 4 = 2\text{.} \end{equation*}
(b)
\begin{equation*} B = \begin{bmatrix} 3 \amp 2 \\ 6 \amp 4 \end{bmatrix} \end{equation*}
Solution.
\begin{equation*} \det(B) = 3(4) - 2(6) = 12 - 12 = 0\text{.} \end{equation*}
We use the \(2 \times 2\) determinant to define the \(3 \times 3\) determinant. The idea is recursive: a \(3 \times 3\) determinant is built from \(2 \times 2\) determinants. Later, an \(n \times n\) determinant will be built from \((n-1)\times(n-1)\) determinants.

Definition 2.5.13. Minors of a \(3 \times 3\) matrix.

Let \(A\) be a \(3 \times 3\) matrix. The \((i,j)\)-th minor of \(A\text{,}\) denoted
\begin{equation*} \operatorname{minor}(A)_{ij}, \end{equation*}
is the determinant of the \(2 \times 2\) matrix obtained from \(A\) by deleting row \(i\) and column \(j\text{.}\)

Activity 2.5.15.

Suppose
\begin{equation*} A = \begin{bmatrix} 1 \amp 2 \amp 3 \\ 4 \amp 3 \amp 2 \\ 3 \amp 2 \amp 1\ \end{bmatrix}\text{.} \end{equation*}
(a)
Calculate \(\operatorname{minor}(A)_{11}\text{.}\)
Solution.
\begin{equation*} \operatorname{minor}(A)_{11} = \det \begin{bmatrix} 3 \amp 2 \\ 2 \amp 1 \end{bmatrix} = 3(1) - 2(2) = -1\text{.} \end{equation*}
(b)
Calculate \(\operatorname{minor}(A)_{23}\text{.}\)
Solution.
\begin{equation*} \operatorname{minor}(A)_{23} = \det \begin{bmatrix} 1 \amp 2 \\ 3 \amp 2 \end{bmatrix} = 1(2) - 2(3) = -4\text{.} \end{equation*}

Definition 2.5.14. Cofactors of a \(3 \times 3\) matrix.

Let \(A\) be a \(3 \times 3\) matrix. The \((i,j)\)-cofactor of \(A\text{,}\) denoted
\begin{equation*} \operatorname{cof}(A)_{ij}, \end{equation*}
\begin{equation*} \operatorname{cof}(A)_{ij} = (-1)^{i+j}\operatorname{minor}(A)_{ij}. \end{equation*}

Activity 2.5.16.

Define
\begin{equation*} A = \begin{bmatrix} 1 \amp 2 \amp 3 \\ 4 \amp 3 \amp 2 \\ 3 \amp 2 \amp 1 \end{bmatrix} \end{equation*}
(a)
Compute \(\operatorname{cof}(A)_{11}\text{.}\)
Solution.
\begin{equation*} \operatorname{cof}(A)_{11} = (-1)^{1 + 1} \operatorname{minor}(A)_{11} = (1)(-1) = -1\text{.} \end{equation*}
(b)
Compute \(\operatorname{cof}(A)_{23}\text{.}\)
Solution.
\begin{equation*} \operatorname{cof}(A)_{23} = (-1)^{2+3} \operatorname{minor}(A)_{23} = (-1)(-4) = 4\text{.} \end{equation*}

Definition 2.5.15. Determinant of a \(3 \times 3\) matrix.

Let \(A=[a_{ij}]\) be a \(3 \times 3\) matrix. The determinant of \(A\text{,}\) denoted \(\det(A)\text{,}\) is defined by expansion along the first row:
\begin{equation*} \det(A) = a_{11}\operatorname{cof}(A)_{11} + a_{12}\operatorname{cof}(A)_{12} + a_{13}\operatorname{cof}(A)_{13}. \end{equation*}
This process is called cofactor expansion.

Activity 2.5.17.

Let
\begin{equation*} A = \begin{bmatrix} 1 \amp 2 \amp 3 \\ 4 \amp 3 \amp 2 \\ 3 \amp 2 \amp 1 \end{bmatrix}\text{.} \end{equation*}
(a)
Find the determinant of \(A\) by expanding along row \(1\text{.}\)
Solution.
To calculate the determinant of \(A\) by expanding along row \(1\text{,}\) we write
\begin{equation*} \det(A) = 1\operatorname{cof}(A)_{11} + 2\operatorname{cof}(A)_{12} + 3\operatorname{cof}(A)_{13}\text{.} \end{equation*}
We begin by calculating the cofactors:
\begin{equation*} \operatorname{cof}(A)_{11} = (-1)^{1+1}\det\begin{bmatrix} 3 \amp 2 \\ 2 \amp 1 \end{bmatrix} = (1)(3\cdot 1 - 2\cdot 2) = -1 \end{equation*}
\begin{equation*} \operatorname{cof}(A)_{12} = (-1)^{1+2}\det\begin{bmatrix} 4 \amp 2 \\ 3 \amp 1 \end{bmatrix} = (-1)(4\cdot 1 - 2\cdot 3) = 2 \end{equation*}
\begin{equation*} \operatorname{cof}(A)_{13} = (-1)^{1+3}\det\begin{bmatrix} 4 \amp 3 \\ 3 \amp 2 \end{bmatrix} = (1)(8 - 9) = -1 \end{equation*}
Therefore
\begin{equation*} \det(A) = 1(-1) + 2(2) + 3(-1) = -1 + 4 - 3 = 0\text{.} \end{equation*}
(b)
Find the determinant of \(A\) by expanding along column \(2\text{.}\)
Solution.
To calculate the determinant of \(A\) by expanding along column \(2\text{,}\) we write
\begin{equation*} \det(A) = 2\operatorname{cof}(A)_{12} + 3\operatorname{cof}(A)_{22} + 2\operatorname{cof}(A)_{32} \end{equation*}
We calculate the cofactors:
\begin{equation*} \operatorname{cof}(A)_{12} = (-1)^{1+2}\det\begin{bmatrix} 4 \amp 2 \\ 3 \amp 1 \end{bmatrix} = (-1)(4\cdot 1 - 2\cdot 3) = 2 \end{equation*}
\begin{equation*} \operatorname{cof}(A)_{22} = (-1)^{2+2}\det\begin{bmatrix} 1 \amp 3 \\ 3 \amp 1 \end{bmatrix} = (1)(1\cdot 1 - 3\cdot 3) = -8 \end{equation*}
\begin{equation*} \operatorname{cof}(A)_{32} = (-1)^{3+2}\det\begin{bmatrix} 1 \amp 3 \\ 4 \amp 2 \end{bmatrix} = (-1)(2 - 12) = 10\text{.} \end{equation*}
Therefore
\begin{equation*} \det(A) = 2(2) + 3(-8) + 2(10) = 4 - 24 + 20 = 0\text{.} \end{equation*}

Note 2.5.17.

To track the sign \((-1)^{i+j}\) when computing cofactors, it may be helpful to view the matrix as a checkerboard as below:
\begin{equation*} \begin{bmatrix} + \amp - \amp + \\ - \amp + \amp - \\ + \amp - \amp + \end{bmatrix} \end{equation*}
The sign in the \(i\)th row and \(j\)th position with be the sign of \((-1)^{i+j}\text{.}\)

Note 2.5.18.

Since any row or column gives the same determinant, choose a row or column with many zeros when possible.

Activity 2.5.18.

Compute the determinant of the following matrices:
(a)
\begin{equation*} A = \begin{bmatrix} 3 \amp-5 \amp 1\\ 0 \amp 1 \amp 0 \\ -2 \amp -4 \amp 7\end{bmatrix} \end{equation*}
Solution.
The second row of \(A\) has two zeros, and so expanding along this row will likely result in the simplest computation of the determinant. We write
\begin{align*} \det(A) \amp= 0\cdot\text{cof}(A)_{21} + 1\cdot\text{cof}(A)_{22} + 0\cdot\text{cof}(A)_{23}\\ \amp = \text{cof}(A)_{22}\\ \amp = (-1)^{2+2} \det \begin{bmatrix} 3 \amp 1\\ -2 \amp 7\end{bmatrix}\\ \amp = (1)(3 \cdot 7 - 1 \cdot (-2))\\ \amp = 21 + 2 = 23\text{.} \end{align*}
(b)
\begin{equation*} B = \begin{bmatrix} 0 \amp \pi \amp 200\\ 0 \amp 0.03 \amp 4 \\ 0 \amp 19 \amp -3584\end{bmatrix} \end{equation*}
Solution.
If we expand the determinant of \(B\) along its first column, we find that
\begin{equation*} \det(B) = 0\cdot\operatorname{cof}(B)_{11} + 0\cdot\operatorname{cof}(B)_{21} + 0\cdot\operatorname{cof}(B)_{31} = 0\text{.} \end{equation*}

Note 2.5.19.

Whenever a row or column of a matrix only has zeros as entries, expanding along that row shows that the determinant of the matrix is always zero, so no cofactor computations are required.
Now that \(3 \times 3\) determinants have been defined, we can define larger determinants recursively. For a \(4 \times 4\) matrix, each minor determinant is a \(3 \times 3\) determinant. For a \(5 \times 5\) matrix, each minor determinant is a \(4 \times 4\) determinant, and so on.

Definition 2.5.20. Determinant of a general square matrix.

Let \(A=[a_{ij}]\) be an \(n\times n\) matrix with \(n\ge 4\text{.}\) Assume determinants have already been defined for \((n-1)\times(n-1)\) matrices.
The \((i,j)\)-th minor of \(A\text{,}\) denoted
\begin{equation*} \operatorname{minor}(A)_{ij}, \end{equation*}
is the determinant of the \((n-1)\times(n-1)\) matrix obtained from \(A\) by deleting row \(i\) and column \(j\text{.}\)
The \((i,j)\)-cofactor of \(A\) is
\begin{equation*} \operatorname{cof}(A)_{ij} = (-1)^{i+j}\operatorname{minor}(A)_{ij}. \end{equation*}
The determinant of \(A\) is defined by expansion along the first row:
\begin{equation*} \det(A) = \sum_{j=1}^{n} a_{1j}\operatorname{cof}(A)_{1j}. \end{equation*}

Activity 2.5.19.

Calculate the determinant of the matrix
\begin{equation*} A = \begin{bmatrix} 1 \amp 2 \amp 3 \amp 4 \\ 5 \amp 4 \amp 2 \amp 3\\ 1 \amp 3 \amp 4 \amp 5 \\ 3 \amp 4 \amp 3 \amp 2\end{bmatrix} \end{equation*}
Solution.
Expand along column \(3\text{:}\)
\begin{equation*} \det(A) = 3\operatorname{cof}(A)_{13} + 2\operatorname{cof}(A)_{23} + 4\operatorname{cof}(A)_{33} + 3\operatorname{cof}(A)_{43}. \end{equation*}
The signs in column \(3\) are
\begin{equation*} +,\ -,\ +,\ -. \end{equation*}
\begin{align*} \det(A) \amp= 3\det \begin{bmatrix} 5\amp 4\amp 3\\ 1\amp 3\amp 5\\ 3\amp 4\amp 2 \end{bmatrix}\\ \amp\quad - 2\det \begin{bmatrix} 1\amp 2\amp 4\\ 1\amp 3\amp 5\\ 3\amp 4\amp 2 \end{bmatrix}\\ \amp\quad + 4\det \begin{bmatrix} 1\amp 2\amp 4\\ 5\amp 4\amp 3\\ 3\amp 4\amp 2 \end{bmatrix}\\ \amp\quad - 3\det \begin{bmatrix} 1\amp 2\amp 4\\ 5\amp 4\amp 3\\ 1\amp 3\amp 5 \end{bmatrix}. \end{align*}
Using the \(3\times 3\) determinant method,
\begin{equation*} \det \begin{bmatrix} 5\amp 4\amp 3\\ 1\amp 3\amp 5\\ 3\amp 4\amp 2 \end{bmatrix} = -33, \end{equation*}
\begin{equation*} \det \begin{bmatrix} 1\amp 2\amp 4\\ 1\amp 3\amp 5\\ 3\amp 4\amp 2 \end{bmatrix} = -8, \end{equation*}
\begin{equation*} \det \begin{bmatrix} 1\amp 2\amp 4\\ 5\amp 4\amp 3\\ 3\amp 4\amp 2 \end{bmatrix} = 26, \end{equation*}
\begin{equation*} \det \begin{bmatrix} 1\amp 2\amp 4\\ 5\amp 4\amp 3\\ 1\amp 3\amp 5 \end{bmatrix} = 11. \end{equation*}
Therefore
\begin{align*} \det(A) \amp= 3(-33)-2(-8)+4(26)-3(11)\\ \amp= -99+16+104-33\\ \amp= -12. \end{align*}

Activity 2.5.20.

Compute \(\det(A)\text{,}\) where
\begin{equation*} A = \begin{bmatrix} 3 \amp 2 \amp 3 \amp 4 \\ 0 \amp 4 \amp 2 \amp 3\\ 0 \amp 0 \amp 2 \amp 5 \\ 0 \amp 0 \amp 0 \amp -1\end{bmatrix}\text{.} \end{equation*}
Solution.
Expanding in cofactors along column \(1\) (because most of the entries of that column are zeros), we find
\begin{align*} \det(A) \amp = 3 \cdot \text{cof}(A)_{11} + 0 \cdot \text{cof}(A)_{21} + 0 \cdot \text{cof}(A)_{31} + 0 \cdot \text{cof}(A)_{41}\\ \amp = 3 (-1)^{1+1} \det \begin{bmatrix} 4 \amp 2 \amp 3 \\ 0 \amp 2 \amp 5 \\ 0 \amp 0 \amp -1 \end{bmatrix} = 3 \det \begin{bmatrix} 4 \amp 2 \amp 3 \\ 0 \amp 2 \amp 5 \\ 0 \amp 0 \amp -1 \end{bmatrix} \end{align*}
Expanding along the first column again, we find that
\begin{align*} \det \begin{bmatrix} 4 \amp 2 \amp 3 \\ 0 \amp 2 \amp 5 \\ 0 \amp 0 \amp -1 \end{bmatrix} \amp = 4 \det \begin{bmatrix} 2 \amp 5 \\ 0 \amp -1 \end{bmatrix}\\ \amp = 4 ((2)(-1) - (5)(0)) = -8\text{.} \end{align*}
So \(\det(A) = (3)(-8) = -24 \text{.}\)

Definition 2.5.22. Triangular and Diagonal Matrices.

An \(n \times n\) matrix \(A = [ a_{ij} ]\) is called upper triangular if \(a_{ij} = 0\) for \(i > j\text{,}\) and lower triangular if \(a_{ij} = 0\) for \(i \lt j\text{.}\) A matrix is diagonal if it is both upper triangular and lower triangular, i.e., if \(a_{ij} = 0\) for \(i \neq j\text{.}\) We denote the \(n \times n\) diagonal matrix with entries \(\lambda_1,\dots, \lambda_n\) on the diagonal by \(\text{diag}(\lambda_1,\dots,\lambda_n)\text{.}\)

Why is this true?.

Why is this true?.

Why is this true?.

Let \(B\) be the matrix obtained by swapping the two identical rows / columns of \(A\text{.}\) Then \(A = B\text{,}\) and TheoremΒ 2.5.25 implies that \(\det(A) = - \det(B) = - \det(A)\text{.}\) Therefore \(2 \det(A) = 0\text{,}\) and thus that \(\det(A) = 0\text{.}\)

Why is this true?.

Suppose that \(B\) is obtained from \(A\) by multiplying each entry of row \(i\) by \(k\text{.}\) Consider a cofactor expansion along row \(i\) of \(B\text{.}\) Then
\begin{align*} \det(B) \amp = k a_{i1} \text{cof}(B)_{i1} + k a_{i2} \text{cof}(B)_{i2} + \cdots + k a_{in} \text{cof}(B)_{in}\\ \amp = k [ a_{i1} \text{cof}(A)_{i1} + \cdots + a_{in} \text{cof}(A)_{in} ]\\ \amp = k \text{det}(A)\text{.} \end{align*}
We can check TheoremΒ 2.5.29 in the \(2 \times 2\) case. If
\begin{equation*} A = \begin{bmatrix} a \amp b \\ c \amp d \end{bmatrix} \end{equation*}
and
\begin{equation*} B = \begin{bmatrix} a \amp b \\ c + ka \amp d + kb \end{bmatrix}\text{,} \end{equation*}
then
\begin{equation*} \det(A) = ad - bc \end{equation*}
and
\begin{align*} \det(B) \amp = a(d + kb) - b(c + ka)\\ \amp= ad + kab - bc - kab\\ \amp = ad - bc = \det(A)\text{.} \end{align*}

Activity 2.5.22.

Suppose a matrix \(B\) is obtained from a matrix \(A\) by applying the following row operations:
  • \(\displaystyle R_i \leftrightarrow R_j\)
  • \(\displaystyle R_4 \rightarrow 4R_4\)
  • \(\displaystyle R_3 \rightarrow R_3 + 3R_2\)
If \(\det(A) = 8\text{,}\) what is the determinant of \(B\text{.}\)
Solution.
  • \(R_i \leftrightarrow R_j\) multiplies the determinant by \(-1\text{.}\)
  • \(R_4 \rightarrow 4R_4\) multiplies the determinant by \(4\text{.}\)
  • \(R_3 \rightarrow R_3 + 3R_2\) does not change the determinant.
Therefore \(\det(B) = (-1)(4) \det(A) = -32\text{.}\)

Activity 2.5.23.

Compute the determinant of the matrix
\begin{equation*} B = \begin{bmatrix} 1 \amp 2 \amp 1 \\ -1 \amp 3 \amp 3 \\ 0 \amp 15 \amp 12 \end{bmatrix}\text{.} \end{equation*}
Solution.
We use the elementary row operations to make the matrix \(B\) triangular:
\begin{equation*} R_2 \rightarrow R_2 + R_1 \end{equation*}
\begin{equation*} \begin{bmatrix} 1 \amp 2 \amp 1 \\ 0 \amp 5 \amp 4 \\ 0 \amp 15 \amp 12 \end{bmatrix} \end{equation*}
\begin{equation*} R_3 \rightarrow R_3 - 3 R_2 \end{equation*}
\begin{equation*} \begin{bmatrix} 1 \amp 2 \amp 1 \\ 0 \amp 5 \amp 4 \\ 0 \amp 0 \amp 0 \end{bmatrix} \end{equation*}
None of the row operations we have performed change the determinant of the matrix, and the final matrix has determinant zero, so \(\det(B) = 0\text{.}\)

Activity 2.5.24.

Let
\begin{equation*} A = \begin{bmatrix}3 \amp 1 \\ -2 \amp 7 \end{bmatrix} \quad B = \begin{bmatrix} 1 \amp 2 \\ 2 \amp 4 \end{bmatrix} \quad C = \begin{bmatrix} 1 \amp 4 \\ 0 \amp 2 \end{bmatrix}\text{.} \end{equation*}
(a)
Compute the determinant of \(A\text{,}\) \(B\text{,}\) and \(C\text{.}\)
Solution.
We use the formula for \(2 \times 2\) matrices: First, that
\begin{equation*} \det(A) = (3)(7) - (1)(-2) = 23\text{,} \end{equation*}
then that
\begin{equation*} \det(B) = (1)(4) - (2)(2) = 0\text{,} \end{equation*}
and that
\begin{equation*} \det(C) = (1)(2) - (4)(0) = 2\text{.} \end{equation*}
(b)
Compute the determinant of \(AC\) and \(BC\text{.}\)
Solution.
Using TheoremΒ 2.5.31, we calculate that
\begin{equation*} \det(AC) = \det(A) \det(C) = (23)(2) = 46\text{,} \end{equation*}
and that
\begin{equation*} \det(BC) = \det(B) \det(C) = (0)(2) = 0\text{.} \end{equation*}
Alternatively, we can calculate the products of the matrices, i.e., that
\begin{equation*} AC = \begin{bmatrix} 3 \amp 14 \\ -2 \amp 6 \end{bmatrix} \end{equation*}
and that
\begin{equation*} BC = \begin{bmatrix} 1 \amp 8 \\ 2 \amp 16 \end{bmatrix}\text{,} \end{equation*}
and calculate the determinants directly.

Why is this true?.

We prove only one direction of the theorem, that if \(A\) is nonsingular then \(\det(A) \neq 0\) and \(\det(A^{-1}) = 1/\det(A)\text{.}\) Suppose that \(A\) is non-singular. Then \(A A^{-1} = I\text{.}\) Taking determinants of both sides, and using that \(I\) is diagonal, so that \(\det(I) = 1\text{,}\) we see that
\begin{equation*} 1 = \det(I) = \det(A A^{-1}) = \det(A) \det(A^{-1})\text{.} \end{equation*}
Thus \(\det(A) \neq 0\) (since otherwise the right hand side of this equation would be zero), and rearranging gives \(\det(A^{-1}) = 1/\det(A)\text{.}\)

Definition 2.5.34. Orthogonal Matrices.

A square matrix \(A\) is orthogonal if \(A^T = A^{-1}\text{.}\)

Activity 2.5.25.

If \(A\) is an orthogonal matrix, what are the possible values of \(\det(A)\text{?}\)
Solution.
If \(A\) is orthogonal, then applying the determinant to both sides of the equation \(I = AA^T\) gives
\begin{equation*} 1 = \det(I) = \det(AA^T) = \det(A) \det(A^T) = \det(A)^2\text{.} \end{equation*}
Taking square roots gives that \(\det(A) = \pm 1\text{.}\)