Skip to main content

Applied Mathematics

Section 2.3 The Inverse of a Matrix

Subsection 2.3.1 The Identity Matrix

Definition 2.3.1.

The identity matrix of size \(n\) is an \(n\) by \(n\) matrix of all zeros except ones on the diagonal (from upper left to lower right).
The following are identity matrices of sizes 2, 3, and 4
\begin{align*} I \amp =\begin{bmatrix} 1 \amp 0 \\ 0 \amp 1 \end{bmatrix}, \amp I =\amp \begin{bmatrix} 1 \amp 0 \amp 0 \\ 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \end{bmatrix}, \amp I = \amp \begin{bmatrix} 1 \amp 0 \amp 0 \amp 0\\ 0 \amp 1 \amp 0 \amp 0 \\ 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 0 \amp 1 \end{bmatrix}. \end{align*}
The identity matrix is a matrix such that \(IA = AI = A\) and note that the size of the identity matrix can be anything so generally is chosen for a defined matrix product.

Subsection 2.3.2 The Inverse

Recall that we showed at the end of the previous section that a linear system can be written as:
\begin{equation*} A \vec{u} = \vec{b}, \end{equation*}
where \(A\) is the coefficient matrix of the linear equations, \(\vec{u}\) is a column vector of unknowns, and \(\vec{b}\) is the right hand sides of each equation.
We possibly would like to say that:
\begin{equation*} \vec{u} = \frac{\vec{b}}{A}, \end{equation*}
but how do we divide through by \(A\text{?}\) Maybe we just haven’t learned about matrix division, however (spoiler alert) there is no matrix divsion. Instead, we will see that there is a matrix which will let us multiply through to give the answer.

Subsection 2.3.3 Solving a simple linear equation

To motivate solving a matrix equation, let’s look at solving \(a x = b\text{,}\) where each is simply a number (or technically a scalar). The solution is \(x=b/a\text{,}\) but we can also write it as \(x = a^{-1}b\text{,}\) where \(a^{-1}=\frac{1}{a}\) is the reciprocal of \(a\text{,}\) which has the property
\begin{equation*} a^{-1} a = a a^{-1} = 1 \end{equation*}
for any value of \(a \neq 0\text{.}\) And the important part of this is that the solution \(x=a^{-1}b\) uses only multiplication for the solution.

Subsection 2.3.4 The Matrix Inverse

Definition 2.3.2.

For a square matrix \(A\text{,}\) if there exists a matrix \(B\text{,}\) such that
\begin{equation*} A B = B A = I \end{equation*}
then \(B\) is called the inverse matrix of \(A\) and is denoted \(A^{-1}\text{.}\)
It is noted that not every matrix \(A\) has an inverse matrix. We will see examples of this later in this section.
First, let’s determine how to find the inverse of a 2 by 2 matrix.

Proof.

We will prove this, by showing that if \(A^{-1}\) is an inverse then \(AA^{-1}=I\) (or \(A^{-1}A=I\)).
\begin{equation*} A A^{-1} = \begin{bmatrix} a \amp b \\ c \amp d \end{bmatrix} \frac{1}{ad-bc} \begin{bmatrix} d \amp -b \\ -c \amp a \end{bmatrix} \end{equation*}
From properties in SectionΒ 2.2, the scalar \(1/(ad-bc)\) can be written out front.
\begin{equation*} = \frac{1}{ad-bc} \begin{bmatrix} a \amp b \\ c \amp d \end{bmatrix} \begin{bmatrix} d \amp -b \\ -c \amp a \end{bmatrix} \end{equation*}
Multiply the two matrices like we did in the previous section.
\begin{equation*} = \frac{1}{ad-bc}\begin{bmatrix} ad-bc \amp -ac+ac \\ da-da \amp ad-bc \end{bmatrix} \end{equation*}
simplify and multiply through by \(ad-bc=ad-bc\text{.}\)
\begin{align*} \amp= \begin{bmatrix} \frac{ad-bc}{ad-bc} \amp 0 \\ 0 \amp \frac{ad-bc}{ad-bc} \end{bmatrix} \\ \amp = \begin{bmatrix} 1 \amp 0 \\ 0 \amp 1 \end{bmatrix} = I. \end{align*}
Similarly, we can show that \(A^{-1}A = I\text{,}\) and these two properties proves the formula for the inverse in (2.3.1).
The following example uses the formula in (2.3.1) to find the inverse matrix of a 2 by 2 matrix.

Example 2.3.4.

Find the inverse of
\begin{equation*} A = \begin{bmatrix} 3 \amp 2 \\ 2 \amp 1 \end{bmatrix} \end{equation*}
Solution.
The term out front of (2.3.1) is \(ad-bc = 3(1)-(2)(2) = -1\text{.}\) Then apply the formula,
\begin{equation*} A^{-1} = \frac{1}{-1} \begin{bmatrix} 1 \amp -2 \\ -2 \amp 3 \end{bmatrix} = \begin{bmatrix} -1 \amp 2 \\ 2 \amp -3 \end{bmatrix} \end{equation*}
The next example shows that not every matrix has an inverse. Since a matrix inverse is similar to the reciprocal of a number, a matrix with no inverse is similar to a number with no reciprocal. And this occurs for the number 0 because \(1/0\) is undefined.

Example 2.3.5.

Show that the matrix
\begin{equation*} A = \begin{bmatrix} 2 \amp 1 \\ 4 \amp 2 \end{bmatrix} \end{equation*}
does not have an inverse.
Solution.
Again we use (2.3.1), but because \(ad-bc = 2(2)-4(1) = 0\text{,}\) the matrix does not have an inverse.

Subsection 2.3.5 Solving \(A\vec{u}=\vec{b}\)

At the end of SubsectionΒ 2.2.5, we learned how to take a linear system and write it as the matrix equation \(A\vec{u}=\vec{b}\text{.}\) In this section we will learn how to solve a system written in this form. If we start with the equation,
\begin{align*} A\vec{u} \amp =\vec{b} \amp \text{Multiply this by $A^{-1}$} \\ A^{-1} A \vec{u}\amp = A^{-1} \vec{b} \amp \text{Use the fact that $A^{-1}A=I$} \\ I \vec{u} \amp = A^{-1} \vec{b} \amp \text{And $I\vec{u}=\vec{u}$ for any vector $\vec{u}$.} \\ \vec{u} \amp= A^{-1}\vec{b} \end{align*}
so if we can find the inverse of a matrix, then solving linear systems becomes matrix multiplication.

Remark 2.3.6.

If you are trying to solve the matrix equation
\begin{equation*} A\vec{u} = \vec{b} \end{equation*}
for a square matrix \(A\) and the inverse matrix \(A^{-1}\) exists, then
\begin{equation*} \vec{u} = A^{-1} \vec{b} \end{equation*}

Example 2.3.7.

Solve the system:
\begin{align*} 3x + 4y \amp = 1, \\ 2x - y \amp = -3, \end{align*}
by writing the system as \(A \vec{u} = \vec{b}\text{,}\) then finding \(A^{-1}\) and finally by writing \(\vec{u} = A^{-1} \vec{b}\text{.}\)
Solution.
First, write down \(A\text{,}\) \(\vec{u}\) and \(\vec{b}\text{.}\) (We learned how to do this in SubsectionΒ 2.2.5.)
\begin{align*} A \amp = \begin{bmatrix} 3 \amp 4 \\ 2 \amp -1 \end{bmatrix}, \amp \vec{u} \amp= \begin{bmatrix} x \\ y \end{bmatrix}, \amp \vec{b} \amp = \begin{bmatrix} 1 \\ -3 \end{bmatrix}. \end{align*}
Then find the inverse of \(A\text{,}\) which is a 2 by 2 matrix, so we will use (2.3.1). Since \(ad-bc = -3 -8 = -11\text{.}\)
\begin{equation*} A^{-1} = \frac{1}{-11} \begin{bmatrix} -1 \amp -4 \\ -2 \amp 3 \end{bmatrix} \end{equation*}
Then write down the solution:
\begin{align*} \vec{u} \amp = A^{-1} \vec{b} \\ \amp = \frac{1}{-11} \begin{bmatrix} -1 \amp -4 \\ -2 \amp 3 \end{bmatrix} \begin{bmatrix} 1 \\ -3 \end{bmatrix}\\ \amp = \frac{1}{-11} \begin{bmatrix} -1+12 \\ -2-9 \end{bmatrix} = \frac{1}{-11} \begin{bmatrix} 11 \\ -11 \end{bmatrix} = \begin{bmatrix} -1 \\ 1 \end{bmatrix} \end{align*}
So the solution is \(\vec{u} = \begin{bmatrix} -1 \\ 1 \end{bmatrix}\) or \(x=-1\) and \(y=1\text{.}\)
The next example shows how to perform the same steps for a 3 by 3 matrix, although we don’t know how to find an inverse of a 3 by 3 matrix yet.

Example 2.3.8.

We will later show that if
\begin{equation*} A = \begin{bmatrix} -4 \amp -5 \amp -1 \\ 2 \amp 1 \amp -3 \\ 0 \amp 2 \amp 5 \end{bmatrix} \end{equation*}
\begin{equation*} A^{-1} = \begin{bmatrix} \frac{11}{2} \amp \frac{23}{2} \amp 8 \\ -5 \amp -10 \amp -7 \\ 2 \amp 4 \amp 3 \end{bmatrix} \end{equation*}
Use this to find the solution to:
\begin{align*} -4 x-5y -z \amp = -12, \\ 2 x + y - 3 z \amp = 6, \\ 2y + 5z \amp = 10. \end{align*}
Solution.
First, the linear system can be written as \(A\vec{u}=\vec{b}\) if
\begin{align*} A \amp = \begin{bmatrix} -4 \amp -5 \amp -1 \\ 2 \amp1 \amp -3 \\ 0 \amp 2 \amp 5 \end{bmatrix}, \amp \vec{u} \amp = \begin{bmatrix} x \\ y\\ z \end{bmatrix}, \amp \vec{b} \amp = \begin{bmatrix} -12 \\ 6 \\ 10 \end{bmatrix}. \end{align*}
Then we write the solution to this systems as
\begin{align*} \vec{u} \amp = A^{-1} \vec{b}, \\ \amp = \begin{bmatrix} \frac{11}{2} \amp \frac{23}{2} \amp 8 \\ -5 \amp -10 \amp -7 \\ 2 \amp 4 \amp 3 \end{bmatrix} \begin{bmatrix} -12 \\ 6 \\ 10 \end{bmatrix}, \\ \amp = \begin{bmatrix} 83 \\ -70 \\ 30 \end{bmatrix}, \end{align*}
therefore the solution is \(x=83, y=-70,\) and \(z=30\text{.}\)

Subsection 2.3.6 the Gauss-Jordan Method for Calculating Inverses

As we have seen, often matrices are larger than 2 by 2 and thus far we have no method to find an inverse of a matrix of this size. In this section, we will see that the Gauss-Jordon method can help us do this.
Recall that finding an inverse is the same as solving \(AB=I\) for \(B\text{.}\) If we write \(B\) and \(I\) in terms of its column vectors, then
\begin{align*} B \amp = \begin{bmatrix} \vec{b}_1 \amp \vec{b}_2 \amp \cdots \amp \vec{b}_n \end{bmatrix} \amp I \amp = \begin{bmatrix} \vec{e}_1 \amp \vec{e}_2 \amp \cdots \amp \vec{e}_n \end{bmatrix} \end{align*}
Then if we solve \(A \vec{b}_k = \vec{e}_k\text{,}\) for all \(k\text{,}\) then we have all columns of \(B\text{.}\)
We will use this method to find the inverse of the same \(2 \times 2\) matrix as in ExampleΒ 2.3.4

Example 2.3.9.

Use the method explained above to find the inverse of
\begin{equation*} A = \begin{bmatrix} 3 \amp 2 \\ 2 \amp 1 \end{bmatrix} \end{equation*}
Solution.
First, we will solve \(A\vec{b}_1 = \vec{e}_1\) where
\begin{equation*} \vec{e}_1 = \begin{bmatrix} 1 \\ 0 \end{bmatrix} \end{equation*}
We will use Gauss-Jordon to solve this.
\begin{align*} \amp \left[\begin{array}{rr|r} 3 \amp 2 \amp 1 \\ 2 \amp 1 \amp 0 \end{array}\right] \\ -R_2 + R_1 \to R_1 \qquad \amp \left[\begin{array}{rr|r} 1 \amp 1 \amp 1 \\ 2 \amp 1 \amp 0 \end{array}\right]\\ -2R_1 + R_2 \to R_2 \qquad \amp \left[\begin{array}{rr|r} 1 \amp 1 \amp 1 \\ 0 \amp -1 \amp -2 \end{array}\right]\\ -R_2 \to R_2 \qquad \amp \left[\begin{array}{rr|r} 1 \amp 1 \amp 1 \\ 0 \amp 1 \amp 2 \end{array}\right]\\ -R_2 + R_1 \to R_1 \qquad \amp \left[\begin{array}{rr|r} 1 \amp 0 \amp -1 \\ 0 \amp 1 \amp 2 \end{array}\right] \end{align*}
and this shows that
\begin{equation*} \vec{b}_1 = \begin{bmatrix} -1 \\ 2 \end{bmatrix} \end{equation*}
Now, we will solve \(A\vec{b}_2 = \vec{e}_2\) where
\begin{equation*} \vec{e}_2 = \begin{bmatrix} 0 \\ 1 \end{bmatrix} \end{equation*}
and use Gauss-Jordon to solve this.
\begin{align*} \amp \left[\begin{array}{rr|r} 3 \amp 2 \amp 1 \\ 2 \amp 0 \amp 1 \end{array}\right] \\ -R_2 + R_1 \to R_1 \qquad \amp \left[\begin{array}{rr|r} 1 \amp 1 \amp -1 \\ 2 \amp 1 \amp 1 \end{array}\right]\\ -2R_1 + R_2 \to R_2 \qquad \amp \left[\begin{array}{rr|r} 1 \amp 1 \amp -1 \\ 0 \amp -1 \amp 3 \end{array}\right]\\ -R_2 \to R_2 \qquad \amp \left[\begin{array}{rr|r} 1 \amp 1 \amp -1 \\ 0 \amp 1 \amp -3 \end{array}\right]\\ -R_2 + R_1 \to R_1 \qquad \amp \left[\begin{array}{rr|r} 1 \amp 0 \amp 2 \\ 0 \amp 1 \amp -3 \end{array}\right] \end{align*}
and this shows that
\begin{equation*} \vec{b}_2 = \begin{bmatrix} 2 \\ -3 \end{bmatrix} \end{equation*}
This shows that the inverse is
\begin{equation*} B = \begin{bmatrix} \vec{b}_1 \amp \vec{b}_2 \end{bmatrix} = \begin{bmatrix} -1 \amp 2 \\ 2 \amp -3 \end{bmatrix} \end{equation*}
You should notice that the steps to solve each of the linear systems above were exactly the same. We can take advantage of this to solve for both systems simultaneously. The result is the following method of finding inverses.

Remark 2.3.10. Using Gauss-Jordon to find Matrix Inverses.

If we write a matrix \(A\) of the form
\begin{equation*} \begin{bmatrix} A \amp | \amp I \end{bmatrix} \end{equation*}
where the matrix \(A\) is on the left and the identity matrix is on the right and apply Gauss-Jordon to get the identity matrix on the left, then the matrix will look like,
\begin{equation*} \begin{bmatrix} I \amp | \amp A^{-1} \end{bmatrix} \end{equation*}
and the matrix on the right half is the inverse matrix, \(A^{-1}\text{.}\)
If the row-reduced form of the matrix \([A\;|\;I]\) does not have the identity matrix on left side the inverse does not exist.

Example 2.3.11.

Use the Gauss-Jordan Method to find the inverse of
\begin{equation*} A = \begin{bmatrix} 3 \amp 2 \\ 2 \amp 1 \end{bmatrix} \end{equation*}
Solution.
First, write the matrix \([\;A\; | \;I\;]\) and then perform Gaussian Elimination.
\begin{align*} \amp \qquad \left[\begin{array}{rr|rr} 3 \amp 2 \amp 1 \amp 0 \\ 2 \amp 1 \amp 0 \amp 1 \end{array}\right] \end{align*}
We desire a 1 in the upper right. Instead of dividing the first row by 3, we will do the following,
\begin{align*} -R_2 + R_1 \rightarrow R_1 \amp \qquad \left[\begin{array}{rr|rr} 1 \amp 1 \amp 1 \amp -1 \\ 2 \amp 1 \amp 0 \amp 1 \end{array}\right] \end{align*}
Then eliminate the lower right element on the left side,
\begin{align*} -2 R_1 + R_2 \rightarrow R_2 \amp \qquad \left[\begin{array}{rr|rr} 1 \amp 1 \amp 1 \amp -1 \\ 0 \amp -1 \amp -2 \amp 3 \end{array}\right] \end{align*}
Multiply through by \(-1\) to get a 1 in the lower right of the left side
\begin{align*} - R_2 \rightarrow R_2 \amp \qquad \left[\begin{array}{rr|rr} 1 \amp 1 \amp 1 \amp -1 \\ 0 \amp 1 \amp 2 \amp -3 \end{array}\right] \end{align*}
And finally zero out the 2nd column, 1st row.
\begin{align*} - R_2 + R_1 \rightarrow R_1 \amp \qquad \left[\begin{array}{rr|rr} 1 \amp 0 \amp -1 \amp 2 \\ 0 \amp 1 \amp 2 \amp -3 \end{array}\right] \end{align*}
We stop here because the left half of the matrix is the identity matrix. The right half is now the inverse. Therefore:
\begin{equation*} A^{-1} = \begin{bmatrix} -1 \amp 2 \\ 2 \amp -3 \end{bmatrix} \end{equation*}
This example showed how to find the inverse of a 2 by 2 matrix using the Gauss-Jordan method. We saw the formula in (2.3.1), and generally it is easier to compute the inverse using that formula. However, the formula in (2.3.1) only works for 2 by 2 matrices. The next example shows how to use the Gauss-Jordan method to find the inverse of a 3 by 3 matrix.

Example 2.3.12.

Find the inverse of
\begin{equation*} A = \begin{bmatrix} 3 \amp 3 \amp -1 \\ 2 \amp 1 \amp -3 \\ 0 \amp 2 \amp 5 \end{bmatrix} \end{equation*}
Solution.
First, we write \([\;A\;|\;I\;]\) and then use the Gauss-Jordon Method.
\begin{align*} \amp \qquad \left[\begin{array}{rrr|rrr} 3 \amp 3 \amp -1 \amp 1 \amp 0 \amp 0\\ 2 \amp 1 \amp -3 \amp 0 \amp 1 \amp 0\\ 0 \amp 2 \amp 5 \amp 0 \amp 0 \amp 1\\ \end{array}\right] \end{align*}
Since we want a 1 in the upper right and don’t want fractions, try
\begin{align*} -R_2 + R_1 \rightarrow R_2 \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 2 \amp 2 \amp 1 \amp -1 \amp 0\\ 2 \amp 1 \amp -3 \amp 0 \amp 1 \amp 0\\ 0 \amp 2 \amp 5 \amp 0 \amp 0 \amp 1\\ \end{array}\right] \end{align*}
And zero out the rest of the first column.
\begin{align*} -2 R_1 + R_2 \rightarrow R_2 \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 2 \amp 2 \amp 1 \amp -1 \amp 0\\ 0 \amp -3 \amp -7 \amp -2 \amp 3 \amp 0\\ 0 \amp 2 \amp 5 \amp 0 \amp 0 \amp 1\\ \end{array}\right] \end{align*}
Again, to avoid fractions, try
\begin{align*} 2 R_3 + R_2 \rightarrow R_2 \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 2 \amp 2 \amp 1 \amp -1 \amp 0\\ 0 \amp 1 \amp 3 \amp -2 \amp 3 \amp 2\\ 0 \amp 2 \amp 5 \amp 0 \amp 0 \amp 1\\ \end{array}\right] \end{align*}
And zero out the other elements in the 2nd column.
\begin{align*} \begin{array}{r} -2 R_2 + R_3 \rightarrow R_3 \\ - 2R_2 + R_1 \rightarrow R_1 \end{array} \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 0 \amp -4 \amp 5 \amp -7 \amp -4\\ 0 \amp 1 \amp 3 \amp -2 \amp 3 \amp 2\\ 0 \amp 0 \amp -1 \amp 4 \amp -6 \amp -3\\ \end{array}\right] \end{align*}
Next, we need a 1 where the \(-1\) is.
\begin{align*} -R_3 \rightarrow R_3 \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 0 \amp -4 \amp 5 \amp -7 \amp -4\\ 0 \amp 1 \amp 3 \amp -2 \amp 3 \amp 2\\ 0 \amp 0 \amp 1 \amp -4 \amp 6 \amp 3\\ \end{array}\right] \end{align*}
And lastly zero out the rest of the 3rd column.
\begin{align*} \begin{array}{r} -3 R_3 + R_2 \rightarrow R_2 \\ 4 R_3 + R_1 \rightarrow R_1 \end{array} \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 0 \amp 0 \amp -11 \amp 17 \amp 8\\ 0 \amp 1 \amp 0 \amp 10 \amp -15 \amp -7\\ 0 \amp 0 \amp 1 \amp -4 \amp 6 \amp 3\\ \end{array}\right] \end{align*}
Since we have found the 3 by 3 identity on the left, the inverse is on the right or
\begin{equation*} A^{-1} = \begin{bmatrix} -11 \amp 17 \amp 8 \\ 10 \amp -15 \amp -7 \\ -4 \amp 6 \amp 3\\ \end{bmatrix} \end{equation*}
As we saw with some 2 by 2 matrices (as in ExampleΒ 2.3.5), their inverse does not exist. We see how using the Gauss-Jordon method results in this situation for a 3 by 3 example.

Example 2.3.13.

Show that the matrix
\begin{equation*} \begin{bmatrix} 1 \amp -5 \amp 3 \\ -2 \amp 3 \amp 7 \\ -1 \amp -2 \amp 10 \end{bmatrix} \end{equation*}
does not have an inverse.
Solution.
First, write \([\;A\;|\;I\;]\) and then use the Gauss-Jordan Method to alter the matrix.
\begin{align*} \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp -5 \amp 3 \amp 1 \amp 0 \amp 0 \\ -2 \amp 3 \amp 7 \amp 0 \amp 1 \amp 0 \\ -1 \amp -2 \amp 10 \amp 0 \amp 0 \amp 1 \\ \end{array}\right] \\ \begin{array}{r} 2 R_1 + R_2 \rightarrow R_2 \\ R_1 + R_3 \rightarrow R_3 \end{array} \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp -5 \amp 3 \amp 1 \amp 0 \amp 0 \\ 0 \amp -7 \amp 13 \amp 2 \amp 1 \amp 0 \\ 0 \amp -7 \amp 13 \amp 1 \amp 0 \amp 1 \\ \end{array}\right] \\ -R_2 + R_3 \rightarrow R_3 \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp -5 \amp 3 \amp 1 \amp 0 \amp 0 \\ 0 \amp -7 \amp 13 \amp 2 \amp 1 \amp 0 \\ 0 \amp 0 \amp 0 \amp -1 \amp 0 \amp 1 \\ \end{array}\right] \end{align*}
And we stop since the row of zeros on the bottom of the left half of the matrix indicates that we cannot get an identity matrix on the left half of the matrix. This shows that the matrix is not invertible.
This next example, shows how to solve a linear system of 3 variables and 3 equations, find 1) written in in the form \(A\vec{u}=\vec{b}\text{,}\) 2) Find the inverse matrix \(A^{-1}\) and 3) finding \(\vec{u} = A^{-1} \vec{b}\text{.}\)

Example 2.3.14.

Consider the linear system
\begin{align*} x+2y \amp = 3, \\ y-z \amp = 0, \\ x+ y \amp = 5. \end{align*}
Write this system as \(A\vec{u}=\vec{b}\) and then solve it use the inverse matrix.
Solution.
First, let
\begin{align*} A \amp = \begin{bmatrix} 1 \amp 2 \amp 0 \\ 0 \amp 1 \amp -1 \\ 1 \amp 1 \amp 0 \end{bmatrix} \amp \vec{u} \amp = \begin{bmatrix} x \\ y \\ z \end{bmatrix} \amp \vec{b} \amp = \begin{bmatrix} 3 \\ 0 \\ 5 \end{bmatrix} \end{align*}
We need to find \(A^{-1}\) and will use Gauss-Jordan:
\begin{align*} \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 2 \amp 0 \amp 1 \amp 0 \amp 0 \\ 0 \amp 1 \amp -1 \amp 0 \amp 1 \amp 0 \\ 1 \amp 1 \amp 0 \amp 0 \amp 0 \amp 1 \\ \end{array}\right] \\ -R_1 + R_3 \rightarrow R_3 \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 2 \amp 0 \amp 1 \amp 0 \amp 0 \\ 0 \amp 1 \amp -1 \amp 0 \amp 1 \amp 0 \\ 0 \amp -1 \amp 0 \amp -1 \amp 0 \amp 1 \\ \end{array}\right]\\ \begin{array}{r} -2R_2 +R_1 \rightarrow R_1 \\ R_2 +R_3 \rightarrow R_3 \end{array} \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 0 \amp 2 \amp 1 \amp -2 \amp 0 \\ 0 \amp 1 \amp -1 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp -1 \amp -1 \amp 1 \amp 1 \\ \end{array}\right]\\ -R_3 \rightarrow R_3 \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 0 \amp 2 \amp 1 \amp -2 \amp 0 \\ 0 \amp 1 \amp -1 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \amp 1 \amp -1 \amp -1 \\ \end{array}\right] \\ \begin{array}{r} R_3+R_2\rightarrow R_2 \\ -2R_3 + R_1 \rightarrow R_1 \end{array} \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 0 \amp 0 \amp -1 \amp 0 \amp 2 \\ 0 \amp 1 \amp 0 \amp 1 \amp 0 \amp -1 \\ 0 \amp 0 \amp 1 \amp 1 \amp -1 \amp -1 \\ \end{array}\right] \end{align*}
Thus the inverse is:
\begin{equation*} A^{-1}= \begin{bmatrix} -1 \amp 0 \amp 2\\ 1 \amp 0 \amp -1 \\ 1 \amp -1 \amp -1 \end{bmatrix} \end{equation*}
Next, we solve the linear system by writing
\begin{align*} \vec{u} \amp = A^{-1}\vec{b} \\ \amp = \begin{bmatrix} -1 \amp 0 \amp 2\\ 1 \amp 0 \amp -1 \\ 1 \amp -1 \amp -1 \end{bmatrix} \begin{bmatrix} 3\\ 0 \\ 5 \end{bmatrix} \\ \amp = \begin{bmatrix} 7 \\ -2 \\ -2 \end{bmatrix} \end{align*}
and therefore the solution to the linear system is \(x=7, y=-2\text{,}\) and \(z=-2\text{.}\)
The last example shows how to perform a linear system solve using the inverse matrix technique of a linear system with 4 equations and 4 unknowns. The technique is exactly the same as the previous example, however there are quite a few steps to find the inverse.

Example 2.3.15.

Use Matrix Inversion to solve:
\begin{align*} 2 x + y \amp = 5, \\ x + 2y + z \amp = 0, \\ y + 2 z + w \amp = 5, \\ z + 2 w \amp = 0. \end{align*}
Solution.
First, we need to find the inverse. Use the Gauss-Jordan method:
\begin{align*} \amp \quad \left[\begin{array}{rrrr|rrrr} 2 \amp 1 \amp 0 \amp 0 \amp 1 \amp 0 \amp 0 \amp 0 \\ 1 \amp 2 \amp 1 \amp 0 \amp 0 \amp 1 \amp 0 \amp 0 \\ 0 \amp 1 \amp 2 \amp 1 \amp 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \amp 2 \amp 0 \amp 0 \amp 0 \amp 1 \end{array}\right]\\ \begin{array}{r} R_1 \leftrightarrow R_2, \\R_2 \leftrightarrow R_3, \\R_3 \leftrightarrow R_4, \end{array} \amp \quad \left[\begin{array}{rrrr|rrrr} 1 \amp 2 \amp 1 \amp 0 \amp 0 \amp 1 \amp 0 \amp 0 \\ 0 \amp 1 \amp 2 \amp 1 \amp 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \amp 2 \amp 0 \amp 0 \amp 0 \amp 1 \\ 2 \amp 1 \amp 0 \amp 0 \amp 1 \amp 0 \amp 0 \amp 0 \end{array}\right]\\ -2 R_1 + R_4 \rightarrow R_4, \amp \quad \left[\begin{array}{rrrr|rrrr} 1 \amp 2 \amp 1 \amp 0 \amp 0 \amp 1 \amp 0 \amp 0 \\ 0 \amp 1 \amp 2 \amp 1 \amp 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \amp 2 \amp 0 \amp 0 \amp 0 \amp 1 \\ 0 \amp -3 \amp -2 \amp 0 \amp 1 \amp -2 \amp 0 \amp 0 \end{array}\right]\\ \begin{array}{r} 3 R_2 + R_4 \rightarrow R_4 \\ -2R_2 + R_1 \rightarrow R_1 \end{array} \amp \quad \left[\begin{array}{rrrr|rrrr} 1 \amp 0 \amp -3 \amp -2 \amp 0 \amp 1 \amp -2 \amp 0\\ 0 \amp 1 \amp 2 \amp 1 \amp 0 \amp 0 \amp 1 \amp 0\\ 0 \amp 0 \amp 1 \amp 2 \amp 0 \amp 0 \amp 0 \amp 1\\ 0 \amp 0 \amp 4 \amp 3 \amp 1 \amp -2 \amp 3 \amp 0\\ \end{array}\right]\\ \begin{array}{r} -4 R_3 + R_4 \rightarrow R_4 \\ -2R_3+R_2 \rightarrow R_2 \\ 3R_3 + R_1 \rightarrow R_1 \end{array} \amp \quad \left[\begin{array}{rrrr|rrrr} 1 \amp 0 \amp 0 \amp 4 \amp 0 \amp 1 \amp -2 \amp 3\\ 0 \amp 1 \amp 0 \amp -3 \amp 0 \amp 0 \amp 1 \amp -2\\ 0 \amp 0 \amp 1 \amp 2 \amp 0 \amp 0 \amp 0 \amp 1\\ 0 \amp 0 \amp 0 \amp -5 \amp 1 \amp -2 \amp 3 \amp -4\\ \end{array}\right]\\ \begin{array}{r} 2 R_4 + 5R_3 \rightarrow R_3, \\ -3R_4 + 5R_2 \rightarrow R_2,\\ 4R_4 + 5R_1 \rightarrow R_1, \end{array} \amp \quad \left[\begin{array}{rrrr|rrrr} 5 \amp 0 \amp 0 \amp 0 \amp 4 \amp -3 \amp 2 \amp -1\\ 0 \amp 5 \amp 0 \amp 0 \amp -3 \amp 6 \amp -4 \amp 2\\ 0 \amp 0 \amp 5 \amp 0 \amp 2 \amp -4 \amp 6 \amp -3\\ 0 \amp 0 \amp 0 \amp -5 \amp 1 \amp -2 \amp 3 \amp -4\\ \end{array}\right]\\ \begin{array}{r} \frac{1}{5} R_1 \rightarrow R_1, \\ \frac{1}{5} R_2 \rightarrow R_2, \\ \frac{1}{5} R_3 \rightarrow R_3, \\ -\frac{1}{5} R_4 \rightarrow R_4, \\ \end{array} \amp \quad \left[\begin{array}{rrrr|rrrr} 1 \amp 0 \amp 0 \amp 0 \amp 4/5 \amp -3/5 \amp 2/5 \amp -1/5\\ 0 \amp 1 \amp 0 \amp 0 \amp -3/5 \amp 6/5 \amp -4/5 \amp 2/5\\ 0 \amp 0 \amp 1 \amp 0 \amp 2/5 \amp -4/5 \amp 6/5 \amp -3/5\\ 0 \amp 0 \amp 0 \amp 1 \amp -1/5 \amp 2/5 \amp -3/5 \amp 4/5\\ \end{array}\right] \end{align*}
Therefore:
\begin{equation*} A^{-1} = \left[\begin{array}{rrrr} 4/5 \amp -3/5 \amp 2/5 \amp - 1/5 \\ -3/5 \amp 6/5 \amp -4/5 \amp 2/5 \\ 2/5 \amp -4/5 \amp 6/5 \amp -3/5 \\ -1/5 \amp 2/5 \amp -3/5 \amp 4/5 \\ \end{array}\right] \end{equation*}
and then the solution to \(AX=B\text{,}\) where \(B=[5\;0\;5\;0]^{\intercal}\) is
\begin{equation*} X = \begin{bmatrix} 4/5 \amp -3/5 \amp 2/5 \amp - 1/5 \\ -3/5 \amp 6/5 \amp -4/5 \amp 2/5 \\ 2/5 \amp -4/5 \amp 6/5 \amp -3/5 \\ -1/5 \amp 2/5 \amp -3/5 \amp 4/5 \\ \end{bmatrix} \begin{bmatrix} 5 \\ 0 \\ 5 \\ 0 \end{bmatrix} = \begin{bmatrix} 6 \\ -7 \\ 8 \\ -4 \end{bmatrix} \end{equation*}
Note that since the matrix \(A\) is symmetric (in many ways), the matrix \(A^{-1}\) is also symmetric.

Subsection 2.3.7 Properties of the Inverse Matrix

An inverse matrix is just a matrix, so in many cases has the same properties as general matrices. However, one important is the inverse of the product of matrices.

Proof.

\begin{align*} (AB)^{-1} (AB) \amp = I \\ (AB)^{-1} (AB) B^{-1} \amp = I B^{-1} = B^{-1} \\ (AB)^{-1} A I \amp = I B^{-1} = B^{-1} \\ (AB)^{-1} A \amp = B^{-1} \\ (AB)^{-1} A A^{-1} \amp = B^{-1} A^{-1} \\ (AB)^{-1}I \amp = B^{-1} A^{-1} \\ (AB)^{-1} \amp = B^{-1} A^{-1} \end{align*}