You are on page 1of 5

Connexions module: m18292

Matrix Concepts  Solving Linear Equations


Kenny M. Felder
This work is produced by The Connexions Project and licensed under the Creative Commons Attribution License

Abstract
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 equalityseem 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 ve? 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 + 2y z = 11 2x y + 3z = 7 7x 3y 2z = 2
Dene a 33 matrix [A] which is the coecients of all the variables on the left side of the equal signs:

(1)

(2)

(3)

2 1 3

[A] = 2 7
11

3 2

Dene a 31 matrix [B] which is the numbers on the

right side of the equal signs:

[B] = 7 2
Version
1.2: Mar 29, 2010 2:44 pm GMT-5

http://creativecommons.org/licenses/by/2.0/

http://cnx.org/content/m18292/1.2/

Connexions module: m18292

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

The calculator responds with a 31 matrix which is

all three answers.

In this case,

x = 3, y = 5,

and

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.

1 Huh? Why the heck did that work?


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

1.1 Step 1: In Which We Replace Three Linear Equations With One Matrix Equation
First of all, consider the following matrix equation:

x + 2y z

11

2x y + 3z = 7 7x 3y 2z 2
The matrix on the left may

x + 2y z

look like a 33 matrix, but it is actually a 31 matrix.

The top element is

(all one big number), and so on.

Remember what it means for two matrices to be equal to each other. dimensions ( ). And all

the elements have to be equal to each other.


x + 2y z = 11 2x y + 3z = 7 7x 3y 2z = 2

They have to have the same So for this matrix equation to

be true, all three of the following equations must be satised: (4)

(5)

(6)

Look familiar? Hey, this is the three equations we started with! The point is that this is equivalent to those

three linear equations.

one matrix equation

We can replace the original three equations with one matrix

equation, and then set out to solve that.

http://cnx.org/content/m18292/1.2/

Connexions module: m18292

1.2 Step 2: In Which We Replace a Simple Matrix Equation with a More Complicated One
Do the following matrix multiplication. calculator can't do it for you.) (You will need to do this by handsince it has variables, your

2 1 3

2 7

3 y z 2

If you did it correctly, you should have wound up with the following 31 matrix:

x + 2y z

(7)

2x y + 3z 7x 3y 2z
can now rewrite the

Once again, we pause to say. . .hey, that looks familiar! Yes, it's the matrix that we used in Step 1. So we

1 2 7

2 1 3

matrix equation 1 x 11 3 y = 7 2 z 2

from Step 1 in this way:

matrix equation is equivalent to the three linear equations that we started with.
as [X] then we can write our equation more concisely:

Stop for a moment and make sure you're following all this. I have shown, in two separate steps, that this

But this matrix equation has a nice property that the previous one did not. The rst matrix (which we called [A] a long time ago) and the third one ([B]) contain only numbers. If we refer to the middle matrix

[A] [X] = [B],


where

1 7

2 1 3

and

11

[A] = 2

3 , [X] = y , 2 z x, y ,
and

[B] = 7 2

Most importantly,

[X]

contains the three variables we want to solve for! If we can solve this equation for

[X]

we will have found our three variables

z.

1.3 Step 3: In Which We Solve a Matrix Equation


We have rewritten our original equations as matrix equation for which is

[A] [X] = [B],

and redened our original goal as solve this

[X].

If these were numbers, we would divide both sides by

[A].

But these are matrices,

and we have never dened a division operation for matrices. Fortunately, we can do something just as good,

multiplying both sides by [A]1 .


1 3 .)

(Just as, with numbers, you can replace dividing by 3 with

multiplying by

Solving a Matrix Equation


[A] [X] = [B]

The problem.
continued on next page

http://cnx.org/content/m18292/1.2/

Connexions module: m18292

[A]

[A] [X] = [A]

[B]

[I] [X] = [A] [X] = [A]

[B]

[B]

Multiply both sides by [A]1 , on the left. (Remember order matters! If we multiplied by [A]1 on the right, that would be doing something dierent.) 1 [A] [A] = [I] by the denition of an inverse matrix. [I] times anything is itself, by denition of the identity matrix.
Table 1

[A]

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

2 Let's try one more example

5x 3y 2z = 4 x + y 7z = 7 10x 6y 4z = 10 5 3 1 6 2 4

(8)

(9)

(10)

We don't have to derive the formula againwe can just use it. Enter the following into your calculator:

[A] = 1
10

7 [B] = 7 4 10 [A]
1

Then ask the calculator for

[B].

Figure 2

http://cnx.org/content/m18292/1.2/

Connexions module: m18292

The result?

Figure 3

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

ENTER

to get out of the error, and then hit

<MATRX> [U+25BA] 1 <MATRX> 1 ) ENTER

Figure 4

Aha! Matrix

[A]

has a determinant of 0.

operation you asked the calculator for,

[A]

A matrix with 0 determinant has no inverse.


[B],
is impossible.

So the

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

http://cnx.org/content/m18292/1.2/

You might also like