## Matrices: Determinants and Inverses.

### May 25, 2010

Every so often, when I’m tutoring someone, a problem will require the student to take an inverse of a 3×3 matrix, or the determinant of a 4×4 matrix.  The student replies, "Oh, this is easy…there’s a command for it on my calculator."  At that point, I think to myself, "yes, that’s certainly nice…but what if we didn’t have a calculator?"  And furthermore, how am I going to check to see if the answer is correct?  I rarely bring a graphing calculator with me.  What a terrible situation!

## Determinants

To explain what a determinant is, we’d need to talk theory for a while.  But we don’t really care at this point what a determinant is, but just how to find it.  First, let’s talk about how to find the determinant of 2×2 matrices.  Given

$\left( \begin{array}{cc} a & b \\ c&d \end{array}\right)$

we have that the determinant will be equal to $ad - bc$.  We usually teach students this by saying "multiply the top-left and bottom right together, then multiply the top-right and the bottom-left together, and subtract the second from the first."  This is how we find determinants of 2×2 matrices.  For example, given

$\left( \begin{array}{cc} 2 & 1 \\ -1&3 \end{array}\right)$

the determinant is 6 – (-1) = 7.

What about bigger matrices?  First, let’s note that these need to be square matrices — that is, the number of rows need to equal the number of columns.  There turns out to be a number of fun ways to find the determinant, but my favorite way is expansion by minors.

This picture, stolen from Wolfram’s Mathworld (because I was much too lazy to make one up myself) describes the general process.  Let’s take some matrix, M, which is an $n\times m$ matrix; n rows, m columns.

Let’s make something called $C_{ij}$.  The process is this: cross out everything in row i and in column j and make the remaining terms into an $(n-1)\times (m-1)$ matrix.  Take the determinant of this, and this number will be $C_{ij}$

(At this point, the observant reader will note that we’re using determinants to define things to help us take determinants.  Why isn’t this circular?  Because we’re taking determinants of matrices smaller than the one we are working towards finding the determinant of.  In other words, if we know how to find the determinant of 2×2’s and 3×3’s, we can take the determinant of 4×4’s, but we cannot take the determinant of 4×4’s without knowing how to take the determinant of 3×3’s and 2×2’s.  Determinants are, therefore, an inductive creature.  This is why we defined how to take the determinant of a 2×2 above, since when we take the determinant of a 3×3 we will need it.)

Now, given an $n\times n$ matrix, we sum up the following things:

$\sum_{j = 1}^{n} (-1)^{i+j}a_{ij}C_{1j}$

where $C_{ij}$ is defined above and $a_{ij}$ is the matrix entry in the i-th row and j-th column.  This sum is what we call the determinant.

## Really?: An Example.

Let’s take the $3\times 3$ matrix

$\left( \begin{array}{ccc} 2 & 1 & 3\\ 0 & 3 & 2\\ 1 & 1 & 2\end{array}\right)$

$(-1)^{2}(2)C_{11} + (-1)^{3}(1)C_{12} + (-1)^{4}(3)C_{13}$

which is the same as

$2C_{11} - C_{12} + 3C_{13}$

So all we need to do is figure out these cofactors.  To find $C_{11}$ all we need to do is cross out the first row and first column.  We’re left with

$\left( \begin{array}{cc} 3 & 2 \\ 1&2 \end{array}\right)$

which has a determinant of $6 - 2 = 4$.  Good.  Now, to figure out $C_{12}$ we cross out the first row, second column.  We obtain

$\left( \begin{array}{cc} 0 & 2 \\ 1&2 \end{array}\right)$

which has a determinant of $0 - 2 = -2$.  Last, we figure out $C_{13}$ by crossing out the first row, third column.  We obtain

$\left( \begin{array}{cc} 0 & 3 \\ 1&1 \end{array}\right)$

which has a determinant of $0 - 3 = -3$.  Putting all this together, we get

$2C_{11} - C_{12} + 3C_{13} = 2*4 - (-2) + 3*(-2) = 8 + 2 - 6 = 4$

which is the determinant of our $3\times 3$ matrix.  Cool.

Okay, determinants are pretty cool, but if they aren’t useful to us, then who cares?  So we’re going to talk about how we can use determinants to find inverses.  And, in fact, we really don’t need to do much more than we’ve already done.

Let the matrix $M$ be an $n\times n$ matrix.  Let’s say it looks like this:

$\left( \begin{array}{cccc} a_{11} & a_{12} & a_{13} & \dots \\ a_{21}& a_{22} & a_{23} & \dots \\ \vdots & \vdots & \vdots & \ddots \end{array}\right)$

we can make a new matrix called the adjoint matrix.  This is kind of a weird matrix, made by considering the following matrix:

$\left( \begin{array}{cccc} +C_{11} & -C_{12} & +C_{13} & \dots \\ -C_{21}& +C_{22} & -C_{23} & \dots \\ +C_{31} & -C_{32} & +C_{33} & \dots \\ \vdots & \vdots & \vdots & \ddots \end{array}\right)^{T}$

where the T on the end means "transpose."  This is a common matrix operation: we simply make every element swap its row and column.  So, for example, $a_{13}$ becomes $a_{31}$ and so on.

Notice also the signs in the adjoint.  The sign of the cofactor in any space is determined by $(-1)^{i+j}$ for the i-th row and j-th column.  It always looks like this:

$\left( \begin{array}{cccc} + & - & + & \dots \\ -& + & - & \dots \\ + & - & + & \dots \\ \vdots & \vdots & \vdots & \ddots \end{array}\right)$

So the process is as follows: take every possible cofactor and put it into a matrix in the correct spot.  Then take the transpose of that matrix.  The matrix that you have now is the adjoint matrix, and we denote it $adj(M)$.

## Inverses, Finally.

Now, this next part is probably the coolest part: in order to find the inverse of any matrix, we use the following formula:

$M^{-1} = \frac{adj(M)}{det(M)}$

which is really not too bad a formula, all things considered!

## Example!

We want to find the inverse of

$\left( \begin{array}{ccc} 3 & 0 & 2\\ 0 & 0 & 1\\ 2 & 1 & 0\end{array}\right)$

so we begin by finding the adjoint matrix.  Please do this yourself and compare it to mine!

$\left( \begin{array}{ccc} -1 & 2 & 0\\ 2 & -4 & -3\\ 0 & -3 & 0\end{array}\right)^T$

and when we compute the transpose, we get

$\left( \begin{array}{ccc} -1 & 2 & 0\\ 2 & -4 & -3\\ 0 & -3 & 0\end{array}\right)$

and that’s nice.  Now, let’s compute the determinant of the original matrix:

$3(-1) - 0 + 2(0) = -3$.  By our formula, the inverse matrix is

$-\frac{1}{3}\left( \begin{array}{ccc} -1 & 2 & 0\\ 2 & -4 & -3\\ 0 & -3 & 0\end{array}\right)$.

Try multiplying this out to prove it is, in fact, an inverse.  It blows my mind every time.  Neat, huh?