## Section3.9Determinants

The determinant of a (square) matrix is somewhat complicated in general, so you may want to check a reference book. The $$2\times2$$ and $$3\times3$$ cases can be memorized using the examples below.

The determinant of a $$2\times2$$ matrix is given by

$$\det\begin{pmatrix} a\amp b\\ c\amp d \end{pmatrix} = \begin{vmatrix} a\amp b\\ c\amp d\\ \end{vmatrix} = ad-bc\text{.}\tag{3.9.1}$$

Notice in the equation above the two common notations for determinant.

The determinant of a $$3\times3$$ matrix is computed as follows:

\begin{align} \begin{vmatrix} a\amp b\amp c\\ d\amp e\amp f\\ g\amp h\amp i\end{vmatrix} \amp = \det\begin{pmatrix} a\amp b\amp c\\ d\amp e\amp f\\ g\amp h\amp i \end{pmatrix}\notag\\ \amp = a\cdot \begin{vmatrix} e\amp f\\ h\amp i \end{vmatrix} - b\cdot \begin{vmatrix} d\amp f\\ g\amp i \end{vmatrix} + c\cdot \begin{vmatrix} d\amp e\\ g\amp h \end{vmatrix}\notag\\ \amp = a\cdot(ei-hf)-b\cdot(di-gf)+c\cdot(dh-ge)\notag\\ \amp = aei-ahf-bdi+bgf+cdh-cge\text{.}\tag{3.9.2} \end{align}

The smaller $$2\times2$$ determinants are called the cofactors of the elements $$a\text{,}$$ $$b\text{,}$$ and $$c\text{,}$$ respectively. The minus sign in front of $$b$$ is part of the cofactor. Cofactors are formed by keeping only what is left after eliminating everything from the row and column where the element desired resides. So, for $$a\text{,}$$ the row elements, $$b$$ and $$c\text{,}$$ and the column elements, $$d$$ and $$g\text{,}$$ are eliminated, leaving the $$2\times2$$ matrix shown above.

Computing $$4\times4$$ matrices is a straightforward extension of the above procedure, but it is easier to just go to a computer!!!

Compute $$\det(B)$$ if

$$B = \begin{pmatrix} 1\amp 2\amp 3\\ 4\amp 5\amp 6\\ 7\amp 8\amp 9 \end{pmatrix}\text{.}\tag{3.9.3}$$
Solution.

The method above extends naturally to square matrices of any size, but there is an easier way to find the determinant of a $$3\times3$$ matrix that uses cyclic symmetry. Multiply the numbers on each “forward” diagonal (wrapping around as needed) and add them together, then do the same on each “backward” diagonal, but subtract the latter subtotal from the former.

Applying this method to $$B\text{,}$$ we have

\begin{align} \det(B) \amp= (1)(5)(9)+(2)(6)(7)+(3)(4)(8)\notag\\ \amp\qquad -(3)(5)(7)-(1)(6)(8)-(2)(4)(9) = 0\tag{3.9.4} \end{align}

You can use the Sage code below to compute the determinant of any matrix.

B=matrix([[1,2,3],[4,5,6],[7,8,9]])
det(B)