3 The inverse of a 3 $×$ 3 matrix - Gauss elimination method

It is true, in general, that if the determinant of a matrix is zero then that matrix has no inverse. If the determinant is non-zero then the matrix has a (unique) inverse. In this Section and the next we look at two ways of finding the inverse of a $3×3$ matrix; larger matrices can be inverted by the same methods - the process is more tedious and takes longer. The $2×2$ case could be handled similarly but as we have seen we have a simple formula to use.

The method we now describe for finding the inverse of a matrix has many similarities to a technique used to obtain solutions of simultaneous equations. This method involves operating on the rows of a matrix in order to reduce it to a unit matrix.

The row operations we shall use are

1. interchanging two rows
2. multiplying a row by a constant factor
3. adding a multiple of one row to another.

Note that in (ii) and (iii) the multiple could be negative or fractional, or both.

The Gauss elimination method is outlined in the following Key Point:

Key Point 9

Matrix Inverse $-$ Gauss Elimination Method

We use the result, quoted without proof, that:

if a sequence of row operations applied to a square matrix $A$ reduces it to the identity matrix $I$ of the same size then the same sequence of operations applied to $I$ reduces it to ${A}^{-1}$ .

Three points to note:

• If it is impossible to reduce $A$ to $I$ then ${A}^{-1}$ does not exist. This will become evident by the appearance of a row of zeros.
• There is no unique procedure for reducing $A$ to $I$ and it is experience which leads to selection of the optimum route.
• It is more efficient to do the two reductions, $A$ to $I$ and $I$ to ${A}^{-1},$ simultaneously.

Suppose we wish to find the inverse of the matrix

$\phantom{\rule{2em}{0ex}}A=\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 3\hfill & \hfill 3\hfill \\ \hfill 1\hfill & \hfill 4\hfill & \hfill 3\hfill \\ \hfill 2\hfill & \hfill 7\hfill & \hfill 7\hfill \end{array}\right]$

We first place $A$ and $I$ adjacent to each other.

$\phantom{\rule{2em}{0ex}}\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 3\hfill & \hfill 3\hfill \\ \hfill 1\hfill & \hfill 4\hfill & \hfill 3\hfill \\ \hfill 2\hfill & \hfill 7\hfill & \hfill 7\hfill \end{array}\right]\phantom{\rule{2em}{0ex}}\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]$

Phase 1

We now proceed by changing the columns of $A$ left to right to reduce $A$ to the form $\left[\begin{array}{ccc}\hfill 1\hfill & \hfill \ast \hfill & \hfill \ast \hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill \ast \hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]$ where $\ast$ can be any number. This form is called upper triangular .

First we subtract row 1 from row 2 and twice row 1 from row 3. ‘Row’ refers to both matrices.

$\phantom{\rule{2em}{0ex}}\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 3\hfill & \hfill 3\hfill \\ \hfill 1\hfill & \hfill 4\hfill & \hfill 3\hfill \\ \hfill 2\hfill & \hfill 7\hfill & \hfill 7\hfill \end{array}\right]\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]\begin{array}{c}\hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill R2-R1\hfill \\ \hfill R3-2R1\hfill \end{array}⇒\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 3\hfill & \hfill 3\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 1\hfill \end{array}\right]\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 1& \hfill 0& \hfill 0\\ \hfill -1& \hfill 1& \hfill 0\\ \hfill -2& \hfill 0& \hfill 1\end{array}\right]$

Now we subtract row 2 from row 3

$\phantom{\rule{2em}{0ex}}\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 3\hfill & \hfill 3\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 1\hfill \end{array}\right]\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 1& \hfill 0& \hfill 0\\ \hfill -1& \hfill 1& \hfill 0\\ \hfill -2& \hfill 0& \hfill 1\end{array}\right]\begin{array}{c}\hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill R3-R2\hfill \end{array}⇒\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 3\hfill & \hfill 3\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 1& \hfill 0& \hfill 0\\ \hfill -1& \hfill 1& \hfill 0\\ \hfill -1& \hfill -1& \hfill 1\end{array}\right]$

Phase 2

This consists of continuing the row operations to reduce the elements above the leading diagonal to zero.

We proceed right to left . We subtract 3 times row 3 from row 1 (the elements in row 2 column 3 is already zero.)

$\phantom{\rule{2em}{0ex}}\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 3\hfill & \hfill 3\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 1& \hfill 0& \hfill 0\\ \hfill -1& \hfill 1& \hfill 0\\ \hfill 1& \hfill 1& \hfill 1\end{array}\right]\phantom{\rule{1em}{0ex}}\begin{array}{c}\hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill R1-3R3\hfill \end{array}⇒\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 3\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 4& \hfill 3& \hfill -3\\ \hfill -1& \hfill 1& \hfill 0\\ \hfill -1& \hfill -1& \hfill 1\end{array}\right]$

Finally we subtract 3 times row 2 from row 1.

$\phantom{\rule{2em}{0ex}}\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 3\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 4& \hfill 3& \hfill -3\\ \hfill -1& \hfill 1& \hfill 0\\ \hfill -1& \hfill -1& \hfill 1\end{array}\right]\phantom{\rule{1em}{0ex}}\begin{array}{c}\hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill R1-3R2\hfill \end{array}⇒\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 7& \hfill 0& \hfill -3\\ \hfill -1& \hfill 1& \hfill 0\\ \hfill -1& \hfill -1& \hfill 1\end{array}\right]$

Then we have ${A}^{-1}=\left[\begin{array}{ccc}\hfill 7& \hfill 0& \hfill -3\\ \hfill -1& \hfill 1& \hfill 0\\ \hfill -1& \hfill -1& \hfill 1\end{array}\right]$

(This can be verified by showing that $A{A}^{-1}=I$ or ${A}^{-1}A=I$ .)

Consider $A=\left[\begin{array}{ccc}\hfill 0& \hfill 1& \hfill 1\\ \hfill 2& \hfill 3& \hfill -1\\ \hfill -1& \hfill 2& \hfill 1\end{array}\right],\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}I=\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]$ .

Use the Gauss elimination method to obtain ${A}^{-1}$ .

First interchange rows 1 and 2, then carry out the operation (row 3)+ $\frac{1}{2}$ (row 1):

$\begin{array}{rcll}\left[\begin{array}{ccc}\hfill 0& \hfill 1& \hfill 1\\ \hfill 2& \hfill 3& \hfill -1\\ \hfill -1& \hfill 2& \hfill 1\end{array}\right]\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]\phantom{\rule{1em}{0ex}}\begin{array}{c}\hfill R1↔R2\hfill \\ \hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill \phantom{\rule{1em}{0ex}}\hfill \end{array}& ⇒& \left[\begin{array}{ccc}\hfill 2& \hfill 3& \hfill -1\\ \hfill 0& \hfill 1& \hfill 1\\ \hfill -1& \hfill 2& \hfill 1\end{array}\right]\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]& \text{}\\ \phantom{\rule{1em}{0ex}}& & & \text{}\\ \left[\begin{array}{ccc}\hfill 2& \hfill 3& \hfill -1\\ \hfill 0& \hfill 1& \hfill 1\\ \hfill -1& \hfill 2& \hfill 1\end{array}\right]\phantom{\rule{1em}{0ex}}\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]\begin{array}{c}\hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill R3+\frac{1}{2}R1\hfill \end{array}& ⇒& \left[\begin{array}{ccc}\hfill 2& \hfill 3& \hfill -1\\ \hfill 0& \hfill 1& \hfill 1\\ \hfill 0& \hfill \frac{7}{2}& \hfill \frac{1}{2}\end{array}\right]\left[\begin{array}{ccc}\hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill \frac{1}{2}\hfill & \hfill 1\hfill \end{array}\right]& \text{}\end{array}$

Now carry out the operation (row 3)- $\frac{7}{2}$ (row 2) followed by (row 1)- $\frac{1}{3}$ (row 3) and (row 2)+ $\frac{1}{3}$ (row 3):

$\begin{array}{rcll}\left[\begin{array}{ccc}\hfill 2& \hfill 3& \hfill -1\\ \hfill 0& \hfill 1& \hfill 1\\ \hfill 0& \hfill \frac{7}{2}& \hfill \frac{1}{2}\end{array}\right]\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill \frac{1}{2}\hfill & \hfill 1\hfill \end{array}\right]\begin{array}{c}\hfill \hfill \\ \hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill R3-\frac{7}{2}R2\hfill \end{array}& ⇒& \left[\begin{array}{ccc}\hfill 2& \hfill 3& \hfill -1\\ \hfill 0& \hfill 1& \hfill 1\\ \hfill 0& \hfill 0& \hfill -3\end{array}\right]\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 0& \hfill 1& \hfill 0\\ \hfill 1& \hfill 0& \hfill 0\\ \hfill -\frac{7}{2}& \hfill \frac{1}{2}& \hfill 1\end{array}\right]& \text{}\\ \phantom{\rule{1em}{0ex}}& & & \text{}\\ \left[\begin{array}{ccc}\hfill 2& \hfill 3& \hfill -1\\ \hfill 0& \hfill 1& \hfill 1\\ \hfill 0& \hfill 0& \hfill -3\end{array}\right]\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill 0& \hfill 1& \hfill 0\\ \hfill 1& \hfill 0& \hfill 0\\ \hfill -\frac{7}{2}& \hfill \frac{1}{2}& \hfill 1\end{array}\right]\begin{array}{c}\hfill R1-\frac{1}{3}R3\hfill \\ \hfill R2+\frac{1}{3}R3\hfill \\ \hfill \phantom{\rule{1em}{0ex}}\hfill \end{array}& ⇒& \left[\begin{array}{ccc}\hfill 2& \hfill 3& \hfill 0\\ \hfill 0& \hfill 1& \hfill 0\\ \hfill 0& \hfill 0& \hfill -3\end{array}\right]\left[\begin{array}{ccc}\hfill +\frac{7}{6}& \hfill +\frac{5}{6}& \hfill -\frac{1}{3}\\ \hfill \\ \hfill -\frac{1}{6}& \hfill \frac{1}{6}& \hfill \frac{1}{3}\\ \hfill \\ \hfill -\frac{7}{2}& \hfill \frac{1}{2}& \hfill 1\end{array}\right]& \text{}\end{array}$

Next, subtract 3 times row 2 from row 1, then, divide row 1 by 2 and row 3 by $\left(-3\right)$ .

Finally identify ${A}^{-1}$ :

$\begin{array}{rcll}\left[\begin{array}{ccc}\hfill 2& \hfill 3& \hfill 0\\ \hfill 0& \hfill 1& \hfill 0\\ \hfill 0& \hfill 0& \hfill -3\end{array}\right]\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill \frac{7}{6}& \hfill \frac{5}{6}& \hfill -\frac{1}{3}\\ \hfill \\ \hfill -\frac{1}{6}& \hfill \frac{1}{6}& \hfill \frac{1}{3}\\ \hfill \\ \hfill -\frac{7}{2}& \hfill \frac{1}{2}& \hfill 1\end{array}\right]\begin{array}{c}\hfill R1-3R2\hfill \\ \hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill \phantom{\rule{1em}{0ex}}\hfill \end{array}& ⇒& \left[\begin{array}{ccc}\hfill 2& \hfill 0& \hfill 0\\ \hfill 0& \hfill 1& \hfill 0\\ \hfill 0& \hfill 0& \hfill -3\end{array}\right]\left[\begin{array}{ccc}\hfill \frac{10}{6}& \hfill \frac{2}{6}& \hfill -\frac{4}{3}\\ \hfill \\ \hfill -\frac{1}{6}& \hfill \frac{1}{6}& \hfill \frac{1}{3}\\ \hfill \\ \hfill -\frac{7}{2}& \hfill \frac{1}{2}& \hfill 1\end{array}\right]& \text{}\\ & & & \text{}\\ \phantom{\rule{1em}{0ex}}& & & \text{}\\ \left[\begin{array}{ccc}\hfill 2& \hfill 0& \hfill 0\\ \hfill 0& \hfill 1& \hfill 0\\ \hfill 0& \hfill 0& \hfill -3\end{array}\right]\phantom{\rule{1em}{0ex}}\left[\begin{array}{ccc}\hfill \frac{10}{6}& \hfill \frac{2}{6}& \hfill -\frac{4}{3}\\ \hfill \\ \hfill -\frac{1}{6}& \hfill \frac{1}{6}& \hfill \frac{1}{3}\\ \hfill \\ \hfill -\frac{7}{2}& \hfill \frac{1}{2}& \hfill 1\end{array}\right]\begin{array}{c}\hfill R1÷2\hfill \\ \hfill \phantom{\rule{1em}{0ex}}\hfill \\ \hfill R3÷\left(-3\right)\hfill \end{array}& ⇒& \left[\begin{array}{ccc}\hfill 1\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 1\hfill & \hfill 0\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 1\hfill \end{array}\right]\left[\begin{array}{ccc}\hfill \frac{5}{6}& \hfill \frac{1}{6}& \hfill -\frac{2}{3}\\ \hfill \\ \hfill -\frac{1}{6}& \hfill \frac{1}{6}& \hfill \frac{1}{3}\\ \hfill \\ \hfill \frac{7}{6}& \hfill -\frac{1}{6}& \hfill -\frac{1}{3}\end{array}\right]& \text{}\end{array}$

Hence ${A}^{-1}=\left[\begin{array}{ccc}\hfill \frac{5}{6}& \hfill \frac{1}{6}& \hfill -\frac{2}{3}\\ \hfill \\ \hfill -\frac{1}{6}& \hfill \frac{1}{6}& \hfill \frac{1}{3}\\ \hfill \\ \hfill \frac{7}{6}& \hfill -\frac{1}{6}& \hfill -\frac{1}{3}\end{array}\right]=\frac{1}{6}\left[\begin{array}{ccc}\hfill 5& \hfill 1& \hfill -4\\ \hfill -1& \hfill 1& \hfill 2\\ \hfill 7& \hfill -1& \hfill -2\end{array}\right]$