Computing the Inverse of a Matrix

E. L. Lady

General Principle. If the left-hand factor A in a product AB is changed by doing an elementary row operation, then the product AB will be changed by the same elementary row operation.

Problem. To find X such that AX = I, where A = [ \begin{matrix}1 & 1 & 1 \\ 0 & 2 & 3 \\ 5 & 5 & 1 \end{matrix} ]. The method

is to do elementary row operations until A is reduced to the identity matrix I, simulataneously doing the same sequence of elementary row operations to I.

AX = I

[ \begin{matrix}1 & 1 & 1 \\ 0 & 2 & 3 \\ 5 & 5 & 1 \end{matrix} ] X = [ \begin{matrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{matrix} ]

Add −5 times the first row to the third to get  [ \begin{matrix}1 & 1 & 1 \\ 0 & 2 & 3 \\ 0 & 0 & −4 \end{matrix} ] X = [ \begin{matrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ −5 & 0 & 1 \end{matrix} ]

Multiply the second row by \frac{1}{2} then multiply the third row by −\frac{1}{4} to get  [ \begin{matrix}1 & 1 & 1 \\ 0 & 1 & \frac{3}{2} \\ 0 & 0 & 1 \end{matrix} ] X = [ \begin{matrix}1 & 0 & 0 \\ 0 & \frac{1}{2} & 0 \\ \frac{5}{4} & 0 & −\frac{1}{4} \end{matrix} ]

Subtract the second row from the first to get  [ \begin{matrix}1 & 0 & −\frac{1}{2} \\ 0 & 1 & \frac{3}{2} \\ 0 & 0 & 1 \end{matrix} ] X = [ \begin{matrix}1 & −\frac{1}{2} & 0 \\ 0 & \frac{1}{2} & 0 \\ \frac{5}{4} & 0 & −\frac{1}{4} \end{matrix} ]

Add \frac{1}{2} the third row to the first. Then subtract \frac{3}{2} the third from from the second.  [ \begin{matrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{matrix} ] X = [ \begin{matrix}\frac{13}{8} & −\frac{1}{2} & −\frac{1}{8} \\ −\frac{15}{8} & \frac{1}{2} & \frac{3}{8} \\ \frac{5}{4} & 0 & −\frac{1}{4} \end{matrix} ]

Thus [ \begin{matrix}\frac{13}{8} & −\frac{1}{2} & −\frac{1}{8} \\ −\frac{15}{8} & \frac{1}{2} & \frac{3}{8} \\ \frac{5}{4} & 0 & −\frac{1}{4} \end{matrix} ] is the inverse of [ \begin{matrix}1 & 1 & 1 \\ 0 & 2 & 3 \\ 5 & 5 & 1 \end{matrix} ].

Problem. To find an n × n matrix X such that I = XA. The method is to start with the equation A = IA and successively do elementary row operations to both sides until we obtain the equation I = XA. Notice that the set of calculations is actually the same as that used to find X such that AX = I.

A = IA

[ \begin{matrix}1 & 1 & 1 \\ 0 & 2 & 3 \\ 5 & 5 & 1 \end{matrix} ] = [ \begin{matrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{matrix} ] [ \begin{matrix}1 & 1 & 1 \\ 0 & 2 & 3 \\ 5 & 5 & 1 \end{matrix} ]

Add −5 times the first row to the third to get  [ \begin{matrix}1 & 1 & 1 \\ 0 & 2 & 3 \\ 0 & 0 & −4 \end{matrix} ] = [ \begin{matrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ −5 & 0 & 1 \end{matrix} ] [ \begin{matrix}1 & 1 & 1 \\ 0 & 2 & 3 \\ 5 & 5 & 1 \end{matrix} ]

Multiply the second row by \frac{1}{2} then multiply the third row by −\frac{1}{4} to get  [ \begin{matrix}1 & 1 & 1 \\ 0 & 1 & \frac{3}{2} \\ 0 & 0 & 1 \end{matrix} ] = [ \begin{matrix}1 & 0 & 0 \\ 0 & \frac{1}{2} & 0 \\ \frac{5}{4} & 0 & −\frac{1}{4} \end{matrix} ] [ \begin{matrix}1 & 1 & 1 \\ 0 & 2 & 3 \\ 5 & 5 & 1 \end{matrix} ]

Subtract the second row from the first to get  [ \begin{matrix}1 & 0 & −\frac{1}{2} \\ 0 & 1 & \frac{3}{2} \\ 0 & 0 & 1 \end{matrix} ] = [ \begin{matrix}1 & −\frac{1}{2} & 0 \\ 0 & \frac{1}{2} & 0 \\ \frac{5}{4} & 0 & −\frac{1}{4} \end{matrix} ] [ \begin{matrix}1 & 1 & 1 \\ 0 & 2 & 3 \\ 5 & 5 & 1 \end{matrix} ]

Add \frac{1}{2} the third row to the first. Then subtract \frac{3}{2} the third from from the second.  [ \begin{matrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{matrix} ] = [ \begin{matrix}\frac{13}{8} & −\frac{1}{2} & −\frac{1}{8} \\ −\frac{15}{8} & \frac{1}{2} & \frac{3}{8} \\ \frac{5}{4} & 0 & −\frac{1}{4} \end{matrix} ] [ \begin{matrix}1 & 1 & 1 \\ 0 & 2 & 3 \\ 5 & 5 & 1 \end{matrix} ]

I = [ \begin{matrix}\frac{13}{8} & −\frac{1}{2} & −\frac{1}{8} \\ −\frac{15}{8} & \frac{1}{2} & \frac{3}{8} \\ \frac{5}{4} & 0 & −\frac{1}{4} \end{matrix} ] A

(Notice that the right-hand factor on the right hand side never changes.)

Thus [ \begin{matrix}\frac{13}{8} & −\frac{1}{2} & −\frac{1}{8} \\ −\frac{15}{8} & \frac{1}{2} & \frac{3}{8} \\ \frac{5}{4} & 0 & −\frac{1}{4} \end{matrix} ] is the inverse of [ \begin{matrix}1 & 1 & 1 \\ 0 & 2 & 3 \\ 5 & 5 & 1 \end{matrix} ].