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: [latex]X[/latex] is the matrix representing the variables of the system, and [latex]B[/latex] 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

[latex]AX=B[/latex]
To solve a system of linear equations using an inverse matrix, let [latex]A[/latex] be the coefficient matrix, let [latex]X[/latex] be the variable matrix, and let [latex]B[/latex] be the constant matrix. Thus, we want to solve a system [latex]AX=B[/latex]. For example, look at the following system of equations.
[latex]\begin{array}{c}{a}_{1}x+{b}_{1}y={c}_{1}\\ {a}_{2}x+{b}_{2}y={c}_{2}\end{array}[/latex]
From this system, the coefficient matrix is
[latex]A=\left[\begin{array}{cc}{a}_{1}& {b}_{1}\\ {a}_{2}& {b}_{2}\end{array}\right][/latex]
The variable matrix is
[latex]X=\left[\begin{array}{c}x\\ y\end{array}\right][/latex]
And the constant matrix is
[latex]B=\left[\begin{array}{c}{c}_{1}\\ {c}_{2}\end{array}\right][/latex]
Then [latex]AX=B[/latex] looks like
[latex]\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][/latex]
Recall the discussion earlier in this section regarding multiplying a real number by its inverse, [latex]\left({2}^{-1}\right)2=\left(\frac{1}{2}\right)2=1[/latex]. To solve a single linear equation [latex]ax=b[/latex] for [latex]x[/latex], we would simply multiply both sides of the equation by the multiplicative inverse (reciprocal) of [latex]a[/latex]. Thus,
[latex]\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}[/latex]
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 [latex]2\times 2[/latex] system and then move on to a [latex]3\times 3[/latex] system.

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

Given a system of equations, write the coefficient matrix [latex]A[/latex], the variable matrix [latex]X[/latex], and the constant matrix [latex]B[/latex]. Then
[latex]AX=B[/latex]
Multiply both sides by the inverse of [latex]A[/latex] to obtain the solution.
[latex]\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}[/latex]

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.
[latex]\begin{array}{r}\hfill 3x+8y=5\\ \hfill 4x+11y=7\end{array}[/latex]

Solution

Write the system in terms of a coefficient matrix, a variable matrix, and a constant matrix.
[latex]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][/latex]
Then
[latex]\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][/latex]
First, we need to calculate [latex]{A}^{-1}[/latex]. Using the formula to calculate the inverse of a 2 by 2 matrix, we have:
[latex]\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}[/latex]
So,
[latex]{A}^{-1}=\left[\begin{array}{cc}11& -8\\ -4& \text{ }\text{ }3\end{array}\right][/latex]
Now we are ready to solve. Multiply both sides of the equation by [latex]{A}^{-1}[/latex].
[latex]\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}[/latex]
The solution is [latex]\left(-1,1\right)[/latex].

Q & A

Can we solve for [latex]X[/latex] by finding the product [latex]B{A}^{-1}?[/latex]

No, recall that matrix multiplication is not commutative, so [latex]{A}^{-1}B\ne B{A}^{-1}[/latex]. Consider our steps for solving the matrix equation.
[latex]\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}[/latex]
Notice in the first step we multiplied both sides of the equation by [latex]{A}^{-1}[/latex], but the [latex]{A}^{-1}[/latex] was to the left of [latex]A[/latex] on the left side and to the left of [latex]B[/latex] 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.
[latex]\begin{array}{r}\hfill 5x+15y+56z=35\\ \hfill -4x - 11y - 41z=-26\\ \hfill -x - 3y - 11z=-7\end{array}[/latex]

Solution

Write the equation [latex]AX=B[/latex].
[latex]\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][/latex]
First, we will find the inverse of [latex]A[/latex] by augmenting with the identity.
[latex]\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][/latex]
Multiply row 1 by [latex]\frac{1}{5}[/latex].
[latex]\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][/latex]
Multiply row 1 by 4 and add to row 2.
[latex]\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][/latex]
Add row 1 to row 3.
[latex]\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][/latex]
Multiply row 2 by −3 and add to row 1.
[latex]\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][/latex]
Multiply row 3 by 5.
[latex]\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][/latex]
Multiply row 3 by [latex]\frac{1}{5}[/latex] and add to row 1.
[latex]\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][/latex]
Multiply row 3 by [latex]-\frac{19}{5}[/latex] and add to row 2.
[latex]\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][/latex]
So,
[latex]{A}^{-1}=\left[\begin{array}{ccc}-2& -3& 1\\ -3& 1& -19\\ 1& 0& 5\end{array}\right][/latex]
Multiply both sides of the equation by [latex]{A}^{-1}[/latex]. We want [latex]{A}^{-1}AX={A}^{-1}B:[/latex]
[latex]\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][/latex]
Thus,
[latex]{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][/latex]
The solution is [latex]\left(1,2,0\right)[/latex].

Try It 4

Solve the system using the inverse of the coefficient matrix.
[latex]\begin{array}{l}\text{ }2x - 17y+11z=0\hfill \\ \text{ }-x+11y - 7z=8\hfill \\ \text{ }3y - 2z=-2\hfill \end{array}[/latex]
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 [latex]\left[A\right][/latex] and [latex]\left[B\right][/latex].
  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
[latex]\begin{array}{l}2x+3y+z=32\hfill \\ 3x+3y+z=-27\hfill \\ 2x+4y+z=-2\hfill \end{array}[/latex]

Solution

On the matrix page of the calculator, enter the coefficient matrix as the matrix variable [latex]\left[A\right][/latex], and enter the constant matrix as the matrix variable [latex]\left[B\right][/latex].
[latex]\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][/latex]
On the home screen of the calculator, type in the multiplication to solve for [latex]X[/latex], calling up each matrix variable as needed.
[latex]{\left[A\right]}^{-1}\times \left[B\right][/latex]
Evaluate the expression.
[latex]\left[\begin{array}{c}-59\\ -34\\ 252\end{array}\right][/latex]

Licenses & Attributions

CC licensed content, Specific attribution