2.4: Computing Inverses
View Computing Inverses on YouTube
Calculating the reduced row echelon form of an \(n\)-by-\(n\) invertible matrix \(\text{A}\) can be used to compute the inverse matrix \(\text{A}^{−1}\).
For example, recall how we found the general inverse of a two-by-two matrix by writing \(\text{AA}^{−1} = \text{I}\), that is,
\[\left(\begin{array}{cc}a&b\\c&d\end{array}\right)\left(\begin{array}{cc}x_1&x_2\\y_1&y_2\end{array}\right)=\left(\begin{array}{cc}1&0\\0&1\end{array}\right).\nonumber \]
This single matrix equation is equivalent to two sets of two equations and two unknowns, namely
\[\left(\begin{array}{cc}a&b\\c&d\end{array}\right)\left(\begin{array}{c}x_1\\y_1\end{array}\right)=\left(\begin{array}{c}1\\0\end{array}\right),\quad\left(\begin{array}{cc}a&b\\c&d\end{array}\right)\left(\begin{array}{c}x_2\\y_2\end{array}\right)=\left(\begin{array}{c}0\\1\end{array}\right).\nonumber \]
We can solve these two equations by bringing \(\text{A}\) to reduced row echelon form. There is no point in doing this twice, so instead we form a doubly augmented matrix and go to work on that:
\[\begin{array}{l}\left(\begin{array}{cccc}a&b&1&0\\c&d&0&1\end{array}\right)\to\left(\begin{array}{cccc}1&b/a&1/a&0\\c&d&0&1\end{array}\right)\to\left(\begin{array}{cccc}1&b/a&1/a&0\\0&\frac{ad-bc}{a}&-c/a&1\end{array}\right)\to \\ \left(\begin{array}{cccc}1&b/a&1/a&0\\0&1&-\frac{c}{ad-bc}&\frac{a}{ad-bc}\end{array}\right)\to\left(\begin{array}{cccc}1&0&\frac{d}{ad-bc}&-\frac{b}{ad-bc} \\ 0&1&-\frac{c}{ad-bc}&\frac{a}{ad-bc}\end{array}\right).\end{array}\nonumber \]
The third column of the reduced matrix corresponds to the first column of the inverse matrix, and the fourth column of the reduced matrix correponds to the second column of the inverse matrix. Therefore, we have rederived
\[\text{A}^{-1}=\frac{1}{ad-bc}\left(\begin{array}{rr}d&-b\\-c&a\end{array}\right).\nonumber \]
In other words, by moving \(\text{A}\) to reduced row echelon form while simultaneously performing the same operations on the identity matrix \(\text{I}\), we achieve the following transformation:
\[\left(\begin{array}{cc}\text{A}&\text{I}\end{array}\right)\to\left(\begin{array}{cc}\text{I}&\text{A}^{-1}\end{array}\right).\nonumber \]
To illustrate this algorithm further, we find the inverse of the three-by-three matrix used in our first example. We have
\[\begin{array}{l}\left(\begin{array}{rrrrrr}-3&2&-1&1&0&0\\6&-6&7&0&1&0\\3&-4&4&0&0&1\end{array}\right)\to\left(\begin{array}{rrrrrr}-3&2&-1&1&0&0\\0&-2&5&2&1&0\\0&-2&3&1&0&1\end{array}\right)\to \\ \left(\begin{array}{rrrrrr}-3&2&-1&1&0&0\\0&-2&5&2&1&0\\0&0&-2&-1&-1&1\end{array}\right)\to\left(\begin{array}{rrrrrr}-3&0&4&3&1&0\\0&-2&5&2&1&0\\0&0&-2&-1&-1&1\end{array}\right)\to \\ \left(\begin{array}{rrrrrr}-3&0&0&1&-1&2\\0&-2&0&-1/2&-3/2&5/2\\0&0&-2&-1&-1&1\end{array}\right)\to\left(\begin{array}{rrrrrr}1&0&0&-1/3&1/3&-2/3 \\ 0&1&0&1/4&3/4&-5/4 \\ 0&0&1&1/2&1/2&-1/2\end{array}\right)\end{array}\nonumber \]
and one can check that
\[\left(\begin{array}{rrr}-3&2&-1\\6&-6&7\\3&-4&4\end{array}\right)\left(\begin{array}{rrr}-1/3&1/3&-2/3 \\ 1/4&3/4&-5/4 \\ 1/2&1/2&-1/2\end{array}\right)=\left(\begin{array}{ccc}1&0&0\\0&1&0\\0&0&1\end{array}\right).\nonumber \]
It is also interesting to check that the solution to the equation \(\text{Ax} = \text{b}\) is \(\text{x} = \text{A}^{−1}\text{b}\). Using the \(\text{b}\) from our first example, we have
\[\text{x}=\left(\begin{array}{rrr}-1/3&1/3&-2/3 \\ 1/4&3/4&-5/4 \\ 1/2&1/2&-1/2\end{array}\right)\left(\begin{array}{r}-1\\-7\\-6\end{array}\right)=\left(\begin{array}{r}2\\2\\-1\end{array}\right),\nonumber \]
as obtained previously.