## SectionMISLEMatrix Inverses and Systems of Linear Equations

The inverse of a square matrix, and solutions to linear systems with square coefficient matrices, are intimately connected.

### SubsectionSISolutions and Inverses

We begin with a familiar example, performed in a novel way.

Archetype B is the system of $$m=3$$ linear equations in $$n=3$$ variables

\begin{align*} -7x_1 -6 x_2 - 12x_3 &=-33\\ 5x_1 + 5x_2 + 7x_3 &=24\\ x_1 +4x_3 &=5\text{.} \end{align*}

By Theorem SLEMM we can represent this system of equations as $$A\vect{x}=\vect{b}\text{,}$$ where

\begin{align*} A=\begin{bmatrix} -7&-6&-12\\ 5&5&7\\ 1&0&4 \end{bmatrix}&& \vect{x}=\colvector{x_1\\x_2\\x_3}&& \vect{b}=\colvector{-33\\24\\5}\text{.} \end{align*}

Now, entirely unmotivated, we define the $$3\times 3$$ matrix $$B\text{,}$$

\begin{equation*} B=\begin{bmatrix} -10 & -12 & -9\\ \frac{13}{2} & 8 & \frac{11}{2}\\ \frac{5}{2} & 3 & \frac{5}{2} \end{bmatrix} \end{equation*}

and note the remarkable fact that

\begin{equation*} BA=\begin{bmatrix} -10 & -12 & -9\\ \frac{13}{2} & 8 & \frac{11}{2}\\ \frac{5}{2} & 3 & \frac{5}{2} \end{bmatrix}\begin{bmatrix} -7&-6&-12\\ 5&5&7\\ 1&0&4 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1 \end{bmatrix}\text{.} \end{equation*}

Now apply this computation to the problem of solving the system of equations

\begin{align*} \vect{x}&=I_3\vect{x}&& \knowl{./knowl/theorem-MMIM.html}{\text{Theorem MMIM}}\\ &=(BA)\vect{x}&&\text{Substitution}\\ &=B(A\vect{x})&& \knowl{./knowl/theorem-MMA.html}{\text{Theorem MMA}}\\ &=B\vect{b}&&\text{Substitution}\text{.} \end{align*}

So we have

\begin{equation*} \vect{x}=B\vect{b}=\begin{bmatrix} -10 & -12 & -9\\ \frac{13}{2} & 8 & \frac{11}{2}\\ \frac{5}{2} & 3 & \frac{5}{2} \end{bmatrix}\colvector{-33\\24\\5}= \colvector{-3\\5\\2}\text{.} \end{equation*}

So with the help and assistance of $$B$$ we have been able to determine a solution to the system represented by $$A\vect{x}=\vect{b}$$ through judicious use of matrix multiplication. We know by Theorem NMUS that since the coefficient matrix in this example is nonsingular, there would be a unique solution, no matter what the choice of $$\vect{b}\text{.}$$ The derivation above amplifies this result, since we were forced to conclude that $$\vect{x}=B\vect{b}$$ and the solution could not be anything else. You should notice that this argument would hold for any particular choice of $$\vect{b}\text{.}$$

The matrix $$B$$ of the previous example is called the inverse of $$A\text{.}$$ When $$A$$ and $$B$$ are combined via matrix multiplication, the result is the identity matrix, which can be inserted “in front” of $$\vect{x}$$ as the first step in finding the solution. This is entirely analogous to how we might solve a single linear equation like $$3x=12\text{.}$$

\begin{equation*} x=1x=\left(\frac{1}{3}\left(3\right)\right)x=\frac{1}{3}\left(3x\right)=\frac{1}{3}\left(12\right)=4 \end{equation*}

Here we have obtained a solution by employing the “multiplicative inverse” of $$3\text{,}$$ $$3^{-1}=\frac{1}{3}\text{.}$$ This works fine for any scalar multiple of $$x\text{,}$$ except for zero, since zero does not have a multiplicative inverse. Consider separately the two linear equations

\begin{align*} 0x&=12 & 0x&=0\text{.} \end{align*}

The first has no solutions, while the second has infinitely many solutions. For matrices, it is all just a little more complicated. Some matrices have inverses, some do not. And when a matrix does have an inverse, just how would we compute it? In other words, just where did that matrix $$B$$ in the last example come from? Are there other matrices that might have worked just as well?

### SubsectionIMInverse of a Matrix

#### DefinitionMI.Matrix Inverse.

Suppose $$A$$ and $$B$$ are square matrices of size $$n$$ such that $$AB=I_n$$ and $$BA=I_n\text{.}$$ Then $$A$$ is invertible and $$B$$ is the inverse of $$A\text{.}$$ In this situation, we write $$B=\inverse{A}\text{.}$$

Notice that if $$B$$ is the inverse of $$A\text{,}$$ then we can just as easily say $$A$$ is the inverse of $$B\text{,}$$ or $$A$$ and $$B$$ are inverses of each other.

Not every square matrix has an inverse. In Example SABMI the matrix $$B$$ is the inverse of the coefficient matrix of Archetype B. To see this it only remains to check that $$AB=I_3\text{.}$$ What about Archetype A? It is an example of a square matrix without an inverse.

Consider the coefficient matrix from Archetype A.

\begin{equation*} A=\begin{bmatrix} 1 & -1 & 2\\ 2 & 1 & 1\\ 1 & 1 & 0 \end{bmatrix} \end{equation*}

We will show that $$A$$ is a matrix with no inverse, with a proof by contradiction. To this end, suppose that $$A$$ is invertible, and call its inverse the matrix $$B\text{.}$$ Choose the vector of constants

\begin{equation*} \vect{b}=\colvector{1\\3\\2} \end{equation*}

and consider the system of equations $$\linearsystem{A}{\vect{b}}\text{.}$$ We could now proceed exactly as we did in Example SABMI, and employ the matrix $$B$$ to determine a unique solution to this vector equation. Namely, the solution would be $$\vect{x}=B\vect{b}\text{.}$$ In other words, the system is consistent.

However, we will now show the system $$\linearsystem{A}{\vect{b}}$$ has no solutions. In other words, this system is inconsistent. Form the augmented matrix $$\augmented{A}{\vect{b}}$$ and row-reduce to

\begin{equation*} \begin{bmatrix} \leading{1} & 0 & 1 & 0\\ 0 & \leading{1} & -1 & 0\\ 0 & 0 & 0 & \leading{1} \end{bmatrix} \end{equation*}

which allows us to recognize the inconsistency by Theorem RCLS.

So the assumption of $$A$$'s inverse leads to a logical inconsistency as the system cannot be both consistent and inconsistent. So our assumption of an inverse is false, and $$A$$ is a matrix with no inverse (provably). So we say $$A$$ is not invertible.

It is possible this example is less than satisfying. Just where did that particular choice of the vector $$\vect{b}$$ come from anyway? Stay tuned for an application of the future Theorem CSCS in Example CSAA.

Let us look at one more matrix inverse before we embark on a more systematic study.

Consider the matrices

\begin{align*} A&= \begin{bmatrix} 1 & 2 & 1 & 2 & 1 \\ -2 & -3 & 0 & -5 & -1 \\ 1 & 1 & 0 & 2 & 1 \\ -2 & -3 & -1 & -3 & -2 \\ -1 & -3 & -1 & -3 & 1 \end{bmatrix} & B&= \begin{bmatrix} -3 & 3 & 6 & -1 & -2 \\ 0 & -2 & -5 & -1 & 1 \\ 1 & 2 & 4 & 1 & -1 \\ 1 & 0 & 1 & 1 & 0 \\ 1 & -1 & -2 & 0 & 1 \end{bmatrix}\text{.} \end{align*}

Then

\begin{align*} AB &= \begin{bmatrix} 1 & 2 & 1 & 2 & 1 \\ -2 & -3 & 0 & -5 & -1 \\ 1 & 1 & 0 & 2 & 1 \\ -2 & -3 & -1 & -3 & -2 \\ -1 & -3 & -1 & -3 & 1 \end{bmatrix} \begin{bmatrix} -3 & 3 & 6 & -1 & -2 \\ 0 & -2 & -5 & -1 & 1 \\ 1 & 2 & 4 & 1 & -1 \\ 1 & 0 & 1 & 1 & 0 \\ 1 & -1 & -2 & 0 & 1 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 & 0 & 0\\ 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 0 & 1 \end{bmatrix}\\ \end{align*}

and

\begin{align*} BA &= \begin{bmatrix} -3 & 3 & 6 & -1 & -2 \\ 0 & -2 & -5 & -1 & 1 \\ 1 & 2 & 4 & 1 & -1 \\ 1 & 0 & 1 & 1 & 0 \\ 1 & -1 & -2 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 2 & 1 & 2 & 1 \\ -2 & -3 & 0 & -5 & -1 \\ 1 & 1 & 0 & 2 & 1 \\ -2 & -3 & -1 & -3 & -2 \\ -1 & -3 & -1 & -3 & 1 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 & 0 & 0\\ 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 0 & 1 \end{bmatrix} \end{align*}

so by Definition MI, we can say that $$A$$ is invertible and write $$B=\inverse{A}\text{.}$$

We will now concern ourselves less with whether or not an inverse of a matrix exists, but instead with how you can find one when it does exist. In Section MINM we will have some theorems that allow us to more quickly and easily determine just when a matrix is invertible.

### SubsectionCIMComputing the Inverse of a Matrix

We have seen that the matrices from Archetype B and Archetype K both have inverses, but these inverse matrices have just dropped from the sky. How would we compute an inverse? And just when is a matrix invertible, and when is it not? Writing a putative inverse with $$n^2$$ unknowns and solving the resulting $$n^2$$ equations is one approach. Applying this approach to $$2\times 2$$ matrices can get us somewhere, so just for fun, let us do it.

##### (⇐)

Assume that $$ad-bc\neq 0\text{.}$$ We will use the definition of the inverse of a matrix to establish that $$A$$ has an inverse (Definition MI). Note that if $$ad-bc\neq 0$$ then the displayed formula for $$\inverse{A}$$ is legitimate since we are not dividing by zero). Using this proposed formula for the inverse of $$A\text{,}$$ we simply compute

and

By Definition MI this is sufficient to establish that $$A$$ is invertible, and that the expression for $$\inverse{A}$$ is correct.

##### (⇒)

Assume that $$A$$ is invertible, and proceed with a proof by contradiction (Proof Technique CD), by assuming also that $$ad-bc=0\text{.}$$ This translates to $$ad=bc\text{.}$$ Let

\begin{equation*} B= \begin{bmatrix} e&f\\ g&h \end{bmatrix} \end{equation*}

be a putative inverse of $$A\text{.}$$

This means that

\begin{equation*} I_2=AB= \begin{bmatrix} a&b\\ c&d \end{bmatrix} \begin{bmatrix} e&f\\ g&h \end{bmatrix} = \begin{bmatrix} ae+bg & af+bh\\ ce+dg & cf+dh \end{bmatrix} \end{equation*}

Working on the matrices on the two ends of this equation, we will multiply the top row by $$c$$ and the bottom row by $$a\text{.}$$

\begin{equation*} \begin{bmatrix} c&0\\ 0&a \end{bmatrix} = \begin{bmatrix} ace+bcg & acf+bch\\ ace+adg & acf+adh \end{bmatrix} \end{equation*}

We are assuming that $$ad=bc\text{,}$$ so we can replace two occurrences of $$ad$$ by $$bc$$ in the bottom row of the right matrix.

\begin{equation*} \begin{bmatrix} c&0\\ 0&a \end{bmatrix} = \begin{bmatrix} ace+bcg & acf+bch\\ ace+bcg & acf+bch \end{bmatrix} \end{equation*}

The matrix on the right now has two rows that are identical, and therefore the same must be true of the matrix on the left. Identical rows for the matrix on the left implies that $$a=0$$ and $$c=0\text{.}$$

With this information, the product $$AB$$ becomes

\begin{equation*} \begin{bmatrix} 1 & 0\\ 0 & 1 \end{bmatrix} =I_2 =AB = \begin{bmatrix} ae+bg & af+bh\\ ce+dg & cf+dh \end{bmatrix} = \begin{bmatrix} bg & bh\\ dg & dh \end{bmatrix} \end{equation*}

So $$bg=dh=1$$ and thus $$b,g,d,h$$ are all nonzero. But then $$bh$$ and $$dg$$ (the “other corners”) must also be nonzero, so this is (finally) a contradiction. So our assumption was false and we see that $$ad-bc\neq 0$$ whenever $$A$$ has an inverse.

There are several ways one could try to prove this theorem, but there is a continual temptation to divide by one of the eight entries involved ($$a$$ through $$f$$), but we can never be sure if these numbers are zero or not. This could lead to an analysis by cases, which is messy, messy, messy. Note how the above proof never divides, but always multiplies, and how zero/nonzero considerations are handled. Pay attention to the expression $$ad-bc\text{,}$$ as we will see it again in a while (Chapter D).

This theorem is cute, and it is nice to have a formula for the inverse, and a condition that tells us when we can use it. However, this approach becomes impractical for larger matrices, even though it is possible to demonstrate that, in theory, there is a general formula. (Think for a minute about extending this result to just $$3\times 3$$ matrices. For starters, we need 18 letters!) Instead, we will work column-by-column. Let us first work an example that will motivate the main theorem and remove some of the previous mystery.

Consider the matrix defined in Example MI.

\begin{equation*} A= \begin{bmatrix} 1 & 2 & 1 & 2 & 1 \\ -2 & -3 & 0 & -5 & -1 \\ 1 & 1 & 0 & 2 & 1 \\ -2 & -3 & -1 & -3 & -2 \\ -1 & -3 & -1 & -3 & 1 \end{bmatrix} \end{equation*}

For its inverse, we desire a matrix $$B$$ so that $$AB=I_5\text{.}$$ Emphasizing the structure of the columns and employing the definition of matrix multiplication (Definition MM), we have

\begin{align*} AB&=I_5\\ A\lbrack \vect{B}_1|\vect{B}_2|\vect{B}_3|\vect{B}_4|\vect{B}_5]&=[\vect{e}_1|\vect{e}_2|\vect{e}_3|\vect{e}_4|\vect{e}_5\rbrack\\ \lbrack A\vect{B}_1|A\vect{B}_2|A\vect{B}_3|A\vect{B}_4|A\vect{B}_5]&=[\vect{e}_1|\vect{e}_2|\vect{e}_3|\vect{e}_4|\vect{e}_5\rbrack\text{.} \end{align*}

Equating the matrices column-by-column we have

\begin{align*} A\vect{B}_1=\vect{e}_1&& A\vect{B}_2=\vect{e}_2&& A\vect{B}_3=\vect{e}_3&& A\vect{B}_4=\vect{e}_4&& A\vect{B}_5=\vect{e}_5\text{.} \end{align*}

Since the matrix $$B$$ is what we are trying to compute, we can view each column, $$\vect{B}_i\text{,}$$ as a column vector of unknowns in a linear system of equations. Then we have five systems of equations to solve, each with 5 equations in 5 variables. Notice that all 5 of these systems have the same coefficient matrix. We will now solve each system in turn.

\begin{align*} \end{align*}

Row-reduce the augmented matrix of the linear system $$\linearsystem{A}{\vect{e}_1}\text{,}$$

\begin{align*} \begin{bmatrix} 1 & 2 & 1 & 2 & 1 & 1\\ -2 & -3 & 0 & -5 & -1 & 0\\ 1 & 1 & 0 & 2 & 1 & 0\\ -2 & -3 & -1 & -3 & -2 & 0\\ -1 & -3 & -1 & -3 & 1 & 0 \end{bmatrix} \rref \begin{bmatrix} \leading{1} & 0 & 0 & 0 & 0 & -3\\ 0 & \leading{1} & 0 & 0 & 0 & 0\\ 0 & 0 & \leading{1} & 0 & 0 & 1\\ 0 & 0 & 0 & \leading{1} & 0 & 1\\ 0 & 0 & 0 & 0 & \leading{1} & 1 \end{bmatrix} ; \vect{B}_1=\colvector{-3\\0\\1\\1\\1}\\ \end{align*}

Row-reduce the augmented matrix of the linear system $$\linearsystem{A}{\vect{e}_2}\text{,}$$

\begin{align*} \begin{bmatrix} 1 & 2 & 1 & 2 & 1 & 0\\ -2 & -3 & 0 & -5 & -1 & 1\\ 1 & 1 & 0 & 2 & 1 & 0\\ -2 & -3 & -1 & -3 & -2 & 0\\ -1 & -3 & -1 & -3 & 1 & 0 \end{bmatrix} \rref \begin{bmatrix} \leading{1} & 0 & 0 & 0 & 0 & 3\\ 0 & \leading{1} & 0 & 0 & 0 & -2\\ 0 & 0 & \leading{1} & 0 & 0 & 2\\ 0 & 0 & 0 & \leading{1} & 0 & 0\\ 0 & 0 & 0 & 0 & \leading{1} & -1 \end{bmatrix} ; \vect{B}_2=\colvector{3\\-2\\2\\0\\-1}\\ \end{align*}

Row-reduce the augmented matrix of the linear system $$\linearsystem{A}{\vect{e}_3}\text{,}$$

\begin{align*} \begin{bmatrix} 1 & 2 & 1 & 2 & 1 & 0\\ -2 & -3 & 0 & -5 & -1 & 0\\ 1 & 1 & 0 & 2 & 1 & 1\\ -2 & -3 & -1 & -3 & -2 & 0\\ -1 & -3 & -1 & -3 & 1 & 0 \end{bmatrix} \rref \begin{bmatrix} \leading{1} & 0 & 0 & 0 & 0 & 6\\ 0 & \leading{1} & 0 & 0 & 0 & -5\\ 0 & 0 & \leading{1} & 0 & 0 & 4\\ 0 & 0 & 0 & \leading{1} & 0 & 1\\ 0 & 0 & 0 & 0 & \leading{1} & -2 \end{bmatrix} ; \vect{B}_3=\colvector{6\\-5\\4\\1\\-2}\\ \end{align*}

Row-reduce the augmented matrix of the linear system $$\linearsystem{A}{\vect{e}_4}\text{,}$$

\begin{align*} \begin{bmatrix} 1 & 2 & 1 & 2 & 1 & 0\\ -2 & -3 & 0 & -5 & -1 & 0\\ 1 & 1 & 0 & 2 & 1 & 0\\ -2 & -3 & -1 & -3 & -2 & 1\\ -1 & -3 & -1 & -3 & 1 & 0 \end{bmatrix} \rref \begin{bmatrix} \leading{1} & 0 & 0 & 0 & 0 & -1\\ 0 & \leading{1} & 0 & 0 & 0 & -1\\ 0 & 0 & \leading{1} & 0 & 0 & 1\\ 0 & 0 & 0 & \leading{1} & 0 & 1\\ 0 & 0 & 0 & 0 & \leading{1} & 0 \end{bmatrix} ; \vect{B}_4=\colvector{-1\\-1\\1\\1\\0}\\ \end{align*}

Row-reduce the augmented matrix of the linear system $$\linearsystem{A}{\vect{e}_5}\text{,}$$

\begin{align*} \begin{bmatrix} 1 & 2 & 1 & 2 & 1 & 0\\ -2 & -3 & 0 & -5 & -1 & 0\\ 1 & 1 & 0 & 2 & 1 & 0\\ -2 & -3 & -1 & -3 & -2 & 0\\ -1 & -3 & -1 & -3 & 1 & 1 \end{bmatrix} \rref \begin{bmatrix} \leading{1} & 0 & 0 & 0 & 0 & -2\\ 0 & \leading{1} & 0 & 0 & 0 & 1\\ 0 & 0 & \leading{1} & 0 & 0 & -1\\ 0 & 0 & 0 & \leading{1} & 0 & 0\\ 0 & 0 & 0 & 0 & \leading{1} & 1 \end{bmatrix} ; \vect{B}_5=\colvector{-2\\1\\-1\\0\\1} \end{align*}

We can now collect our 5 solution vectors into the matrix $$B\text{,}$$

\begin{align*} B= &[\vect{B}_1|\vect{B}_2|\vect{B}_3|\vect{B}_4|\vect{B}_5]\\ =& \left[\colvector{-3\\0\\1\\1\\1} \left\lvert\colvector{3\\-2\\2\\0\\-1}\right. \left\lvert\colvector{6\\-5\\4\\1\\-2}\right. \left\lvert\colvector{-1\\-1\\1\\1\\0}\right. \left\lvert\colvector{-2\\1\\-1\\0\\1}\right. \right] = \begin{bmatrix} -3 & 3 & 6 & -1 & -2 \\ 0 & -2 & -5 & -1 & 1 \\ 1 & 2 & 4 & 1 & -1 \\ 1 & 0 & 1 & 1 & 0 \\ 1 & -1 & -2 & 0 & 1 \end{bmatrix}\text{.} \end{align*}

By this method, we know that $$AB=I_5\text{.}$$ Check that $$BA=I_5\text{,}$$ and then we will know that we have the inverse of $$A\text{.}$$

Notice how the five systems of equations in the preceding example were all solved by exactly the same sequence of row operations. Would it not be nice to avoid this obvious duplication of effort? Our main theorem for this section follows, and it mimics this previous example, while also avoiding all the overhead.

$$A$$ is nonsingular, so by Theorem NMRRI there is a sequence of row operations that will convert $$A$$ into $$I_n\text{.}$$ It is this same sequence of row operations that will convert $$M$$ into $$N\text{,}$$ since having the identity matrix in the first $$n$$ columns of $$N$$ is sufficient to guarantee that $$N$$ is in reduced row-echelon form.

If we consider the systems of linear equations, $$\linearsystem{A}{\vect{e}_i}\text{,}$$ $$1\leq i\leq n\text{,}$$ we see that the aforementioned sequence of row operations will also bring the augmented matrix of each of these systems into reduced row-echelon form. Furthermore, the unique solution to $$\linearsystem{A}{\vect{e}_i}$$ appears in column $$n+1$$ of the row-reduced augmented matrix of the system and is identical to column $$n+i$$ of $$N\text{.}$$ Let $$\vectorlist{N}{2n}$$ denote the columns of $$N\text{.}$$ So we find,

\begin{align*} AJ=&A[\vect{N}_{n+1}|\vect{N}_{n+2}|\vect{N}_{n+3}|\ldots|\vect{N}_{n+n}]\\ =&[A\vect{N}_{n+1}|A\vect{N}_{n+2}|A\vect{N}_{n+3}|\ldots|A\vect{N}_{n+n}]&& \knowl{./knowl/definition-MM.html}{\text{Definition MM}}\\ =&[\vect{e}_1|\vect{e}_2|\vect{e}_3|\ldots|\vect{e}_n]\\ =&I_n&& \knowl{./knowl/definition-IM.html}{\text{Definition IM}} \end{align*}

as desired.

We have to be just a bit careful here about both what this theorem says and what it does not say. If $$A$$ is a nonsingular matrix, then we are guaranteed a matrix $$B$$ such that $$AB=I_n\text{,}$$ and the proof gives us a process for constructing $$B\text{.}$$ However, the definition of the inverse of a matrix (Definition MI) requires that $$BA=I_n$$ also. So at this juncture we must compute the matrix product in the “opposite” order before we claim $$B$$ as the inverse of $$A\text{.}$$ However, we will soon see that this is always the case, in Theorem OSIS, so the title of this theorem is not inaccurate.

What if $$A$$ is singular? At this point we only know that Theorem CINM cannot be applied. The question of $$A$$'s inverse is still open. (But see Theorem NI in the next section.)

We will finish by computing the inverse for the coefficient matrix of Archetype B, the one we just pulled from a hat in Example SABMI. There are more examples in the Archetypes (Appendix A) to practice with, though notice that it is silly to ask for the inverse of a rectangular matrix (the sizes are not right) and not every square matrix has an inverse (remember Example MWIAA?).

Archetype B has a coefficient matrix given as

\begin{align*} B=& \begin{bmatrix} -7&-6&-12\\ 5&5&7\\ 1&0&4 \end{bmatrix}\\ \end{align*}

Exercising Theorem CINM we set $$M$$ and row-reduce,

\begin{align*} M=& \begin{bmatrix} -7&-6&-12&1&0&0\\ 5&5&7&0&1&0\\ 1&0&4&0&0&1 \end{bmatrix} &\rref N=& \begin{bmatrix} 1&0&0&-10 & -12 & -9\\ 0&1&0&\frac{13}{2} & 8 & \frac{11}{2}\\ 0&0&1&\frac{5}{2} & 3 & \frac{5}{2} \end{bmatrix}\\ \end{align*}

So

\begin{align*} \inverse{B}=& \begin{bmatrix} -10 & -12 & -9\\ \frac{13}{2} & 8 & \frac{11}{2}\\ \frac{5}{2} & 3 & \frac{5}{2} \end{bmatrix} \end{align*}

once we check that $$\inverse{B}B=I_3$$ (the product in the opposite order is a consequence of the theorem).

#### SageMISLE.Matrix Inverse, Systems of Equations.

We can use the computational method described in this section in hopes of finding a matrix inverse, as Theorem CINM gets us halfway there. We will continue with the matrix from Example MI. First we check that the matrix is nonsingular so we can apply the theorem, then we get “half” an inverse, and verify that it also behaves as a “full” inverse by meeting the full definition of a matrix inverse (Definition MI).

A = matrix(QQ, [[ 1,  2,  1,  2,  1],
[-2, -3,  0, -5, -1],
[ 1,  1,  0,  2,  1],
[-2, -3, -1, -3, -2],
[-1, -3, -1, -3,  1]])
A.is_singular()

I5 = identity_matrix(5)
M = A.augment(I5); M

N = M.rref(); N

J = N.matrix_from_columns(range(5,10)); J

A*J == I5

J*A == I5


Note that the matrix Jis constructed by taking the last 5 columns of N(numbered 5 through 9) and using them in the matrix_from_columns()matrix method. What happens if you apply the procedure above to a singular matrix? That would be an instructive experiment to conduct.

With an inverse of a coefficient matrix in hand, we can easily solve systems of equations, in the style of Example SABMI. We will recycle the matrices Aand its inverse, J, from above, so be sure to run those compute cells first if you are playing along. We consider a system with Aas a coefficient matrix and solve a linear system twice, once the old way and once the new way. Recall that with a nonsingular coefficient matrix, the solution will be unique for any choice of const, so you can experiment by changing the vector of constants and re-executing the code.

const = vector(QQ, [3, -4, 2, 1, 1])
A.solve_right(const)

J*const

A.solve_right(const) == J*const


### SubsectionPMIProperties of Matrix Inverses

The inverse of a matrix enjoys some nice properties. We collect a few here. First, a matrix can have but one inverse.

As described in Proof Technique U, we will assume that $$A$$ has two inverses. The hypothesis tells there is at least one. Suppose then that $$B$$ and $$C$$ are both inverses for $$A\text{,}$$ so we know by Definition MI that $$AB=BA=I_n$$ and $$AC=CA=I_n\text{.}$$ Then we have

\begin{align*} B &=BI_n&& \knowl{./knowl/theorem-MMIM.html}{\text{Theorem MMIM}}\\ &=B(AC)&& \knowl{./knowl/definition-MI.html}{\text{Definition MI}}\\ &=(BA)C&& \knowl{./knowl/theorem-MMA.html}{\text{Theorem MMA}}\\ &=I_nC&& \knowl{./knowl/definition-MI.html}{\text{Definition MI}}\\ &=C&& \knowl{./knowl/theorem-MMIM.html}{\text{Theorem MMIM}}\text{.} \end{align*}

So we conclude that $$B$$ and $$C$$ are the same, and cannot be different. So any matrix that acts like an inverse, must be the inverse.

When most of us dress in the morning, we put on our socks first, followed by our shoes. In the evening we must then first remove our shoes, followed by our socks. Try to connect the conclusion of the following theorem with this everyday example.

At the risk of carrying our everyday analogies too far, the proof of this theorem is quite easy when we compare it to the workings of a dating service. We have a statement about the inverse of the matrix $$AB\text{,}$$ which for all we know right now might not even exist. Suppose $$AB$$ was to sign up for a dating service with two requirements for a compatible date. Upon multiplication on the left, and on the right, the result should be the identity matrix. In other words, $$AB$$'s ideal date would be its inverse.

Now along comes the matrix $$\inverse{B}\inverse{A}$$ (which we know exists because our hypothesis says both $$A$$ and $$B$$ are invertible and we can form the product of these two matrices), also looking for a date. Let us see if $$\inverse{B}\inverse{A}$$ is a good match for $$AB\text{.}$$ First they meet at a noncommittal neutral location, say a coffee shop, for quiet conversation,

\begin{align*} (\inverse{B}\inverse{A})(AB) &=\inverse{B}(\inverse{A}A)B&& \knowl{./knowl/theorem-MMA.html}{\text{Theorem MMA}}\\ &=\inverse{B}I_nB&& \knowl{./knowl/definition-MI.html}{\text{Definition MI}}\\ &=\inverse{B}B&& \knowl{./knowl/theorem-MMIM.html}{\text{Theorem MMIM}}\\ &=I_n&& \knowl{./knowl/definition-MI.html}{\text{Definition MI}}\\ \end{align*}

The first date having gone smoothly, a second, more serious, date is arranged, say dinner and a show,

\begin{align*} (AB)(\inverse{B}\inverse{A}) &=A(B\inverse{B})\inverse{A}&& \knowl{./knowl/theorem-MMA.html}{\text{Theorem MMA}}\\ &=AI_n\inverse{A}&& \knowl{./knowl/definition-MI.html}{\text{Definition MI}}\\ &=A\inverse{A}&& \knowl{./knowl/theorem-MMIM.html}{\text{Theorem MMIM}}\\ &=I_n&& \knowl{./knowl/definition-MI.html}{\text{Definition MI}} \end{align*}

So the matrix $$\inverse{B}\inverse{A}$$ has met all of the requirements to be $$AB$$'s inverse (date) and with the ensuing marriage proposal we can announce that $$\inverse{(AB)}=\inverse{B}\inverse{A}\text{.}$$

As with the proof of Theorem SS, we examine if $$A$$ is a suitable inverse for $$\inverse{A}$$ (by definition, the opposite is true).

\begin{align*} A\inverse{A}&=I_n&& \knowl{./knowl/definition-MI.html}{\text{Definition MI}}\\ \end{align*}

and

\begin{align*} \inverse{A}A&=I_n&& \knowl{./knowl/definition-MI.html}{\text{Definition MI}} \end{align*}

The matrix $$A$$ has met all the requirements to be the inverse of $$\inverse{A}\text{,}$$ and so is invertible and we can write $$A=\inverse{(\inverse{A})}\text{.}$$

As with the proof of Theorem SS, we see if $$\transpose{(\inverse{A})}$$ is a suitable inverse for $$\transpose{A}\text{.}$$ Apply Theorem MMT to see that

\begin{align*} \transpose{(\inverse{A})}\transpose{A} &=\transpose{(A\inverse{A})}&& \knowl{./knowl/theorem-MMT.html}{\text{Theorem MMT}}\\ &=\transpose{I_n}&& \knowl{./knowl/definition-MI.html}{\text{Definition MI}}\\ &=I_n&& \knowl{./knowl/definition-SYM.html}{\text{Definition SYM}}\\ \end{align*}

and

\begin{align*} \transpose{A}\transpose{(\inverse{A})} &=\transpose{(\inverse{A}A)}&& \knowl{./knowl/theorem-MMT.html}{\text{Theorem MMT}}\\ &=\transpose{I_n}&& \knowl{./knowl/definition-MI.html}{\text{Definition MI}}\\ &=I_n&& \knowl{./knowl/definition-SYM.html}{\text{Definition SYM}}\text{.} \end{align*}

The matrix $$\transpose{(\inverse{A})}$$ has met all the requirements to be the inverse of $$\transpose{A}\text{,}$$ and so is invertible and we can write $$\inverse{(\transpose{A})}=\transpose{(\inverse{A})}\text{.}$$

As with the proof of Theorem SS, we see if $$\frac{1}{\alpha}\inverse{A}$$ is a suitable inverse for $$\alpha A\text{.}$$

\begin{align*} \left(\frac{1}{\alpha}\inverse{A}\right)\left(\alpha A\right) &=\left(\frac{1}{\alpha}\alpha\right)\left(\inverse{A}A\right)&& \knowl{./knowl/theorem-MMSMM.html}{\text{Theorem MMSMM}}\\ &=1I_n&&\text{Scalar multiplicative inverses}\\ &=I_n&& \knowl{./knowl/property-OM.html}{\text{Property OM}}\\ \end{align*}

and

\begin{align*} \left(\alpha A\right)\left(\frac{1}{\alpha}\inverse{A}\right)&= \left(\alpha\frac{1}{\alpha}\right)\left(A\inverse{A}\right)&& \knowl{./knowl/theorem-MMSMM.html}{\text{Theorem MMSMM}}\\ &=1I_n&&\text{Scalar multiplicative inverses}\\ &=I_n&& \knowl{./knowl/property-OM.html}{\text{Property OM}} \end{align*}

The matrix $$\frac{1}{\alpha}\inverse{A}$$ has met all the requirements to be the inverse of $$\alpha A\text{,}$$ so we can write $$\inverse{\left(\alpha A\right)}=\frac{1}{\alpha}\inverse{A}\text{.}$$

Notice that there are some likely theorems that are missing here. For example, it would be tempting to think that $$\inverse{(A+B)}=\inverse{A}+\inverse{B}\text{,}$$ but this is false. Can you find a counterexample? (See Exercise MISLE.T10.)

#### 1.

Compute the inverse of the matrix below.

\begin{equation*} \begin{bmatrix} -2 & 3\\ -3 & 4 \end{bmatrix} \end{equation*}

#### 2.

Compute the inverse of the matrix below.

\begin{equation*} \begin{bmatrix} 2 & 3 & 1\\ 1 & -2 & -3\\ -2 & 4 & 6 \end{bmatrix} \end{equation*}

#### 3.

Explain why Theorem SS has the title it does. (Do not just state the theorem, explain the choice of the title making reference to the theorem itself.)

### ExercisesMISLEExercises

#### C16.

If it exists, find the inverse of $$A\text{,}$$ and check your answer.

\begin{equation*} A = \begin{bmatrix} 1 & 0 & 1 \\ 1 & 1 & 1 \\ 2 & -1 & 1\end{bmatrix} \end{equation*}
Solution.
\begin{equation*} \inverse{A} = \begin{bmatrix} -2 & 1 & 1 \\ -1 & 1 & 0 \\ 3 & -1 & -1 \end{bmatrix}\text{.} \end{equation*}

#### C17.

If it exists, find the inverse of $$A = \begin{bmatrix} 2 & -1 & 1\\ 1 & 2 & 1\\3 & 1 & 2\end{bmatrix}\text{,}$$ and check your answer.

Solution.

The procedure we have for finding a matrix inverse fails for this matrix $$A$$ since $$A$$ does not row-reduce to $$I_3\text{.}$$ We suspect in this case that $$A$$ is not invertible, although we do not yet know that concretely. (Stay tuned for upcoming revelations in Section MINM!)

#### C18.

If it exists, find the inverse of $$A = \begin{bmatrix} 1 & 3 & 1 \\ 1 & 2 & 1 \\ 2 & 2 & 1\end{bmatrix}\text{,}$$ and check your answer.

Solution.
\begin{equation*} \inverse{A} = \begin{bmatrix} 0 & -1 & 1\\ 1 & -1 & 0\\ -2 & 4 & -1 \end{bmatrix} \end{equation*}

#### C19.

If it exists, find the inverse of $$A = \begin{bmatrix} 1 & 3 & 1 \\ 0 & 2 & 1 \\ 2 & 2 & 1\end{bmatrix}\text{,}$$ and check your answer.

Solution.
\begin{equation*} \inverse{A} = \begin{bmatrix} 0 & -1/2 & 1/2\\ 1 & -1/2 & -1/2 \\ -2 & 2 & 1 \end{bmatrix} \end{equation*}

#### C21.

Verify that $$B$$ is the inverse of $$A\text{.}$$

\begin{align*} A&= \begin{bmatrix} 1 & 1 & -1 & 2\\ -2 & -1 & 2 & -3\\ 1 & 1 & 0 & 2\\ -1 & 2 & 0 & 2 \end{bmatrix} & B&= \begin{bmatrix} 4 & 2 & 0 & -1\\ 8 & 4 & -1 & -1\\ -1 & 0 & 1 & 0\\ -6 & -3 & 1 & 1 \end{bmatrix} \end{align*}
Solution.

Check that both matrix products (Definition MM) $$AB$$ and $$BA$$ equal the $$4\times 4$$ identity matrix $$I_4$$ (Definition IM).

#### C22.

Recycle the matrices $$A$$ and $$B$$ from Exercise MISLE.C21 and set

\begin{align*} \vect{c}&=\colvector{2\\1\\-3\\2}&\vect{d}&=\colvector{1\\1\\1\\1}\text{.} \end{align*}

Employ the matrix $$B$$ to solve the two linear systems $$\linearsystem{A}{\vect{c}}$$ and $$\linearsystem{A}{\vect{d}}\text{.}$$

Solution.

Represent each of the two systems by a vector equality, $$A\vect{x}=\vect{c}$$ and $$A\vect{y}=\vect{d}\text{.}$$ Then in the spirit of Example SABMI, solutions are given by

\begin{align*} \vect{x}&=B\vect{c}=\colvector{8\\21\\-5\\-16}& \vect{y}&=B\vect{d}=\colvector{5\\10\\0\\-7}\text{.} \end{align*}

Notice how we could solve many more systems having $$A$$ as the coefficient matrix, and how each such system has a unique solution. You might check your work by substituting the solutions back into the systems of equations, or forming the linear combinations of the columns of $$A$$ suggested by Theorem SLSLC.

#### C23.

If it exists, find the inverse of the $$2\times 2$$ matrix $$A$$ and check your answer. (See Theorem TTMI.)

\begin{align*} A=\begin{bmatrix} 7&3\\5&2 \end{bmatrix} \end{align*}

#### C24.

If it exists, find the inverse of the $$2\times 2$$ matrix $$A$$ and check your answer. (See Theorem TTMI.)

\begin{align*} A=\begin{bmatrix} 6&3\\4&2 \end{bmatrix} \end{align*}

#### C25.

At the conclusion of Example CMI, verify that $$BA=I_5$$ by computing the matrix product.

#### C26.

Let

\begin{equation*} D=\begin{bmatrix} 1 & -1 & 3 & -2 & 1\\ -2 & 3 & -5 & 3 & 0\\ 1 & -1 & 4 & -2 & 2\\ -1 & 4 & -1 & 0 & 4\\ 1 & 0 & 5 & -2 & 5 \end{bmatrix}\text{.} \end{equation*}

Compute the inverse of $$D\text{,}$$ $$\inverse{D}\text{,}$$ by forming the $$5\times 10$$ matrix $$\augmented{D}{I_5}$$ and row-reducing (Theorem CINM). Then use a calculator to compute $$\inverse{D}$$ directly.

Solution.

The inverse of $$D$$ is

\begin{equation*} \inverse{D}= \begin{bmatrix} -7 & -6 & -3 & 2 & 1\\ -7 & -4 & 2 & 2 & -1\\ -5 & -2 & 3 & 1 & -1\\ -6 & -3 & 1 & 1 & 0\\ 4 & 2 & -2 & -1 & 1 \end{bmatrix}\text{.} \end{equation*}

#### C27.

Let

\begin{equation*} E=\begin{bmatrix} 1 & -1 & 3 & -2 & 1\\ -2 & 3 & -5 & 3 & -1\\ 1 & -1 & 4 & -2 & 2\\ -1 & 4 & -1 & 0 & 2\\ 1 & 0 & 5 & -2 & 4 \end{bmatrix}\text{.} \end{equation*}

Compute the inverse of $$E\text{,}$$ $$\inverse{E}\text{,}$$ by forming the $$5\times 10$$ matrix $$\augmented{E}{I_5}$$ and row-reducing (Theorem CINM). Then use a calculator to compute $$\inverse{E}$$ directly.

Solution.

The matrix $$E$$ has no inverse, though we do not yet have a theorem that allows us to reach this conclusion. However, when row-reducing the matrix $$\augmented{E}{I_5}\text{,}$$ the first 5 columns will not row-reduce to the $$5\times 5$$ identity matrix, so we are at a loss on how we might compute the inverse. When requesting that your calculator compute $$\inverse{E}\text{,}$$ it should give some indication that $$E$$ does not have an inverse.

#### C28.

Let

\begin{equation*} C= \begin{bmatrix} 1 & 1 & 3 & 1\\ -2 & -1 & -4 & -1\\ 1 & 4 & 10 & 2\\ -2 & 0 & -4 & 5 \end{bmatrix} \end{equation*}

Compute the inverse of $$C\text{,}$$ $$\inverse{C}\text{,}$$ by forming the $$4\times 8$$ matrix $$\augmented{C}{I_4}$$ and row-reducing (Theorem CINM). Then use a calculator to compute $$\inverse{C}$$ directly.

Solution.

Employ Theorem CINM,

\begin{equation*} \begin{bmatrix} 1 & 1 & 3 & 1 & 1 & 0 & 0 & 0\\ -2 & -1 & -4 & -1 & 0 & 1 & 0 & 0\\ 1 & 4 & 10 & 2 & 0 & 0 & 1 & 0\\ -2 & 0 & -4 & 5 & 0 & 0 & 0 & 1 \end{bmatrix} \rref \begin{bmatrix} \leading{1} & 0 & 0 & 0 & 38 & 18 & -5 & -2\\ 0 & \leading{1} & 0 & 0 & 96 & 47 & -12 & -5\\ 0 & 0 & \leading{1} & 0 & -39 & -19 & 5 & 2\\ 0 & 0 & 0 & \leading{1} & -16 & -8 & 2 & 1 \end{bmatrix} \end{equation*}

And therefore we see that $$C$$ is nonsingular ($$C$$ row-reduces to the identity matrix, Theorem NMRRI) and by Theorem CINM,

\begin{equation*} \inverse{C}= \begin{bmatrix} 38 & 18 & -5 & -2\\ 96 & 47 & -12 & -5\\ -39 & -19 & 5 & 2\\ -16 & -8 & 2 & 1 \end{bmatrix} \end{equation*}

#### C40.

Find all solutions to the system of equations below, making use of the matrix inverse found in Exercise MISLE.C28.

\begin{align*} x_1+x_2+3x_3+x_4&=-4\\ -2x_1-x_2-4x_3-x_4&=4\\ x_1+4x_2+10x_3+2x_4&=-20\\ -2x_1-4x_3+5x_4&=9 \end{align*}
Solution.

View this system as $$\linearsystem{C}{\vect{b}}\text{,}$$ where $$C$$ is the $$4\times 4$$ matrix from Exercise MISLE.C28 and $$\vect{b}=\colvector{-4\\4\\-20\\9}\text{.}$$ Since $$C$$ was seen to be nonsingular in Exercise MISLE.C28 Theorem SNCM says the solution, which is unique by Theorem NMUS, is given by

\begin{equation*} \inverse{C}\vect{b}= \begin{bmatrix} 38 & 18 & -5 & -2\\ 96 & 47 & -12 & -5\\ -39 & -19 & 5 & 2\\ -16 & -8 & 2 & 1 \end{bmatrix} \colvector{-4\\4\\-20\\9} = \colvector{2\\-1\\-2\\1}\text{.} \end{equation*}

Notice that this solution can be easily checked in the original system of equations.

#### C41.

Use the inverse of a matrix to find all the solutions to the following system of equations.

\begin{align*} x_1 + 2 x_2 - x_3 &= -3\\ 2 x_1 + 5 x_2 - x_3 &= -4\\ -x_1 - 4 x_2 &= 2 \end{align*}
Solution.

The coefficient matrix of this system of equations is

\begin{equation*} A= \begin{bmatrix} 1 & 2 & -1 \\ 2 & 5 & -1 \\ -1 & -4 & 0 \end{bmatrix} \end{equation*}

and the vector of constants is $$\vect{b}=\colvector{-3\\-4\\2}\text{.}$$ So by Theorem SLEMM we can convert the system to the form $$A\vect{x}=\vect{b}\text{.}$$ Row-reducing this matrix yields the identity matrix so by Theorem NMRRI we know $$A$$ is nonsingular. This allows us to apply Theorem SNCM to find the unique solution as

\begin{equation*} \vect{x} = \inverse{A}\vect{b} = \begin{bmatrix} -4 & 4 & 3 \\ 1 & -1 & -1 \\ -3 & 2 & 1 \end{bmatrix} \colvector{-3\\-4\\2} = \colvector{2\\-1\\3}\text{.} \end{equation*}

Remember, you can check this solution easily by evaluating the matrix-vector product $$A\vect{x}$$ (Definition MVP).

#### C42.

Use a matrix inverse to solve the linear system of equations.

\begin{align*} x_1-x_2+2x_3&=5\\ x_1-2x_3&=-8\\ 2x_1-x_2-x_3&=-6 \end{align*}
Solution.

We can reformulate the linear system as a vector equality with a matrix-vector product via Theorem SLEMM. The system is then represented by $$A\vect{x}=\vect{b}$$ where

\begin{align*} A&= \begin{bmatrix} 1 & -1 & 2 \\ 1 & 0 & -2\\ 2 & -1 & -1 \end{bmatrix} & \vect{b} &=\colvector{5\\-8\\-6}\text{.} \end{align*}

According to Theorem SNCM, if $$A$$ is nonsingular then the (unique) solution will be given by $$\inverse{A}\vect{b}\text{.}$$ We attempt the computation of $$\inverse{A}$$ through Theorem CINM, or with our favorite computational device and obtain,

\begin{align*} \inverse{A}= \begin{bmatrix} 2 & 3 & -2 \\ 3 & 5 & -4 \\ 1 & 1 & -1 \end{bmatrix} \end{align*}

So by Theorem NI, we know $$A$$ is nonsingular, and so the unique solution is

\begin{align*} \inverse{A}\vect{b} = \begin{bmatrix} 2 & 3 & -2 \\ 3 & 5 & -4 \\ 1 & 1 & -1 \end{bmatrix} \colvector{5\\-8\\-6} = \colvector{-2\\-1\\3}\text{.} \end{align*}

#### T10.

Construct an example to demonstrate that $$\inverse{(A+B)}=\inverse{A}+\inverse{B}$$ is not true for all square matrices $$A$$ and $$B$$ of the same size.

Solution.

For a large collection of small examples, let $$D$$ be any $$2\times 2$$ matrix that has an inverse (Theorem TTMI can help you construct such a matrix, $$I_2$$ is a simple choice). Set $$A=D$$ and $$B=(-1)D\text{.}$$ While $$\inverse{A}$$ and $$\inverse{B}$$ both exist, what is $$\inverse{\left(A+B\right)}\text{?}$$

For a large collection of examples of any size, consider $$A=B=I_n\text{.}$$ Can the proposed statement be salvaged to become a theorem?