Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts
  • You do not have permission to view this page - please try signing in.

2.5: Solving Matrix Equations AX=B

( \newcommand{\kernel}{\mathrm{null}\,}\)

Learning Objectives
  • T/F: To solve the matrix equation AX=B, put the matrix [AX] into reduced row echelon form and interpret the result properly.
  • T/F: The first column of a matrix product AB is A times the first column of B.
  • Give two reasons why one might solve for the columns of X in the equation AX=B separately.

We began last section talking about solving numerical equations like ax=b for x. We mentioned that solving matrix equations of the form AX=B is of interest, but we first learned how to solve the related, but simpler, equations Ax=b. In this section we will learn how to solve the general matrix equation AX=B for X.

We will start by considering the best case scenario when solving Ax=b; that is, when A is square and we have exactly one solution. For instance, suppose we want to solve Ax=b where

A=[1121]andb=[01].

We know how to solve this; put the appropriate matrix into reduced row echelon form and interpret the result.

[110211]rref[101011]

We read from this that

x=[11].

Written in a more general form, we found our solution by forming the augmented matrix

[Ab]

and interpreting its reduced row echelon form:

[Ab]rref[Ix]

Notice that when the reduced row echelon form of A is the identity matrix I we have exactly one solution. This, again, is the best case scenario.

We apply the same general technique to solving the matrix equation AX=B for X. We’ll assume that A is a square matrix (B need not be) and we’ll form the augmented matrix

[AB].

Putting this matrix into reduced row echelonform will give us X, much like we found x before.

[AB]rref[IX]

As long as the reduced row echelon form of A is the identity matrix, this technique works great. After a few examples, we’ll discuss why this technique works, and we’ll also talk just a little bit about what happens when the reduced row echelon form of A is not the identity matrix.

First, some examples.

Example 2.5.1

Solve the matrix equation AX=B where

A=[1153]andB=[8131321721].

Solution

To solve AX=B for X, we form the proper augmented matrix, put it into reduced row echelon form, and interpret the result.

[11813153321721]rref[1017301962]

We read from the reduced row echelon form of the matrix that

X=[173962].

We can easily check to see if our answer is correct by multiplying AX.

Example 2.5.2

Solve the matrix equation AX=B where

A=[102012210]andB=[122624].

Solution

To solve, let’s again form the augmented matrix

[AB],

put it into reduced row echelon form, and interpret the result.

[102120122621024]rref[100100100400111]

We see from this that

X=[100411].

Why does this work? To see the answer, let’s define five matrices.

A=[1234],u=[11],v=[11],w=[56]andX=[115116]

Notice that u, v and w are the first, second and third columns of X, respectively. Now consider this list of matrix products: Au, Av, Aw and AX.

Au=[1234][11]=[37] Au=[1234][11]=[11]
Au=[1234][56]=[1739] AX=[1234][115116]=[31177139]

So again note that the columns of X are u, v and w; that is, we can write

X=[uvw].

Notice also that the columns of AX are Au, Av and Aw, respectively. Thus we can write

AX=A[uvw]=[AuAvAw]=[[37][11][1739]]=[31177139]

We summarize what we saw above in the following statement:

The columns of a matrix product AX are A times the columns of X.

How does this help us solve the matrix equation AX=B for X? Assume that A is a square matrix (that forces X and B to be the same size). We’ll let x1,x2,xn denote the columns of the (unknown) matrix X, and we’ll let b1,b2,bn denote the columns of B. We want to solve AX=B for X. That is, we want X where

AX=BA[x1x2xn]=[b1b2bn][Ax1Ax2Axn]=[b1b2bn]

If the matrix on the left hand side is equal to the matrix on the right, then their respective columns must be equal. This means we need to solve n equations:

Ax1=b1Ax2=b2=Axn=bn

We already know how to do this; this is what we learned in the previous section. Let’s do this in a concrete example. In our above work we defined matrices A and X, and looked at the product AX. Let’s call the product B; that is, set B=AX. Now, let’s pretend that we don’t know what X is, and let’s try to find the matrix X that satisfies the equation AX=B. As a refresher, recall that

A=[1234]andB=[31177139].

Since A is a 2×2 matrix and B is a 2×3 matrix, what dimensions must X be in the equation AX=B? The number of rows of X must match the number of columns of A; the number of columns of X must match the number of columns of B. Therefore we know that X must be a 2×3 matrix.

We’ll call the three columns of X x1,x2 and x3. Our previous explanation tells us that if AX=B, then:

AX=BA[x1x2x3]=[31177139][Ax1Ax2Ax3]=[31177139]

Hence

Ax1=[37]Ax2=[11]Ax3=[1739]

To find x1, we form the proper augmented matrix and put it into reduced row echelon form and interpret the results.

[123347]rref[101011]

This shows us that

x1=[11].

To find x2, we again form an augmented matrix and interpret its reduced row echelon form.

[121341]rref[101011]

Thus

x2=[11]

which matches with what we already knew from above.

Before continuing on in this manner to find x3, we should stop and think. If the matrix vector equation Ax=b is consistent, then the steps involved in putting

[Ab]

into reduced row echelon form depend only on A; it does not matter what b is. So when we put the two matrices

[123347]and[121341]

from above into reduced row echelon form, we performed exactly the same steps! (In fact, those steps are: 3R1+R2R2; 12R2R2; 2R2+R1R1.)

Instead of solving for each column of X separately, performing the same steps to put the necessary matrices into reduced row echelon form three different times, why don’t we just do it all at once?1 Instead of individually putting

[123347],[121341]and[12173439]

into reduced row echelon form, let's just put

[123117347139]

into reduced row echelon form.

[123117347139]rref[1011501116]

By looking at the last three columns, we see X:

X=[115116].

Now that we’ve justified the technique we’ve been using in this section to solve AX=B for X, we reinforce its importance by restating it as a Key Idea.

Key Idea 2.5.1: Solving AX=B

Let A be an n×n matrix, where the reduced row echelon form of A is I. To solve the matrix equation AX=B for X,

  1. Form the augmented matrix [AB].
  2. Put this matrix into reduced row echelon form. It will be of the form [IX], where X appears in the columns where B once was.

These simple steps cause us to ask certain questions. First, we specify above that A should be a square matrix. What happens if A isn’t square? Is a solution still possible? Secondly, we only considered cases where the reduced row echelon form of A was I (and stated that as a requirement in our Key Idea). What if the reduced row echelon form of A isn’t ? Would we still be able to find a solution? (Instead of having exactly one solution, could we have no solution? Infinite solutions? How would we be able to tell?)

These questions are good to ask, and we leave it to the reader to discover their answers. Instead of tackling these questions, we instead tackle the problem of “Why do we care about solving AX=B?” The simple answer is that, for now, we only care about the special case when B=I. By solving AX=I for X, we find a matrix X that, when multiplied by A, gives the identity I. That will be very useful.

Footnotes

[1] One reason to do it three different times is that we enjoy doing unnecessary work. Another reason could be that we are stupid.↩︎


This page titled 2.5: Solving Matrix Equations AX=B is shared under a CC BY-NC 3.0 license and was authored, remixed, and/or curated by Gregory Hartman et al. via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?