Skip to content Skip to navigation

OpenStax_CNX

You are here: Home » Content » Matrix Concepts -- Solving Linear Equations

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • Bookshare

    This module is included inLens: Bookshare's Lens
    By: Bookshare - A Benetech InitiativeAs a part of collection: "Advanced Algebra II: Conceptual Explanations"

    Comments:

    "DAISY and BRF versions of this collection are available."

    Click the "Bookshare" link to see all content affiliated with them.

  • Featured Content display tagshide tags

    This module is included inLens: Connexions Featured Content
    By: ConnexionsAs a part of collection: "Advanced Algebra II: Conceptual Explanations"

    Comments:

    "This is the "concepts" book in Kenny Felder's "Advanced Algebra II" series. This text was created with a focus on 'doing' and 'understanding' algebra concepts rather than simply hearing about […]"

    Click the "Featured Content" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Also in these lenses

  • Busbee's Math Materials display tagshide tags

    This module is included inLens: Busbee's Math Materials Lens
    By: Kenneth Leroy BusbeeAs a part of collection: "Advanced Algebra II: Conceptual Explanations"

    Click the "Busbee's Math Materials" link to see all content selected in this lens.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

Matrix Concepts -- Solving Linear Equations

Module by: Kenny M. Felder. E-mail the author

Summary: This module explains how to use matrices to solve linear equations.

At this point, you may be left with a pretty negative feeling about matrices. The initial few ideas—adding matrices, subtracting them, multiplying a matrix by a constant, and matrix equality—seem almost too obvious to be worth talking about. On the other hand, multiplying matrices and taking determinants seem to be strange, arbitrary sequences of steps with little or no purpose.

A great deal of it comes together in solving linear equations. We have seen, in the chapter on simultaneous equations, how to solve two equations with two unknowns. But suppose we have three equations with three unknowns? Or four, or five? Such situations are more common than you might suppose in the real world. And even if you are allowed to use a calculator, it is not at all obvious how to solve such a problem in a reasonable amount of time.

Surprisingly, the things we have learned about matrix multiplication, about the identity matrix, about inverse matrices, and about matrix equality, give us a very fast way to solve such problems on a calculator!

Consider the following example, three equations with three unknowns:

x + 2 y - z = 11 x+2y-z=11
(1)
2 x - y + 3 z = 7 2x-y+3z=7
(2)
7 x - 3 y - 2 z = 2 7x-3y-2z=2
(3)

Define a 3×3 matrix [A] which is the coefficients of all the variables on the left side of the equal signs:

[ A ] = [A]= 121213732121213732 size 12{ left [ matrix { 1 {} # 2 {} # - 1 {} ## 2 {} # - 1 {} # 3 {} ## 7 {} # - 3 {} # - 2{} } right ]} {}

Define a 3×1 matrix [B] which is the numbers on the right side of the equal signs:

[ B ] =[B]= 11721172 size 12{ left [ matrix { "11" {} ## 7 {} ## 2 } right ]} {}

Punch these matrices into your calculator, and then ask the calculator for [A-1][B]: that is, the inverse of matrix [A], multiplied by matrix [B].

Figure 1
Figure 1 (graphics1.png)

The calculator responds with a 3×1 matrix which is all three answers. In this case, x = 3 x=3, y = 5 y=5, and z = 2 z=2.

The whole process takes no longer than it takes to punch a few matrices into the calculator. And it works just as quickly for 4 equations with 4 unknowns, or 5, etc.

Huh? Why the heck did that work?

Solving linear equations in this way is fast and easy. But with just a little work—and with the formalisms that we have developed so far about matrices—we can also show why this method works.

Step 1: In Which We Replace Three Linear Equations With One Matrix Equation

First of all, consider the following matrix equation:

x+2yz2xy+3z7x3y2zx+2yz2xy+3z7x3y2z size 12{ left [ matrix { x+2y - z {} ## 2x - y+3z {} ## 7x - 3y - 2z } right ]} {}== 11721172 size 12{ left [ matrix { "11" {} ## 7 {} ## 2 } right ]} {}

The matrix on the left may look like a 3×3 matrix, but it is actually a 3×1 matrix. The top element is x + 2 y - z x+2y-z (all one big number), and so on.

Remember what it means for two matrices to be equal to each other. They have to have the same dimensions (graphics2.png). And all the elements have to be equal to each other. So for this matrix equation to be true, all three of the following equations must be satisfied:

x + 2 y z = 11 x+2yz=11
(4)
2 x y + 3 z = 7 2xy+3z=7
(5)
7 x 3 y 2 z = 2 7x3y2z=2
(6)

Look familiar? Hey, this is the three equations we started with! The point is that this one matrix equation is equivalent to those three linear equations. We can replace the original three equations with one matrix equation, and then set out to solve that.

Step 2: In Which We Replace a Simple Matrix Equation with a More Complicated One

Do the following matrix multiplication. (You will need to do this by hand—since it has variables, your calculator can’t do it for you.)

1 2 1 2 1 3 7 3 2 1 2 1 2 1 3 7 3 2 size 12{ left [ matrix { 1 {} # 2 {} # - 1 {} ## 2 {} # - 1 {} # 3 {} ## 7 {} # - 3 {} # - 2{} } right ]} {} x y z x y z size 12{ left [ matrix { x {} ## y {} ## z } right ]} {}

If you did it correctly, you should have wound up with the following 3×1 matrix:

x + 2y z 2x y + 3z 7x 3y 2z x + 2y z 2x y + 3z 7x 3y 2z size 12{ left [ matrix { x+2y - z {} ## 2x - y+3z {} ## 7x - 3y - 2z } right ]} {}
(7)

Once again, we pause to say…hey, that looks familiar! Yes, it’s the matrix that we used in Step 1. So we can now rewrite the matrix equation from Step 1 in this way:

121213732121213732 size 12{ left [ matrix { 1 {} # 2 {} # - 1 {} ## 2 {} # - 1 {} # 3 {} ## 7 {} # - 3 {} # - 2{} } right ]} {}xyzxyz size 12{ left [ matrix { x {} ## y {} ## z } right ]} {}== 11721172 size 12{ left [ matrix { "11" {} ## 7 {} ## 2 } right ]} {}

Stop for a moment and make sure you’re following all this. I have shown, in two separate steps, that this matrix equation is equivalent to the three linear equations that we started with.

But this matrix equation has a nice property that the previous one did not. The first matrix (which we called [A] a long time ago) and the third one ([B]) contain only numbers. If we refer to the middle matrix as [X] then we can write our equation more concisely:

[ A ] [ X ] = [ B ] [A][X]=[B], where [ A ] = [A]= 121213732121213732 size 12{ left [ matrix { 1 {} # 2 {} # - 1 {} ## 2 {} # - 1 {} # 3 {} ## 7 {} # - 3 {} # - 2{} } right ]} {}, [ X ] = [X]= xyzxyz size 12{ left [ matrix { x {} ## y {} ## z } right ]} {}, and [ B ] = [B]= 11721172 size 12{ left [ matrix { "11" {} ## 7 {} ## 2 } right ]} {}

Most importantly, [ X ] [X] contains the three variables we want to solve for! If we can solve this equation for [ X ] [X] we will have found our three variables x x, y y, and z z.

Step 3: In Which We Solve a Matrix Equation

We have rewritten our original equations as [ A ] [ X ] = [ B ] [A][X]=[B], and redefined our original goal as “solve this matrix equation for [ X ] [X].” If these were numbers, we would divide both sides by [ A ] [A]. But these are matrices, and we have never defined a division operation for matrices. Fortunately, we can do something just as good, which is multiplying both sides by [ A ] –1 [A ] –1 . (Just as, with numbers, you can replace “dividing by 3” with “multiplying by 1 3 1 3 .”)

Table 1
Solving a Matrix Equation
[ A ] [ X ] = [ B ] [A][X]=[B] The problem.
[ A ] –1 [ A ] [ X ] = [ A ] –1 [ B ] [A ] –1 [A][X]=[A ] –1 [B] Multiply both sides by [ A ] –1 [A ] –1 , on the left. (Remember order matters! If we multiplied by [ A ] –1 [A ] –1 on the right, that would be doing something different.)
[ I ] [ X ] = [ A ] –1 [ B ] [I][X]=[A ] –1 [B] [ A ] –1 [ A ] = [ I ][A ] –1 [A]=[I] by the definition of an inverse matrix.
[ X ] = [ A ] –1 [ B ] [X]=[A ] –1 [B] [ I ] [I] times anything is itself, by definition of the identity matrix.

So we’re done! [ X ] [X], which contains exactly the variables we are looking for, has been shown to be [ A ] –1 [ B ] [A ] –1 [B]. This is why we can punch that formula into our calculator and find the answers instantly.

Let’s try one more example

5 x 3 y 2 z = 4 5x3y2z=4
(8)
x + y 7 z = 7 x+y7z=7
(9)
10 x 6 y 4 z = 10 10x6y4z=10
(10)

We don’t have to derive the formula again—we can just use it. Enter the following into your calculator:

[ A ] = [A]= 53211710645321171064 size 12{ left [ matrix { 5 {} # - 3 {} # - 2 {} ## 1 {} # 1 {} # - 7 {} ## "10" {} # - 6 {} # - 4{} } right ]} {} [ B ] = [B]= 47104710 size 12{ left [ matrix { 4 {} ## 7 {} ## "10" } right ]} {}

Then ask the calculator for [ A ] –1 [ B ] [A ] –1 [B].

Figure 2
A screen shot of a graphic calculator.

The result?

Figure 3
A screen shot of a graphic calculator.

What happened? To understand this error, try the following:

Hit ENTER to get out of the error, and then hit <MATRX>1 <MATRX> 1 ) ENTER

Figure 4
A screen shot of a graphic calculator.

Aha! Matrix [ A ] [A] has a determinant of 0. A matrix with 0 determinant has no inverse. So the operation you asked the calculator for, [ A ] –1 [ B ] [A ] –1 [B], is impossible.

What does this tell us about our original equations? They have no solution. To see why this is so, double the first equation and compare it with the third—it should become apparent that both equations cannot be true at the same time.

Content actions

Download module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks