How to use inverse matrix to solve system of equations

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

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=[a 1b1a2b2]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=[c1 c2]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,

(2−1) 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

a a

. Thus,

 ax=b (1a)ax=(1a)b(a−1 )ax=( a−1)b[(a−1)a]x=(a−1) b 1x=(a−1)b x=(a−1)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

Multiply both sides by the inverse of

AA

to obtain the solution.

(A−1)AX=(A−1)B [(A−1)A]X=(A−1)BIX=(A−1)BX=(A−1)B \begin{array}{r}\qquad \left({A}^{-1}\right)AX=\left({A}^{-1}\right)B\\ \qquad \left[\left({A}^{-1}\right)A\right]X=\left({A}^{-1}\right)B\\ \qquad IX=\left({A}^{-1}\right)B\\ \qquad 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}\qquad 3x+8y=5\\ \qquad 4x+11y=7\end{array}

Solution

Write the system in terms of a coefficient matrix, a variable matrix, and a constant matrix.

A=[38 411],X=[x y],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

A−1{A}^{-1}

. Using the formula to calculate the inverse of a 2 by 2 matrix, we have:

A−1=1ad−bc[d−b−ca]  =13(11)−8(4)[11−8−43] =11 [11−8−43]\begin{array}{l}{A}^{-1}=\frac{1}{ad-bc}\left[\begin{array}{cc}d& -b\\ -c& a\end{array}\right]\qquad \\ \text{ }=\frac{1}{3\left(11\right)-8\left(4\right)}\left[\begin{array}{cc}11& -8\\ -4& 3\end{array}\right]\qquad \\ \text{ }=\frac{1}{1}\left[\begin{array}{cc}11& -8\\ -4& 3\end{array}\right]\qquad \end{array}

So,

A−1=[11−8 −4  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

A−1{A}^{-1}

.

(A−1)AX=(A−1)B[11−8−43 ] [38411 ] [xy]=[11−8−43 ] [57][1001] [xy]=[ 11(5)+(−8)7−4(5)+3(7) ][xy]=[−11]\begin{array}{l}\left({A}^{-1}\right)AX=\left({A}^{-1}\right)B\qquad \\ \left[\begin{array}{rr}\qquad 11& \qquad -8\\ \qquad -4& \qquad 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}\qquad 11& \qquad -8\\ \qquad -4& \qquad 3\end{array}\right]\text{ }\left[\begin{array}{c}5\\ 7\end{array}\right]\qquad \\ \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}\qquad 11\left(5\right)+\left(-8\right)7\\ \qquad -4\left(5\right)+3\left(7\right)\end{array}\right]\qquad \\ \left[\begin{array}{c}x\\ y\end{array}\right]=\left[\begin{array}{r}\qquad -1\\ \qquad 1\end{array}\right]\qquad \end{array}

The solution is

(−1,1)\left(-1,1\right)

.

Q & A

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

No, recall that matrix multiplication is not commutative, so

A−1 B≠BA−1{A}^{-1}B\ne B{A}^{-1}

. Consider our steps for solving the matrix equation.

(A−1)AX=(A−1)B[(A −1)A]X=(A−1)BIX=(A−1) BX=(A−1)B\begin{array}{r}\qquad \left({A}^{-1}\right)AX=\left({A}^{-1}\right)B\\ \qquad \left[\left({A}^{-1}\right)A\right]X=\left({A}^{-1}\right)B\\ \qquad IX=\left({A}^{-1}\right)B\\ \qquad X=\left({A}^{-1}\right)B\end{array}

Notice in the first step we multiplied both sides of the equation by

A−1{A}^{-1}

, but the

A−1{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=35−4x−11y−41z=−26 −x−3y−11z=−7\begin{array}{r}\qquad 5x+15y+56z=35\\ \qquad -4x - 11y - 41z=-26\\ \qquad -x - 3y - 11z=-7\end{array}

Solution

Write the equation

AX=BAX=B

.

[51556−4−11−41 −1−3−11] [xyz]=[35 −26−7]\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}\qquad 35\\ \qquad -26\\ \qquad -7\end{array}\right]

First, we will find the inverse of

AA

by augmenting with the identity.

[51556 −4−11−41−1 −3−11∣100010001]\left[\begin{array}{rrr}\qquad 5& \qquad 15& \qquad 56\\ \qquad -4& \qquad -11& \qquad -41\\ \qquad -1& \qquad -3& \qquad -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}

.

[13565−4−11−41 −1−3−11∣1500010001]\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.

[1356 501195−1−3 −11∣1500 4510001 ]\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.

[1356501 1950015∣ 15004510 1501]\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.

[10−15011950 015∣−115 −30451015 01]\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.

[10−15 01195001∣−115−30 4510105]\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.

[10001195001∣−2−314510105]\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.

[100010001 ∣−2−31− 31−19105]\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,

A−1=[−2−31−31 −19105]{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

A−1{A}^{-1}

. We want

A−1AX=A−1B:{A}^{-1}AX={A}^{-1}B:



[ −2−31−3 1−1910 5] [5 1556−4−11−41−1−3−11]  [xyz]=[−2−31 −31−191 05] [35−26−7]\left[\begin{array}{rrr}\qquad -2& \qquad -3& \qquad 1\\ \qquad -3& \qquad 1& \qquad -19\\ \qquad 1& \qquad 0& \qquad 5\end{array}\right]\text{ }\left[\begin{array}{rrr}\qquad 5& \qquad 15& \qquad 56\\ \qquad -4& \qquad -11& \qquad -41\\ \qquad -1& \qquad -3& \qquad -11\end{array}\right]\text{ }\left[\begin{array}{c}x\\ y\\ z\end{array}\right]=\left[\begin{array}{rrr}\qquad -2& \qquad -3& \qquad 1\\ \qquad -3& \qquad 1& \qquad -19\\ \qquad 1& \qquad 0& \qquad 5\end{array}\right]\text{ }\left[\begin{array}{r}\qquad 35\\ \qquad -26\\ \qquad -7\end{array}\right]

Thus,

A−1B=[−70+78−7 −105−26+13335+0−35]=[ 120]{A}^{-1}B=\left[\begin{array}{r}\qquad -70+78 - 7\\ \qquad -105 - 26+133\\ \qquad 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.

 2x−17y+11z=0 −x +11y−7z=8 3y−2z=−2\begin{array}{l}\text{ }2x - 17y+11z=0\qquad \\ \text{ }-x+11y - 7z=8\qquad \\ \text{ }3y - 2z=-2\qquad \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\qquad \\ 3x+3y+z=-27\qquad \\ 2x+4y+z=-2\qquad \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]=[32−27 −2]\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.

[− 59−34252]\left[\begin{array}{c}-59\\ -34\\ 252\end{array}\right]

Licenses and Attributions

How do you use an inverse matrix to solve systems of equations?

SOLVING A SYSTEM OF EQUATIONS USING THE INVERSE OF A MATRIX.
Given a system of equations, write the coefficient matrix A, the variable matrix X, and the constant matrix B. Then..
Multiply both sides by the inverse of A to obtain the solution..

How can matrices be used to solve systems of equations?

We will use a matrix to represent a system of linear equations. We write each equation in standard form and the coefficients of the variables and the constant of each equation becomes a row in the matrix. Each column then would be the coefficients of one of the variables in the system or the constants.