1.5. Determinants#

Determinants of square matrices play a very important role in linear algebra. One of their uses is they enable us to determine if a system of equations has a unique solution. Consider the system of two linear equations

\[\begin{split} \begin{align*} a x + b y &= e, \\ c x + d y &= f. \end{align*} \end{split}\]

To solve for \(x\) we could multiply the second equation by \(\dfrac{b}{d}\) and subtract from first equation and rearrange to make \(x\) the subject

\[\begin{split} \begin{align*} a x - \frac{b c}{d} x + b y - \frac{b d}{d} y &= e - \frac{b}{d} f \\ adx - bcx + bdy - bdy &= de - bf \\ (a d - b c) x &= d e - b f \\ x &= \frac{d e - b f}{a d - b c}. \end{align*} \end{split}\]

We can also solve for \(y\) by multiplying the first equation by \(\dfrac{c}{a}\) and subtract from the second equation and rearrange to make \(y\) the subject

\[\begin{split} \begin{align*} c x - \frac{c a}{a} x + d y - \frac{b c}{a} y &= f - \frac{c}{a} e \\ acx - acx + ady - bcy &= af - ce \\ (a d - b c) y &= a f - c e \\ y &= \frac{a f - c e}{a d - b c}. \end{align*} \end{split}\]

The denominators in the solutions to \(x\) and \(y\) are both \(a d - b c\) so if this value is zero then the system of equations does not have a solution. If we write the system using matrices (see the section on systems of linear equations for more detail on this), i.e.,

\[\begin{split} \begin{align*} \begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} e \\ f \end{pmatrix} \quad \implies \quad \begin{matrix} ax + by \!\!\! &= e, \\ cx + dy \!\!\! &= f. \end{matrix} \end{align*} \end{split}\]

then the expression \(ad - bc\) is known as the determinant of the \(2 \times 2\) matrix containing the coefficients of \(x\) and \(y\).

The determinant of a square matrix \(A\) is denoted by \(\det(A)\) or \(|A|\) and is a scalar value that can be computed from the values of its elements.

1.5.1. Calculating the determinant of a \(2 \times 2\) matrix#

Definition 1.16 (Determinant of a \(2 \times 2\) matrix)

The determinant of the \(2 \times 2\) matrix

\[\begin{split}\begin{pmatrix}a & b \\ c & d \end{pmatrix},\end{split}\]

is

(1.1)#\[\begin{split} \det \begin{pmatrix} a & b \\ c & d \end{pmatrix} = \begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc, \end{split}\]

i.e., the product of the elements on the main diagonal minus the product of the other two elements. Note that the vertical bars denoting a determinant is different from brackets that denote a matrix.

Example 1.9

Calculate the following determinants

(i)   \(\begin{vmatrix} 5 & 2 \\ 3 & 4 \end{vmatrix}\);

Solution (click to show)
\[\begin{split} \begin{vmatrix} 5 & 2 \\ 3 & 4 \end{vmatrix} = 5 \cdot 4 - 2 \cdot 3 = 20 - 6 = 14 \end{split}\]

(ii)   \(\det \begin{pmatrix} a & b \\ ka & kb \end{pmatrix}\);

Solution (click to show)
\[\begin{split} \det \begin{pmatrix} a & b \\ ka & kb \end{pmatrix} = akb - akb = 0 \end{split}\]

(iii)   \(\begin{vmatrix} 5 & 0 \\ 0 & 2 \end{vmatrix}\);

Solution (click to show)
\[\begin{split} \begin{vmatrix} 5 & 0 \\ 0 & 2 \end{vmatrix} = 5 \cdot 2 - 0 \cdot 0 = 10 - 0 = 10 \end{split}\]

(iv)   \(\begin{vmatrix} 2-\lambda & 3 \\ 5 & 6 - \lambda \end{vmatrix}\).

Solution (click to show)
\[\begin{split} \begin{vmatrix} 2-\lambda & 3 \\ 5 & 6 - \lambda \end{vmatrix} = (2-\lambda)(6-\lambda) - 3 \cdot 5 = \lambda^2 - 8\lambda - 3 \end{split}\]

1.5.2. Calculating the determinant of an \(n \times n\) matrix#

To compute the determinant of a matrix larger than \(2\times 2\) we need to split the matrix up into multiple \(2\times 2\) matrices so we can use equation (1.1). This is done in a specific way explained below which using things called minors and cofactors.

Definition 1.17 (Minor)

The minor of an element of an \(n \times n\) square matrix is denoted by \(M_{ij}\) and is the determinant of the \((n-1) \times (n-1)\) square matrix that is formed by removing row \(i\) and column \(j\) from \(A\).

For example, if

\[\begin{split}A = \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{pmatrix}, \end{split}\]

then the minor of the element \(a_{21}\) is

\[\begin{split} M_{21} = \begin{vmatrix} \textcolor{lightgray}{\square} & a_{12} & a_{13} \\ \textcolor{lightgray}{\square} & \textcolor{lightgray}{\square} & \textcolor{lightgray}{\square} \\ \textcolor{lightgray}{\square} & a_{32} & a_{33} \end{vmatrix} = \begin{vmatrix} a_{12} & a_{13} \\ a_{32} & a_{33} \end{vmatrix} = a_{12}a_{33} - a_{13}a_{32}. \end{split}\]

Example 1.10

Given the matrix

\[\begin{split} A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix},\end{split}\]

calculate:

(i)   \(M_{11}\);

Solution (click to show)
\[\begin{split} M_{11} = \begin{vmatrix} 5 & 6 \\ 8 & 9 \end{vmatrix} = 5 \cdot 9 - 6 \cdot 8 = 45 - 48 = -3 \end{split}\]

(ii)   \(M_{12}\);

Solution (click to show)
\[\begin{split} M_{12} = \begin{vmatrix} 4 & 6 \\ 7 & 9 \end{vmatrix} = 4 \cdot 9 - 6 \cdot 7 = 36 - 42 = -6 \end{split}\]

(iii)   \(M_{13}\).

Solution (click to show)
\[\begin{split} M_{13} = \begin{vmatrix} 4 & 5 \\ 7 & 8 \end{vmatrix} = 4 \cdot 8 - 5 \cdot 7 = 32 - 35 = -3 \end{split}\]

Definition 1.18 (Cofactor)

The cofactor of an element of a square matrix is denoted by \(C_{ij}\) and is defined by

(1.2)#\[ C_{ij} = (-1)^{i+j}M_{ij}. \]

The \((-1)^{i+j}\) in equation (1.2) is positive when \(i + j\) is even and negative when \(i+j\) is odd which results in the following pattern of signs

\[\begin{split} \begin{pmatrix} + & - & + & \cdots \\ - & + & - & \cdots \\ + & - & + & \cdots \\ \vdots & \vdots & \vdots & \ddots \end{pmatrix}. \end{split}\]

Definition 1.19 (Determinant of an \(n \times n\) matrix)

The determinant of an \(n\times n\) matrix \(A\) is defined by

(1.3)#\[ \det(A) = \sum_{i=1}^n a_{ik} C_{ik} = \sum_{j=1}^n a_{kj} C_{kj}, \]

for some fixed value in the range \(1 \leq k \leq n\) which represents a single row or column of \(A\).

Equation (1.3) allows us to express the determinant of an \(n \times n\) matrix in terms of determinants of \((n-1) \times (n-1)\) matrices. We can then if needed, apply the formula again to the sub-matrices. Continuing in this fashion we will eventually just be calculating \(2\times 2\) matrices, which we know how to do from equation (1.1).

To calculate the determinant of the matrix

\[\begin{split} A = \begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix}, \end{split}\]

we can expand across row 1 using \(k = 1\) in the first summation in equation (1.3)

\[\begin{split} \begin{align*} \det(A) &= a C_{11} + b C_{12} + c C_{13} \\ &= (-1)^{(1+1)} a \begin{vmatrix} e & f \\ h & i \end{vmatrix} + (-1)^{(1+2)} b \begin{vmatrix}d & f \\ g & i \end{vmatrix} + (-1)^{(1+3)} c \begin{vmatrix}d & e \\ g & h \end{vmatrix} \\ &= a(ei - fh) - b(di - fg) + c(dh - eg) \\ &= aei - afh - bdi + bfg + cdh - ceg. \end{align*} \end{split}\]

We could also had chosen to expand along column 2 using \(k = 2\) and the second summation in equation (1.3).

\[\begin{split} \begin{align*} \det(A) &= b C_{12} + e C_{22} + h C_{32} \\ &= (-1)^{(1+2)} b\begin{vmatrix} d & f \\ g & i \end{vmatrix} + (-1)^{(2+2)}e \begin{vmatrix} a & c \\ g & i \end{vmatrix} + (-1)^{(3+2)}h \begin{vmatrix} a & c \\ d & f \end{vmatrix} \\ &= -b(di-fg) + e(ai-cg) - h(af-cd) \\ &= -bdi + bfg + aei - ceg - afh + cdh. \end{align*} \end{split}\]

Which is the same as the result when expanded along row 1. So it does not matter which row or column we expand along to compute the determinant, we will always get the same answer. It is usually preferable to expand along the row or columns with the most zero elements or smallest integer values to simplify the calculations.

Example 1.11

Calculate the determinant of the matrix

\[\begin{split} \begin{pmatrix} 1 & 0 & 4 \\ 2 & 5 & 6 \\ 4 & 5 & 2 \end{pmatrix}, \end{split}\]

by expanding along:

(i)   row 1;

Solution (click to show)
\[\begin{split} \begin{align*} \begin{vmatrix}1 & 0 & 4 \\ 2 & 5 & 6 \\ 4 & 5 & 2 \end{vmatrix} &= 1\begin{vmatrix}5 & 6 \\ 5 & 2 \end{vmatrix} - 0 \begin{vmatrix} 2 & 6 \\ 4 & 2 \end{vmatrix} + 4 \begin{vmatrix}2 & 5 \\ 4 & 5 \end{vmatrix} \\ &= (10-30) + 4(10-20) \\ &= -60 \end{align*} \end{split}\]

(ii)   column 3.

Solution (click to show)
\[\begin{split} \begin{align*} \begin{vmatrix}1 & 0 & 4 \\ 2 & 5 & 6 \\ 4 & 5 & 2 \end{vmatrix} &= 4 \begin{vmatrix} 2 & 5 \\ 4 & 5 \end{vmatrix} - 6\begin{vmatrix}1 & 0 \\ 4 & 5 \end{vmatrix} + 2\begin{vmatrix}1 & 0 \\ 2 & 5 \end{vmatrix} \\ &= 4(10-20) - 6(5 - 0) + 2(5 - 0) \\ &= -60 \end{align*} \end{split}\]

For larger matrices we have to apply equation (1.3) recursively until we get to \(2 \times 2\) determinants where we can use (1.1).

Example 1.12

Calculate the determinant of the \(4 \times 4\) matrix

\[\begin{split} \begin{pmatrix} 1 & -1 & 4 & 3 \\ 2 & 0 & 5 & -3 \\ 1 & 2 & 4 & 5 \\ 2 & 0 & -2 & 4 \end{pmatrix}. \end{split}\]
Solution (click to show)

Here column 2 has two zero elements so it would be more efficient to expand along this column

\[\begin{split} \begin{align*} \begin{vmatrix} 1 & -1 & 4 & 3 \\ 2 & 0 & 5 & -3 \\ 1 & 2 & 4 & 5 \\ 2 & 0 & -2 & 4 \end{vmatrix} &= - (-1) \begin{vmatrix}2 & 5 & -3 \\ 1 & 4 & 5 \\ 2 & -2 & 4 \end{vmatrix} - 2 \begin{vmatrix} 1 & 4 & 3 \\ 2 & 5 & -3 \\ 2 & -2 & 4 \end{vmatrix} \\ &= 1\left( 2 \begin{vmatrix} 4 & 5 \\ -2 & 4 \end{vmatrix} - 5\begin{vmatrix}1 & 5 \\ 2 & 4 \end{vmatrix} - 3 \begin{vmatrix} 1 & 4 \\ 2 & -2 \end{vmatrix} \right) \\ & \qquad - 2 \left( \begin{vmatrix} 5 & -3 \\ -2 & 4 \end{vmatrix} - 4 \begin{vmatrix} 2 & -3 \\ 2 & 4 \end{vmatrix} + 3 \begin{vmatrix} 2 & 5 \\ 2 & -2 \end{vmatrix} \right) \\ &= 2(16 + 10) - 5(4 - 10) - 3(-2-8) \\ & \qquad - 2(20-6) + 8(8+6) - 6(-4-10) \\ &= 280. \end{align*} \end{split}\]

Theorem 1.6 (Properties of determinants)

Determinants have the following properties:

  • \(\det(AB) = \det(A)\det(B)\).

  • \(\det(A) = \det(A^\mathsf{T})\).

  • If a matrix has a row or column with all zero elements then its determinant is zero.

  • Interchanging any two rows of a matrix changes the sign of the determinant.

  • If all elements in a row are multiplied by a scalar \(k\) then the determinant is also multiplied by \(k\).

  • If one row of a matrix is a multiple of another row then the matrix has a determinant of zero.

  • The value of a determinant is unchanged by adding a multiple of one row to another row.