Inverse of a 3 by 3 Matrix

As you know, every 2 by 2 matrix A that isn't singular (that is, whose determinant isn't zero) has an inverse, A^{-1}, with the property that

A\,A^{-1}=A^{-1}A\,=\,I_{2},

where I_{2} is the 2 by 2 identity matrix, \left(\begin{array}{cc}1&0\\0&1\end{array}\right).

The same is true of all square matrices: any n by n matrix A whose determinant is non-zero has an inverse A^{-1}, such that

A\,A^{-1}=A^{-1}A\,=\,I_{n}.

If we know this inverse, it's in general very useful. For example, it turns out that the inverse of the matrix

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

is

\left(\begin{array}{ccc}4&-5&-2\\5&-6&-2\\-8&9&3\end{array}\right),

as can be quickly verified:

\left(\begin{array}{ccc}0&-3&-2\\1&-4&-2\\-3&4&1\end{array}\right)\left(\begin{array}{ccc}4&-5&-2\\5&-6&-2\\-8&9&3\end{array}\right)=\left(\begin{array}{ccc}0-15+16&0+18-18&0+6-6\\4-20+16&-5+24-18&-2+8-6\\-12+20-8&15-24+9&6-8+3\end{array}\right)=\left(\begin{array}{ccc}1&0&0\\0&1&0\\0&0&1\end{array}\right).

Now, consider the equation system

\left(\begin{array}{ccc}0&-3&-2\\1&-4&-2\\-3&4&1\end{array}\right)\left(\begin{array}{c}x\\y\\z\end{array}\right)=\left(\begin{array}{c}2\\5\\-9\end{array}\right).

Knowing the inverse as we do, it is a simple matter to solve this system: we simply observe that

\left(\begin{array}{c}x\\y\\z\end{array}\right)=\left(\begin{array}{ccc}0&-3&-2\\1&-4&-2\\-3&4&1\end{array}\right)^{-1}\left(\begin{array}{c}2\\5\\-9\end{array}\right)=\left(\begin{array}{ccc}4&-5&-2\\5&-6&-2\\-8&9&3\end{array}\right)\left(\begin{array}{c}2\\5\\-9\end{array}\right)=\left(\begin{array}{c}1\\-2\\2\end{array}\right).

Unfortunately, for larger square matrices there does not exist any neat formula for the inverse. Indeed, finding inverses is so laborious that usually it's not worth the effort, and we use alternative methods for solving equation systems (see Gaussian elimination).

Just occasionally, however, it's worth it. For example, we may find we want to repeatedly solve

\left(\begin{array}{ccc}0&-3&-2\\1&-4&-2\\-3&4&1\end{array}\right)\left(\begin{array}{c}x\\y\\z\end{array}\right)=\left(\begin{array}{c}v_{1}\\v_{2}\\v_{3}\end{array}\right)

for many different values of v_{1}, v_{2} and v_{3}, in which case knowing that the inverse is

\left(\begin{array}{ccc}4&-5&-2\\5&-6&-2\\-8&9&3\end{array}\right)

would come in very handy.

There are three main methods for finding inverses. The first, which is called the method of cofactors, is detailed here. The second is called Gauss-Jordan elimination, and is covered elsewhere. The third uses something called the Cayley-Hamilton theorem: it is covered on some courses, but not on others.

We won't prove here that the method of cofactors works; instead, we present it simply as a step-by-step recipe.

Step 1: replace every entry by its minor

Given an entry in a 3 by 3 matrix, cross out its entire row and column, and take the determinant of the 2 by 2 matrix that remains (this is called the minor).

In our example, this gives us

\left(\begin{array}{ccc}\left(-4\right)\times 1-\left(-2\right)\times 4&1\times 1-\left(-2\right)\times \left(-3\right)&1\times 4-\left(-4\right)\times \left(-3\right)\\\left(-3\right)\times 1-\left(-2\right)\times 4&0\times 1-\left(-2\right)\times \left(-3\right)&0\times 4-\left(-3\right)\times \left(-3\right)\\\left(-3\right)\times \left(-2\right)-\left(-2\right)\times \left(-4\right)&0\times \left(-2\right)-\left(-2\right)\times 1&0\times \left(-4\right)-\left(-3\right)\times 1\end{array}\right)=\left(\begin{array}{ccc}4&-5&-8\\5&-6&-9\\-2&2&3\end{array}\right).

Step 2: change some of the signs

We now change the signs of some of the minors, according to the pattern

\left(\begin{array}{ccc}+&-&+\\-&+&-\\+&-&+\end{array}\right),

thus creating what's called the matrix of cofactors. In our case, this is

\left(\begin{array}{ccc}4&5&-8\\-5&-6&9\\-2&-2&3\end{array}\right).

Step 3: transpose

We now transpose the matrix of cofactors. In our case, we get

\left(\begin{array}{ccc}4&-5&-2\\5&-6&-2\\-8&9&3\end{array}\right).

Step 4: divide by the determinant

Finally, we divide by the determinant of the original matrix. In our case, the determinant is

\text{det}\left(\begin{array}{ccc}0&-3&-2\\1&-4&-2\\-3&4&1\end{array}\right)=0\times \text{det}\left(\begin{array}{cc}-4&-2\\4&1\end{array}\right)+3\times \text{det}\left(\begin{array}{cc}1&-2\\-3&1\end{array}\right)-2\times \text{det}\left(\begin{array}{cc}1&-4\\-3&4\end{array}\right)=1,

so the inverse is simply

A^{-1}=\left(\begin{array}{ccc}4&-5&-2\\5&-6&-2\\-8&9&3\end{array}\right).
Created with the ExportAsWebPage package in Wolfram Mathematica 7.0