We've updated our
Privacy Policy effective December 15. Please read our updated Privacy Policy and tap

Study Guides > MATH 1314: College Algebra

Solving a System of Linear Equations Using the Inverse of a Matrix

Solving a system of linear equations using the inverse of a matrix requires the definition of two new matrices: XX is the matrix representing the variables of the system, and BB is the matrix representing the constants. Using matrix multiplication, we may define a system of equations with the same number of equations as variables as

AX=BAX=B
To solve a system of linear equations using an inverse matrix, let AA be the coefficient matrix, let XX be the variable matrix, and let BB be the constant matrix. Thus, we want to solve a system AX=BAX=B. For example, look at the following system of equations.
a1x+b1y=c1a2x+b2y=c2\begin{array}{c}{a}_{1}x+{b}_{1}y={c}_{1}\\ {a}_{2}x+{b}_{2}y={c}_{2}\end{array}
From this system, the coefficient matrix is
A=[a1b1a2b2]A=\left[\begin{array}{cc}{a}_{1}& {b}_{1}\\ {a}_{2}& {b}_{2}\end{array}\right]
The variable matrix is
X=[xy]X=\left[\begin{array}{c}x\\ y\end{array}\right]
And the constant matrix is
B=[c1c2]B=\left[\begin{array}{c}{c}_{1}\\ {c}_{2}\end{array}\right]
Then AX=BAX=B looks like
[a1b1a2b2] [xy]=[c1c2]\left[\begin{array}{cc}{a}_{1}& {b}_{1}\\ {a}_{2}& {b}_{2}\end{array}\right]\text{ }\left[\begin{array}{c}x\\ y\end{array}\right]=\left[\begin{array}{c}{c}_{1}\\ {c}_{2}\end{array}\right]
Recall the discussion earlier in this section regarding multiplying a real number by its inverse, (21)2=(12)2=1\left({2}^{-1}\right)2=\left(\frac{1}{2}\right)2=1. To solve a single linear equation ax=bax=b for xx, we would simply multiply both sides of the equation by the multiplicative inverse (reciprocal) of aa. Thus,
 ax=b (1a)ax=(1a)b(a1 )ax=(a1)b[(a1)a]x=(a1)b 1x=(a1)b x=(a1)b\begin{array}{c}\text{ }ax=b\\ \text{ }\left(\frac{1}{a}\right)ax=\left(\frac{1}{a}\right)b\\ \left({a}^{-1}\text{ }\right)ax=\left({a}^{-1}\right)b\\ \left[\left({a}^{-1}\right)a\right]x=\left({a}^{-1}\right)b\\ \text{ }1x=\left({a}^{-1}\right)b\\ \text{ }x=\left({a}^{-1}\right)b\end{array}
The only difference between a solving a linear equation and a system of equations written in matrix form is that finding the inverse of a matrix is more complicated, and matrix multiplication is a longer process. However, the goal is the same—to isolate the variable. We will investigate this idea in detail, but it is helpful to begin with a 2×22\times 2 system and then move on to a 3×33\times 3 system.

A General Note: Solving a System of Equations Using the Inverse of a Matrix

Given a system of equations, write the coefficient matrix AA, the variable matrix XX, and the constant matrix BB. Then
AX=BAX=B
Multiply both sides by the inverse of AA to obtain the solution.
(A1)AX=(A1)B[(A1)A]X=(A1)BIX=(A1)BX=(A1)B\begin{array}{r}\hfill \left({A}^{-1}\right)AX=\left({A}^{-1}\right)B\\ \hfill \left[\left({A}^{-1}\right)A\right]X=\left({A}^{-1}\right)B\\ \hfill IX=\left({A}^{-1}\right)B\\ \hfill X=\left({A}^{-1}\right)B\end{array}

Q & A

If the coefficient matrix does not have an inverse, does that mean the system has no solution?

No, if the coefficient matrix is not invertible, the system could be inconsistent and have no solution, or be dependent and have infinitely many solutions.

Example 7: Solving a 2 × 2 System Using the Inverse of a Matrix

Solve the given system of equations using the inverse of a matrix.
3x+8y=54x+11y=7\begin{array}{r}\hfill 3x+8y=5\\ \hfill 4x+11y=7\end{array}

Solution

Write the system in terms of a coefficient matrix, a variable matrix, and a constant matrix.
A=[38411],X=[xy],B=[57]A=\left[\begin{array}{cc}3& 8\\ 4& 11\end{array}\right],X=\left[\begin{array}{c}x\\ y\end{array}\right],B=\left[\begin{array}{c}5\\ 7\end{array}\right]
Then
[38411] [xy]=[57]\left[\begin{array}{cc}3& 8\\ 4& 11\end{array}\right]\text{ }\left[\begin{array}{c}x\\ y\end{array}\right]=\left[\begin{array}{c}5\\ 7\end{array}\right]
First, we need to calculate A1{A}^{-1}. Using the formula to calculate the inverse of a 2 by 2 matrix, we have:
A1=1adbc[dbca] =13(11)8(4)[11843] =11[11843]\begin{array}{l}{A}^{-1}=\frac{1}{ad-bc}\left[\begin{array}{cc}d& -b\\ -c& a\end{array}\right]\hfill \\ \text{ }=\frac{1}{3\left(11\right)-8\left(4\right)}\left[\begin{array}{cc}11& -8\\ -4& 3\end{array}\right]\hfill \\ \text{ }=\frac{1}{1}\left[\begin{array}{cc}11& -8\\ -4& 3\end{array}\right]\hfill \end{array}
So,
A1=[1184  3]{A}^{-1}=\left[\begin{array}{cc}11& -8\\ -4& \text{ }\text{ }3\end{array}\right]
Now we are ready to solve. Multiply both sides of the equation by A1{A}^{-1}.
(A1)AX=(A1)B[11843] [38411] [xy]=[11843] [57][1001] [xy]=[11(5)+(8)74(5)+3(7)][xy]=[11]\begin{array}{l}\left({A}^{-1}\right)AX=\left({A}^{-1}\right)B\hfill \\ \left[\begin{array}{rr}\hfill 11& \hfill -8\\ \hfill -4& \hfill 3\end{array}\right]\text{ }\left[\begin{array}{cc}3& 8\\ 4& 11\end{array}\right]\text{ }\left[\begin{array}{c}x\\ y\end{array}\right]=\left[\begin{array}{rr}\hfill 11& \hfill -8\\ \hfill -4& \hfill 3\end{array}\right]\text{ }\left[\begin{array}{c}5\\ 7\end{array}\right]\hfill \\ \left[\begin{array}{cc}1& 0\\ 0& 1\end{array}\right]\text{ }\left[\begin{array}{c}x\\ y\end{array}\right]=\left[\begin{array}{r}\hfill 11\left(5\right)+\left(-8\right)7\\ \hfill -4\left(5\right)+3\left(7\right)\end{array}\right]\hfill \\ \left[\begin{array}{c}x\\ y\end{array}\right]=\left[\begin{array}{r}\hfill -1\\ \hfill 1\end{array}\right]\hfill \end{array}
The solution is (1,1)\left(-1,1\right).

Q & A

Can we solve for XX by finding the product BA1?B{A}^{-1}?

No, recall that matrix multiplication is not commutative, so A1BBA1{A}^{-1}B\ne B{A}^{-1}. Consider our steps for solving the matrix equation.
(A1)AX=(A1)B[(A1)A]X=(A1)BIX=(A1)BX=(A1)B\begin{array}{r}\hfill \left({A}^{-1}\right)AX=\left({A}^{-1}\right)B\\ \hfill \left[\left({A}^{-1}\right)A\right]X=\left({A}^{-1}\right)B\\ \hfill IX=\left({A}^{-1}\right)B\\ \hfill X=\left({A}^{-1}\right)B\end{array}
Notice in the first step we multiplied both sides of the equation by A1{A}^{-1}, but the A1{A}^{-1} was to the left of AA on the left side and to the left of BB on the right side. Because matrix multiplication is not commutative, order matters.

Example 8: Solving a 3 × 3 System Using the Inverse of a Matrix

Solve the following system using the inverse of a matrix.
5x+15y+56z=354x11y41z=26x3y11z=7\begin{array}{r}\hfill 5x+15y+56z=35\\ \hfill -4x - 11y - 41z=-26\\ \hfill -x - 3y - 11z=-7\end{array}

Solution

Write the equation AX=BAX=B.
[51556411411311] [xyz]=[35267]\left[\begin{array}{ccc}5& 15& 56\\ -4& -11& -41\\ -1& -3& -11\end{array}\right]\text{ }\left[\begin{array}{c}x\\ y\\ z\end{array}\right]=\left[\begin{array}{r}\hfill 35\\ \hfill -26\\ \hfill -7\end{array}\right]
First, we will find the inverse of AA by augmenting with the identity.
[51556411411311100010001]\left[\begin{array}{rrr}\hfill 5& \hfill 15& \hfill 56\\ \hfill -4& \hfill -11& \hfill -41\\ \hfill -1& \hfill -3& \hfill -11\end{array}|\begin{array}{ccc}1& 0& 0\\ 0& 1& 0\\ 0& 0& 1\end{array}\right]
Multiply row 1 by 15\frac{1}{5}.
[135654114113111500010001]\left[\begin{array}{ccc}1& 3& \frac{56}{5}\\ -4& -11& -41\\ -1& -3& -11\end{array}|\begin{array}{ccc}\frac{1}{5}& 0& 0\\ 0& 1& 0\\ 0& 0& 1\end{array}\right]
Multiply row 1 by 4 and add to row 2.
[1356501195131115004510001]\left[\begin{array}{ccc}1& 3& \frac{56}{5}\\ 0& 1& \frac{19}{5}\\ -1& -3& -11\end{array}|\begin{array}{ccc}\frac{1}{5}& 0& 0\\ \frac{4}{5}& 1& 0\\ 0& 0& 1\end{array}\right]
Add row 1 to row 3.
[13565011950015150045101501]\left[\begin{array}{ccc}1& 3& \frac{56}{5}\\ 0& 1& \frac{19}{5}\\ 0& 0& \frac{1}{5}\end{array}|\begin{array}{ccc}\frac{1}{5}& 0& 0\\ \frac{4}{5}& 1& 0\\ \frac{1}{5}& 0& 1\end{array}\right]
Multiply row 2 by −3 and add to row 1.
[10150119500151153045101501]\left[\begin{array}{ccc}1& 0& -\frac{1}{5}\\ 0& 1& \frac{19}{5}\\ 0& 0& \frac{1}{5}\end{array}|\begin{array}{ccc}-\frac{11}{5}& -3& 0\\ \frac{4}{5}& 1& 0\\ \frac{1}{5}& 0& 1\end{array}\right]
Multiply row 3 by 5.
[101501195001115304510105]\left[\begin{array}{ccc}1& 0& -\frac{1}{5}\\ 0& 1& \frac{19}{5}\\ 0& 0& 1\end{array}|\begin{array}{ccc}-\frac{11}{5}& -3& 0\\ \frac{4}{5}& 1& 0\\ 1& 0& 5\end{array}\right]
Multiply row 3 by 15\frac{1}{5} and add to row 1.
[100011950012314510105]\left[\begin{array}{ccc}1& 0& 0\\ 0& 1& \frac{19}{5}\\ 0& 0& 1\end{array}|\begin{array}{ccc}-2& -3& 1\\ \frac{4}{5}& 1& 0\\ 1& 0& 5\end{array}\right]
Multiply row 3 by 195-\frac{19}{5} and add to row 2.
[1000100012313119105]\left[\begin{array}{ccc}1& 0& 0\\ 0& 1& 0\\ 0& 0& 1\end{array}|\begin{array}{ccc}-2& -3& 1\\ -3& 1& -19\\ 1& 0& 5\end{array}\right]
So,
A1=[2313119105]{A}^{-1}=\left[\begin{array}{ccc}-2& -3& 1\\ -3& 1& -19\\ 1& 0& 5\end{array}\right]
Multiply both sides of the equation by A1{A}^{-1}. We want A1AX=A1B:{A}^{-1}AX={A}^{-1}B:
[2313119105] [51556411411311] [xyz]=[2313119105] [35267]\left[\begin{array}{rrr}\hfill -2& \hfill -3& \hfill 1\\ \hfill -3& \hfill 1& \hfill -19\\ \hfill 1& \hfill 0& \hfill 5\end{array}\right]\text{ }\left[\begin{array}{rrr}\hfill 5& \hfill 15& \hfill 56\\ \hfill -4& \hfill -11& \hfill -41\\ \hfill -1& \hfill -3& \hfill -11\end{array}\right]\text{ }\left[\begin{array}{c}x\\ y\\ z\end{array}\right]=\left[\begin{array}{rrr}\hfill -2& \hfill -3& \hfill 1\\ \hfill -3& \hfill 1& \hfill -19\\ \hfill 1& \hfill 0& \hfill 5\end{array}\right]\text{ }\left[\begin{array}{r}\hfill 35\\ \hfill -26\\ \hfill -7\end{array}\right]
Thus,
A1B=[70+78710526+13335+035]=[120]{A}^{-1}B=\left[\begin{array}{r}\hfill -70+78 - 7\\ \hfill -105 - 26+133\\ \hfill 35+0 - 35\end{array}\right]=\left[\begin{array}{c}1\\ 2\\ 0\end{array}\right]
The solution is (1,2,0)\left(1,2,0\right).

Try It 4

Solve the system using the inverse of the coefficient matrix.
 2x17y+11z=0 x+11y7z=8 3y2z=2\begin{array}{l}\text{ }2x - 17y+11z=0\hfill \\ \text{ }-x+11y - 7z=8\hfill \\ \text{ }3y - 2z=-2\hfill \end{array}
Solution

How To: Given a system of equations, solve with matrix inverses using a calculator.

  1. Save the coefficient matrix and the constant matrix as matrix variables [A]\left[A\right] and [B]\left[B\right].
  2. Enter the multiplication into the calculator, calling up each matrix variable as needed.
  3. If the coefficient matrix is invertible, the calculator will present the solution matrix; if the coefficient matrix is not invertible, the calculator will present an error message.

Example 9: Using a Calculator to Solve a System of Equations with Matrix Inverses

Solve the system of equations with matrix inverses using a calculator
2x+3y+z=323x+3y+z=272x+4y+z=2\begin{array}{l}2x+3y+z=32\hfill \\ 3x+3y+z=-27\hfill \\ 2x+4y+z=-2\hfill \end{array}

Solution

On the matrix page of the calculator, enter the coefficient matrix as the matrix variable [A]\left[A\right], and enter the constant matrix as the matrix variable [B]\left[B\right].
[A]=[231331241], [B]=[32272]\left[A\right]=\left[\begin{array}{ccc}2& 3& 1\\ 3& 3& 1\\ 2& 4& 1\end{array}\right],\text{ }\left[B\right]=\left[\begin{array}{c}32\\ -27\\ -2\end{array}\right]
On the home screen of the calculator, type in the multiplication to solve for XX, calling up each matrix variable as needed.
[A]1×[B]{\left[A\right]}^{-1}\times \left[B\right]
Evaluate the expression.
[5934252]\left[\begin{array}{c}-59\\ -34\\ 252\end{array}\right]

Licenses & Attributions