### 4 Solving three equations in three unknowns

It is much more tedious to use the inverse matrix to solve a system of three equations although in principle, the method is the same as for two equations.

Consider the system

$\begin{array}{rcll}{x}_{1}-2{x}_{2}+{x}_{3}& =& 3& \text{}\\ 2{x}_{1}+{x}_{2}-{x}_{3}& =& 5& \text{}\\ 3{x}_{1}-{x}_{2}+2{x}_{3}& =& 12\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}& \text{}\end{array}$

We met this system in Section 8.1 where we found that $\left|A\right|=10$ . Hence ${A}^{-1}$ exists.

Find ${A}^{-1}$ by the method of determinants.

First form the matrix where each element of $A$ is replaced by its minor:

$\left[\begin{array}{ccc}\hfill \left|\begin{array}{cc}\hfill 1& \hfill -1\\ \hfill -1& \hfill 2\end{array}\right|\hfill & \hfill \left|\begin{array}{cc}\hfill 2& \hfill -1\\ \hfill 3& \hfill 2\end{array}\right|\hfill & \hfill \left|\begin{array}{cc}\hfill 2& \hfill 1\\ \hfill 3& \hfill -1\end{array}\right|\hfill \\ \hfill \hfill \\ \hfill \left|\begin{array}{cc}\hfill -2& \hfill 1\\ \hfill -1& \hfill 2\end{array}\right|\hfill & \hfill \left|\begin{array}{cc}\hfill 1\hfill & \hfill 1\hfill \\ \hfill 3\hfill & \hfill 2\hfill \end{array}\right|\hfill & \hfill \left|\begin{array}{cc}\hfill 1& \hfill -2\\ \hfill 3& \hfill -1\end{array}\right|\hfill \\ \hfill \hfill \\ \hfill \left|\begin{array}{cc}\hfill -2& \hfill 1\\ \hfill 1& \hfill -1\end{array}\right|\hfill & \hfill \left|\begin{array}{cc}\hfill 1& \hfill 1\\ \hfill 2& \hfill -1\end{array}\right|\hfill & \hfill \left|\begin{array}{cc}\hfill 1& \hfill -2\\ \hfill 2& \hfill 1\end{array}\right|\hfill \end{array}\right]=\left[\begin{array}{ccc}\hfill 1& \hfill 7& \hfill -5\\ \hfill -3& \hfill -1& \hfill 5\\ \hfill 1& \hfill -3& \hfill 5\end{array}\right].$

Now use the $3×3$ array of signs to obtain the matrix of cofactors:

The array of signs is $\left[\begin{array}{ccc}\hfill +\hfill & \hfill -\hfill & \hfill +\hfill \\ \hfill -\hfill & \hfill +\hfill & \hfill -\hfill \\ \hfill +\hfill & \hfill -\hfill & \hfill +\hfill \end{array}\right]$ so that we obtain $\left[\begin{array}{ccc}\hfill 1& \hfill -7& \hfill -5\\ \hfill 3& \hfill -1& \hfill -5\\ \hfill 1& \hfill 3& \hfill 5\end{array}\right].$

Now transpose this matrix and divide by $\left|A\right|$ to obtain ${A}^{-1}$ :

Transposing gives $\left[\begin{array}{ccc}\hfill 1& \hfill 3& \hfill 1\\ \hfill -7& \hfill -1& \hfill 3\\ \hfill -5& \hfill -5& \hfill 5\end{array}\right].$ Finally, ${A}^{-1}=\frac{1}{10}\left[\begin{array}{ccc}\hfill 1& \hfill 3& \hfill 1\\ \hfill -7& \hfill -1& \hfill 3\\ \hfill -5& \hfill -5& \hfill 5\end{array}\right].$ Now use $X={A}^{-1}B$ to solve the system of linear equations:

$X=\frac{1}{10}\left[\begin{array}{ccc}\hfill 1& \hfill 3& \hfill 1\\ \hfill -7& \hfill -1& \hfill 3\\ \hfill -5& \hfill -5& \hfill 5\end{array}\right]\left[\begin{array}{c}\hfill 3\\ \hfill 5\\ \hfill 12\end{array}\right]=\frac{1}{10}\left[\begin{array}{c}\hfill 30\hfill \\ \hfill 10\hfill \\ \hfill 20\hfill \end{array}\right]=\left[\begin{array}{c}\hfill 3\\ \hfill 1\\ \hfill 2\end{array}\right]$ Then ${x}_{1}=3,\phantom{\rule{1em}{0ex}}{x}_{2}=1,\phantom{\rule{1em}{0ex}}{x}_{3}=2.$

Comparing this approach to the use of Cramer’s rule for three equations (in subsection 2 of Section 8.1) we can say that the two methods are both rather tedious!

#### 4.1 Equations with no unique solution

If $\left|A\right|=0$ , ${A}^{-1}$ does not exist and therefore it is easy to see that the system of equations has no unique solution. But it is not obvious whether this is because the equations are inconsistent and have no solution or whether they are consistent and have infinitely many solutions.

Consider the systems

1. $\begin{array}{ccc}\hfill {x}_{1}-{x}_{2}+{x}_{3}& \hfill =& \hfill 4\\ \hfill 2{x}_{1}+3{x}_{2}-2{x}_{3}& \hfill =& \hfill 3\\ \hfill 3{x}_{1}+2{x}_{2}-{x}_{3}& \hfill =& \hfill 7\end{array}$
2. $\begin{array}{ccc}\hfill {x}_{1}-{x}_{2}+{x}_{3}& \hfill =& \hfill 4\\ \hfill 2{x}_{1}+3{x}_{2}-2{x}_{3}& \hfill =& \hfill 3\\ \hfill {x}_{1}-11{x}_{2}+9{x}_{3}& \hfill =& \hfill 13\end{array}$

In system (1) add the first equation to the second. What does this tell you about the system?

The sum is $3{x}_{1}+2{x}_{2}-{x}_{3}=7$ , which is identical to the third equation. Thus, essentially, there are only two equations ${x}_{1}-{x}_{2}+{x}_{3}=4$ and $3{x}_{1}+2{x}_{2}-{x}_{3}=7$ . Now adding these two gives $4{x}_{1}+{x}_{2}=11$ or ${x}_{2}=11-4{x}_{1}$ and then

$\phantom{\rule{2em}{0ex}}{x}_{3}=4-{x}_{1}+{x}_{2}=4-{x}_{1}+11-4{x}_{1}=15-5{x}_{1}$

Hence if we give ${x}_{1}$ a value, $t$ say, then ${x}_{2}=11-4t$ and ${x}_{3}=15-5t$ . Thus there is an infinite number of solutions (one for each value of $t$ ).

In system (2) take the combination 5 times the first equation minus $2$ times the second equation. What does this tell you about the system?

The combination is ${x}_{1}-11{x}_{2}+9{x}_{3}=14,$ which conflicts with the third equation. There is thus no solution.

In practice, systems containing three or more linear equations are best solved by the method which we shall introduce in Section 8.3.

##### Exercises
1. Solve the following using the inverse matrix method:
1. $\begin{array}{ccccc}\hfill 2x& \hfill -& \hfill 3y& \hfill =& \hfill 1\\ \hfill 4x& \hfill +& \hfill 4y& \hfill =& \hfill 2\\ \hfill \end{array}$
2. $\begin{array}{ccccc}\hfill 2x& \hfill -& \hfill 5y& \hfill =& \hfill 2\\ \hfill -4x& \hfill +& \hfill 10y& \hfill =& \hfill 1\\ \hfill \end{array}$
3. $\begin{array}{ccccc}\hfill 6x& \hfill -& \hfill y& \hfill =& \hfill 0\\ \hfill 2x& \hfill -& \hfill 4y& \hfill =& \hfill 1\\ \hfill \end{array}$
2. Solve the following equations using matrix methods:
1. $\begin{array}{ccccccc}\hfill 2{x}_{1}& \hfill +& \hfill {x}_{2}& \hfill -& \hfill {x}_{3}& \hfill =& \hfill 0\\ \hfill {x}_{1}& \hfill & \hfill & \hfill +& \hfill {x}_{3}& \hfill =& \hfill 4\\ \hfill {x}_{1}& \hfill +& \hfill {x}_{2}& \hfill +& \hfill {x}_{3}& \hfill =& \hfill 0\end{array}$
2. $\begin{array}{ccccccc}\hfill {x}_{1}& \hfill -& \hfill {x}_{2}& \hfill +& \hfill {x}_{3}& \hfill =& \hfill 1\\ \hfill -{x}_{1}& \hfill & \hfill & \hfill +& \hfill {x}_{3}& \hfill =& \hfill 1\\ \hfill {x}_{1}& \hfill +& \hfill {x}_{2}& \hfill -& \hfill {x}_{3}& \hfill =& \hfill 0\end{array}$
1. $x=\frac{1}{2},\phantom{\rule{1em}{0ex}}y=0$
2. ${A}^{-1}$ does not exist.
3. $x=-\frac{1}{22},\phantom{\rule{1em}{0ex}}y=-\frac{3}{11}$
1. ${x}_{1}=\frac{8}{3},\phantom{\rule{1em}{0ex}}{x}_{2}=-4,\phantom{\rule{1em}{0ex}}{x}_{3}=\frac{4}{3}$
2. ${x}_{1}=\frac{1}{2},\phantom{\rule{1em}{0ex}}{x}_{2}=1,\phantom{\rule{1em}{0ex}}{x}_{3}=\frac{3}{2}$