Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 41

Gaussian Elimination

The purpose of this article is to describe how the solutions to a linear system are actually
found. The fundamental idea is to add multiples of one equation to the others in order to
eliminate a variable and to continue this process until only one variable is left. Once this final
variable is determined, its value is substituted back into the other equations in order to
evaluate the remaining unknowns. This method, characterized by step‐by‐step elimination of
the variables, is called Gaussian elimination.

Example 1: Solve this system:

Multiplying the first equation by −3 and adding the result to the second equation eliminates
the variable x:

This final equation, −5 y = −5, immediately implies y = 1. Back‐substitution of y = 1 into the


original first equation, x + y = 3, yields x = 2. (Back‐substitution of y = 1 into the original
second equation, 3 x − 2 y = 4, would also yeild x = 2.) The solution of this system is
therefore (x, y) = (2, 1), as noted in Example 1.

Gaussian elimination is usually carried out using matrices. This method reduces the effort in
finding the solutions by eliminating the need to explicitly write the variables at each step. The
previous example will be redone using matrices.

Example 2: Solve this system:

The first step is to write the coefficients of the unknowns in a matrix:

 
This is called the coefficient matrix of the system. Next, the coefficient matrix is augmented
by writing the constants that appear on the right‐hand sides of the equations as an additional
column: 

This is called the augmented matrix, and each row corresponds to an equation in the given
system. The first row, r 1 = (1, 1, 3), corresponds to the first equation, 1 x + 1 y = 3, and the
second row, r 2 = (3, −2, 4), corresponds to the second equation, 3 x − 2 y = 4. You may
choose to include a vertical line—as shown above—to separate the coefficients of the
unknowns from the extra column representing the constants.

Now, the counterpart of eliminating a variable from an equation in the system is changing
one of the entries in the coefficient matrix to zero. Likewise, the counterpart of adding a
multiple of one equation to another is adding a multiple of one row to another row. Adding
−3 times the first row of the augmented matrix to the second row yields

The new second row translates into −5 y = −5, which means y = 1. Back‐substitution into the
first row (that is, into the equation that represents the first row) yields x = 2 and, therefore, the
solution to the system: (x, y) = (2, 1).

Gaussian elimination can be summarized as follows. Given a linear system expressed in


matrix form, A x = b, first write down the corresponding augmented matrix:

Then, perform a sequence of elementary row operations, which are any of the following:

Type 1. Interchange any two rows.

Type 2. Multiply a row by a nonzero constant.

Type 3. Add a multiple of one row to another row.

The goal of these operations is to transform—or reduce—the original augmented matrix into
one of the form where A′ is upper triangular (aij ′ = 0 for i > j), any zero rows appear at
the bottom of the matrix, and the first nonzero entry in any row is to the right of the first
nonzero entry in any higher row; such a matrix is said to be in echelon form. The solutions of
the system represented by the simpler augmented matrix, [ A′ | b′], can be found by inspectoin
of the bottom rows and back‐substitution into the higher rows. Since elementary row
operations do not change the solutions of the system, the vectors x which satisfy the simpler
system A′ x = b′ are precisely those that satisfy the original system, A x = b.

Example 3: Solve the following system using Gaussian elimination:

The augmented matrix which represents this system is

The first goal is to produce zeros below the first entry in the first column, which translates
into eliminating the first variable, x, from the second and third equations. The row operations
which accomplish this are as follows:

The second goal is to produce a zero below the second entry in the second column, which
translates into eliminating the second variable, y, from the third equation. One way to
accomplish this would be to add −1/5 times the second row to the third row. However, to
avoid fractions, there is another option: first interchange rows two and three. Interchanging
two rows merely interchanges the equations, which clearly will not alter the solution of the
system:

Now, add −5 times the second row to the third row:


 

Since the coefficient matrix has been transformed into echelon form, the “forward” part of
Gaussian elimination is complete. What remains now is to use the third row to evaluate the
third unknown, then to back‐substitute into the second row to evaluate the second unknown,
and, finally, to back‐substitute into the first row to evaluate the first unknwon.

The third row of the final matrix translates into 10 z = 10, which gives z = 1. Back‐
substitution of this value into the second row, which represents the equation y − 3 z = −1,
yields y = 2. Back‐substitution of both these values into the first row, which represents the
equation x − 2 y + z = 0, gives x = 3. The solution of this system is therefore (x, y, z) = (3, 2,
1).

Example 4: Solve the following system using Gaussian elimination:

For this system, the augmented matrix (vertical line omitted) is

First, multiply row 1 by 1/2:

Now, adding −1 times the first row to the second row yields zeros below the first entry in the
first column:

 
Interchanging the second and third rows then gives the desired upper‐triangular coefficient
matrix: 

The third row now says z = 4. Back‐substituting this value into the second row gives y = 1,
and back‐substitution of both these values into the first row yields x = −2. The solution of this
system is therefore (x, y, z) = (−2, 1, 4).

Gauss‐Jordan elimination. Gaussian elimination proceeds by performing elementary row


operations to produce zeros below the diagonal of the coefficient matrix to reduce it to
echelon form. (Recall that a matrix A′ = [aij ′] is in echelon form when aij ′= 0 for i > j, any
zero rows appear at the bottom of the matrix, and the first nonzero entry in any row is to the
right of the first nonzero entry in any higher row.) Once this is done, inspection of the bottom
row(s) and back‐substitution into the upper rows determine the values of the unknowns.

However, it is possible to reduce (or eliminate entirely) the computations involved in back‐
substitution by performing additional row operations to transform the matrix from echelon
form to reduced echelon form. A matrix is in reduced echelon form when, in addition to
being in echelon form, each column that contians a nonzero entry (usually made to be 1) has
zeros not just below that entry but also above that entry. Loosely speaking, Gaussian
elimination works from the top down, to produce a matrix in echelon form, whereas Gauss‐
Jordan elimination continues where Gaussian left off by then working from the bottom up
to produce a matrix in reduced echelon form. The technique will be illustrated in the
following example.

Example 5: The height, y, of an object thrown into the air is known to be given by a
quadratic function of t (time) of the form y = at2 + bt + c. If the object is at height y = 23/4 at
time t = 1/2, at y = 7 at time t = 1, and at y = 2 at t = 2, determine the coefficients a, b, and c.

Since t = 1/2 gives y = 23/4

   

while the other two conditions, y(t = 1) = 7 and y(t = 2) = 2, give the following equations for
a, b, and c:
Therefore, the goal is solve the system

The augmented matrix for this system is reduced as follows: 

At this point, the forward part of Gaussian elimination is finished, since the coefficient matrix
has been reduced to echelon form. However, to illustrate Gauss‐Jordan elimination, the
following additional elementary row operations are performed:

This final matrix immediately gives the solution: a = −5, b = 10, and c = 2.

Example 6: Solve the following system using Gaussian elimination:

 
The augmented matrix for this system is

Multiples of the first row are added to the other rows to produce zeros below the first entry in
the first column:

Next, −1 times the second row is added to the third row:

The third row now says 0 x + 0 y + 0 z = 1, an equation that cannot be satisfied by any values
of x, y, and z. The process stops: this system has no solutions.

The previous example shows how Gaussian elimination reveals an inconsistent system. A
slight alteration of that system (for example, changing the constant term “7” in the third
equation to a “6”) will illustrate a system with infinitely many solutions.

Example 7: Solve the following system using Gaussian elimination:

The same operations applied to the augment matrix of the system in Example 6 are applied to
the augmented matrix for the present system:
 

Here, the third row translates into 0 x + 0 y + 0 z = 0, an equation which is satisfied by any x,
y, and z. Since this offer no constraint on the unknowns, there are not three conditions on the
unknowns, only two (represented by the two nonzero rows in the final augmented matrix).
Since there are 3 unknowns but only 2 constrants, 3 − 2 =1 of the unknowns, z say, is
arbitrary; this is called a free variable. Let z = t, where t is any real number. Back‐
substitution of z = t into the second row (− y + 5 z = −6) gives 

Back substituting z = t and y = 6 + 5 t into the first row ( x + y − 3 z = 4) determines x: 

Therefore, every solution of the system has the form

   

where t is any real number. There are infinitely many solutions, since every real value of t
gives a different particular solution. For example, choosing t = 1 gives ( x, y, z) = (−4, 11, 1),
while t = 3 gives ( x, y, z) = (4, −9, −3), and so on. Geometrically, this system represents three
planes in R 3 that intersect in a line, and (*) is a parametric equation for this line.

Example 7 provided an illustration of a system with infinitely many solutions, how this case
arises, and how the solution is written. Every linear system that possesses infinitely many
solutions must contain at least one arbitrary parameter (free variable). Once the augmented
matrix has been reduced to echelon form, the number of free variables is equal to the total
number of unknowns minus the number of nonzero rows:

 
This agrees with Theorem B above, which states that a linear system with fewer equations
than unknowns, if consistent, has infinitely many solutions. The condition “fewer equations
than unknowns” means that the number of rows in the coefficient matrix is less than the
number of unknowns. Therefore, the boxed equation above implies that there must be at least
one free variable. Since such a variable can, by definition, take on infinitely many values, the
system will have infinitely many solutions.

Example 8: Find all solutions to the system

First, note that there are four unknwons, but only thre equations. Therefore, if the system is
consistent, it is guaranteed to have infinitely many solutions, a condition characterized by at
least one parameter in the general solution. After the corresponding augmented matrix is
constructed, Gaussian elimination yields 

The fact that only two nonzero rows remain in the echelon form of the augmented matrix
means that 4 − 2 = 2 of the variables are free:

Therefore, selecting y and z as the free variables, let y = t 1 and z = t 2. The second row of the
reduced augmented matrix implies

   

and the first row then gives


Thus, the solutions of the system have the form

   

where t 1 t 2 are allowed to take on any real values.

Example 9: Let b = ( b 1, b 2, b 3) T and let A be the matrix

For what values of b 1, b 2, and b 3 will the system A x = b be consistent?

The augmented matrix for the system A x = b reads

   

which Gaussian eliminatin reduces as follows: 

The bottom row now implies that b 1 + 3 b 2 + b 3 must be zero if this system is to be
consistent. Therefore, the given system has solutins (infinitely many, in fact) only for those
column vectors b = ( b 1, b 2, b 3) T for which b 1 + 3 b 2 + b 3 = 0.

Example 10: Solve the following system (compare to Example 12):


 

A system such as this one, where the constant term on the right‐hand side of every equation is
0, is called a homogeneous system. In matrix form it reads A x = 0. Since every
homogeneous system is consistent—because x = 0 is always a solution—a homogeneous
system has eithe exactly one solution (the trivial solution, x = 0) or infiitely many. The row‐
reduction of the coefficient matrix for this system has already been performed in Example 12.
It is not necessary to explicitly augment the coefficient matrix with the column b = 0, since
no elementary row operation can affect these zeros. That is, if A′ is an echelon form of A,
then elementary row operations will transform [ A| 0] into [ A′| 0]. From the results of
Example 12,

Since the last row again implies that z can be taken as a free variable, let z = t, where t is any
real number. Back‐substitution of z = t into the second row (− y + 5 z = 0) gives 

and back‐substitution of z = t and y = 5 t into the first row ( x + y − 3 z = 0) determines x: 

Therefore, every solution of this system has the form ( x, y, z) = (−2 t, 5 t, t), where t is any
real number. There are infinitely many solutins, since every real value of t gives a unique
particular solution.

Note carefully the differnece between the set of solutions to the system in Example 12 and
the one here. Although both had the same coefficient matrix A, the system in Example 12 was
nonhomogeneous ( A x = b, where b ≠ 0), while the one here is the corresponding
homogeneous system, A x = 0. Placing their solutions side by side,

general solution to Ax = 0: ( x, y, z) = (−2 t, 5 t, t)

general solution to Ax = b: ( x, y, z) = (−2 t, 5 t, t) + (−2, 6, 0)

illustrates an important fact:


Theorem C. The general solutions to a consistent nonhomogeneous lienar system, A x = b, is
equal to the general solution of the corresponding homogeneous system, A x = 0, plus a
particular solution of the nonhomogeneous system. That is, if x = x h represents the general
solution of A x = 0, then x = x h + x represents the general solution of A x + b, where x is any
particular soltion of the (consistent) nonhomogeneous system A x = b.

[Technical note: Theorem C, which concerns a linear system, has a counterpart in the theory
of linear diffrential equations. Let L be a linear differential operator; then the general solution
of a solvable nonhomogeneous linear differential equation, L(y) = d (where d ≢ 0), is equal to
the general solution of the corresponding homogeneous equation, L(y) = 0, plus a particular
solution of the nonhomogeneous equation. That is, if y = y h repreents the general solution of
L(y) = 0, then y = y h + y represents the general solution of L(y) = d, where y is any particular
solution of the (solvable) nonhomogeneous linear equation L(y) = d.]

Example 11: Determine all solutions of the system

Write down the augmented matrix and perform the following sequence of operations: 

Since only 2 nonzero rows remain in this final (echelon) matrix, there are only 2 constraints,
and, consequently, 4 − 2 = 2 of the unknowns— y and z say—are free variables. Let y = t 1
and z = t 2. Back‐substitution of y = t 1 and z = t 2 into the second row ( x − 3 y + 4 z = 1) gives

 
Finally, back‐substituting x = 1 + 3 t 1 − 4 2, y = t 1,and z = t 2 into the first row (2 w − 2 x + y
= −1) determines w:

Therefore, every solution of this system has the form

   

where t 1 and t 2 are any real numbers. Another way to write the solution is as follows: 

where t1, t2 ∈ R.

Example 12: Determine the general solution of

   

which is the homogeneous system corresponding to the nonhomoeneous one in Example 11


above.

Since the solution to the nonhomogeneous system in Example 11 is 

Theorem C implies that the solution of the corresponding homogeneous system is


(where t1, t2 ∈ R), which is obtained from (*) by simply
discarding the particular soluttion, x = (1/2,1,0,0), of the nonhomogeneous system.

Example 13: Prove Theorem A: Regardless of its size or the number of unknowns its
equations contain, a linear system will have either no solutions, exactly one solution, or
infinitely many solutions.

Proof. Let the given linear system be written in matrix form A x = b. The theorem really
comes down to tthis: if A x = b has more than one solution, then it actually has infinitely
many. To establish this, let x1 and x2 be two distinct solutions of A x = b. It will now be
shown that for any real value of t, the vector x1 + t(x1 − x 2) is also a solution of A x = b;
because t can take on infinitely many different values, the desired conclusion will follow.
Since A x1 = b and A x2,

Therefore, x1 + t(x1 − x2) is indeed a solution of A x = b, and the theorem is proved.


 Solve the following system of equations using Gaussian elimination.

–3x + 2y – 6z = 6
  5x + 7y – 5z = 6
     x + 4y – 2z = 8

No equation is solved for a variable, so I'll have to do the multiplication-and-addition thing to


simplify this system. In order to keep track of my work, I'll write down each step as I go. But
I'll do my computations on scratch paper. Here is how I did it:

The first thing to do is to get rid of the leading x-terms in two of the rows. For now, I'll just
look at which rows will be easy to clear out; I can switch rows later to get the system into
"upper triangular" form. There is no rule that says I have to use the x-term from the first row,
and, in this case, I think it will be simpler to use the x-term from the third row, since its
coefficient is simply "1". So I'll multiply the third row by 3, and add it to the first row. I do
the computations on scratch paper:

...and then I write down the results:

(When we were solving two-variable systems, we could multiply a row, rewriting the system
off to the side, and then add down. There is no space for this in a three-variable system,
which is why we need the scratch paper.)

Warning: Since I didn't actually do anything to the third row, I copied it down, unchanged,
into the new matrix of equations. I used the third row, but I didn't actually change it. Don't
confuse "using" with "changing".

To get smaller numbers for coefficients, I'll multiply the first row by one-half:

Now I'll multiply the third row by –5 and add this to the second row. I do my work on scratch
paper:
...and then I write down the results: Copyright © Elizabeth Stapel 2003-2011 All Rights
Reserved

I didn't do anything with the first row, so I copied it down unchanged. I worked with the third
row, but I only worked on the second row, so the second row is updated and the third row is
copied over unchanged.

Okay, now the x-column is cleared out except for the leading term in the third row. So next I
have to work on the y-column.

Warning: Since the third equation has an x-term, I cannot use it on either of the other two
equations any more (or I'll undo my progress). I can work on the equation, but not with it.

If I add twice the first row to the second row, this will give me a leading 1 in the second row.
I won't have gotten rid of the leading y-term in the second row, but I will have converted it
(without getting involved in fractions) to a form that is simpler to deal with. (You should
keep an eye out for this sort of simplification.) First I do the scratch work:

...and then I write down the results:

Now I can use the second row to clear out the y-term in the first row. I'll multiply the second
row by –7 and add. First I do the scratch work:

...and then I write down the results:


I can tell what z is now, but, just to be thorough, I'll divide the first row by 43. Then I'll
rearrange the rows to put them in upper-triangular form:

Now I can start the process of back-solving:

y – 7(1) = –4
y – 7 = –4
y=3

x + 4(3) – 2(1) = 8
x + 12 – 2 = 8
x + 10 = 8
x = –2

Then the solution is (x, y, z) = (–2, 3, 1).

Note: There is nothing sacred about the steps I used in solving the above system; there was
nothing special about how I solved this system. You could work in a different order or
simplify different rows, and still come up with the correct answer. These systems are
sufficiently complicated that there is unlikely to be one right way of computing the answer.
So don't stress over "how did she know to do that next?", because there is no rule. I just did
whatever struck my fancy; I did whatever seemed simplest or whatever came to mind first.
Don't worry if you would have used completely different steps. As long as each step along
the way is correct, you'll come up with the same answer.

In the above example, I could have gone further in my computations and been more
thorough-going in my row operations, clearing out all the y-terms other than that in the
second row and all the z-terms other than that in the first row. This is what the process would
then have looked like:
This way, I can just read off the values of x, y, and z, and I don't have to bother with the back-
substitution. This more-complete method of solving is called "Gauss-Jordan elimination"
(with the equations ending up in what is called "reduced-row-echelon form"). Many texts
only go as far as Gaussian elimination, but I've always found it easier to continue on and do
Gauss-Jordan.

Note that I did two row operations at once in that last step before switching the rows. As long
as I'm not working with and working on the same row in the same step, this is okay. In this
case, I was working with the first row and working on the second and third rows.
Augmented Matrices

In this section we need to take a look at the third method for solving systems of equations. 
For systems of two equations it is probably a little more complicated than the methods we
looked at in the first section.  However, for systems with more equations it is probably easier
than using the method we saw in the previous section.

Before we get into the method we first need to get some definitions out of the way.

An augmented matrix for a system of equations is a matrix of numbers in which each row
represents the constants from one equation (both the coefficients and the constant on the other
side of the equal sign) and each column represents all the coefficients for a single variable.

Let’s take a look at an example.  Here is the system of equations that we looked at in the
previous section.

Here is the augmented matrix for this system.

The first row consists of all the constants from the first equation with the coefficient of the x
in the first column, the coefficient of the y in the second column, the coefficient of the z in the
third column and the constant in the final column.  The second row is the constants from the
second equation with the same placement and likewise for the third row.  The dashed line
represents where the equal sign was in the original system of equations and is not always
included.  This is mostly dependent on the instructor and/or textbook being used.
 

Next we need to discuss elementary row operations.  There are three of them and we will
give both the notation used for each one as well as an example using the augmented matrix
given above.

1. Interchange Two Rows. With this operation we will interchange all the entries in
row i and row j.  The notation we’ll use here is .   Here is
an example.

So, we do exactly what the operation says.  Every entry in the third row moves up to the first
row and every entry in the first row moves down to the third row.  Make sure that you move
all the entries.  One of the more common mistakes is to forget to move one or more entries.

2. Multiply a Row by a Constant.  In this operation we will multiply row i by a


constant c and the notation will use here is .  Note that we can also divide a

row by a constant using the notation .  Here is an example.

 
So, when we say we will multiply a row by a constant this really means that we will multiply
every entry in that row by the constant.  Watch out for signs in this operation and make sure
that you multiply every entry.

3. Add a Multiple of a Row to Another Row.  In this operation we will replace row i
with the sum of row i and a constant, c, times row j.  The notation we’ll use for this
operation is .  To perform this
operation we will take an entry from row i and add to it c times the corresponding
entry from row j and put the result back into row i.  Here is an example of this
operation.

            Let’s go through the individual computation to make sure you followed this.

Be very careful with signs here.  We will be doing these computations in our head for the
most part and it is very easy to get signs mixed up and add one in that doesn’t belong or lose
one that should be there.

It is very important that you can do this operation as this operation is the one that we will be
using more than the other two combined.

 
Okay, so how do we use augmented matrices and row operations to solve systems?  Let’s
start with a system of two equations and two unknowns.

We first write down the augmented matrix for this system,

and use elementary row operations to convert it into the following augmented matrix.

Once we have the augmented matrix in this form we are done.  The solution to the system
will be  and .

This method is called Gauss-Jordan Elimination.

Example 1  Solve each of the following systems of equations.

(a)    [Solution]

(b)    [Solution]

(c)    [Solution]
Solution

(a)

The first step here is to write down the augmented matrix for this system.

                                                             

To convert it into the final form we will start in the upper left corner and the work in a
counter-clockwise direction until the first two columns appear as they should be. 

So, the first step is to make the red three in the augmented matrix above into a 1.  We can
use any of the row operations that we’d like to.  We should always try to minimize the
work as much as possible however.

So, since there is a one in the first column already it just isn’t in the correct row let’s use
the first row operation and interchange the two rows.

                                           

The next step is to get a zero below the 1 that we just got in the upper left hand corner. 
This means that we need to change the red three into a zero.  This will almost always
require us to use third row operation.  If we add -3 times row 1 onto row 2 we can convert
that 3 into a 0.  Here is that operation.

                                      
 

Next we need to get a 1 into the lower right corner of the first two columns.  This means
changing the red -11 into a 1.  This is usually accomplished with the second row operation. 
If we divide the second row by -11 we will get the 1 in that spot that we need.

                                             

Okay, we’re almost done.  The final step is to turn the red three into a zero.  Again, this
almost always requires the third row operation.  Here is the operation for this final step.

                                         

We have the augmented matrix in the required form and so we’re done.  The solution to
this system is  and .

[Return to Problems]

(b)

In this part we won’t put in as much explanation for each step.  We will mark the next
number that we need to change in red as we did in the previous part.

We’ll first write down the augmented matrix and then get started with the row operations.

                 
 

Before proceeding with the next step let’s notice that in the second matrix we had one’s in
both spots that we needed them.  However, the only way to change the -2 into a zero that
we had to have as well was to also change the 1 in the lower right corner as well.   This is
okay.  Sometimes it will happen and trying to keep both ones will only cause problems.

Let’s finish the problem.

                        

The solution to this system is then  and .

[Return to Problems]

(c)

Let’s first write down the augmented matrix for this system.
                                                           

Now, in this case there isn’t a 1 in the first column and so we can’t just interchange two
rows as the first step.  However, notice that since all the entries in the first row have 3 as a
factor we can divide the first row by 3 which will get a 1 in that spot and we won’t put any
fractions into the problem.

Here is the work for this system.

                     

                    

The solution to this system is  and .

[Return to Problems]

It is important to note that the path we took to get the augmented matrices in this example
into the final form is not the only path that we could have used.   There are many different
paths that we could have gone down.  All the paths would have arrived at the same final
augmented matrix however so we should always choose the path that we feel is the easiest
path.  Note as well that different people may well feel that different paths are easier and so
may well solve the systems differently.  They will get the same solution however.

For two equations and two unknowns this process is probably a little more complicated than
just the straight forward solution process we used in the first section of this chapter.  This
process does start becoming useful when we start looking at larger systems.  So, let’s take a
look at a couple of systems with three equations in them.

In this case the process is basically identical except that there’s going to be more to do.  As
with two equations we will first set up the augmented matrix and then use row operations to
put it into the form,

Once the augmented matrix is in this form the solution is ,


 and .  As with the two equations case there really isn’t any set path to
take in getting the augmented matrix into this form.  The usual path is to get the 1’s in the
correct places and 0’s below them.  Once this is done we then try to get zeroes above the 1’s.

Let’s work a couple of examples to see how this works.

Example 2  Solve each of the following systems of equations.

(a)    [Solution]

 
(b)    [Solution]

Solution

(a)

Let’s first write down the augmented matrix for this system.

                                                          

As with the previous examples we will mark the number(s) that we want to change in a
given step in red.  The first step here is to get a 1 in the upper left hand corner and again,
we have many ways to do this.  In this case we’ll notice that if we interchange the first and
second row we can get a 1 in that spot with relatively little work.

                                     

The next step is to get the two numbers below this 1 to be 0’s.  Note as well that this will
almost always require the third row operation to do.  Also, we can do both of these in one
step as follows.
                               

Next we want to turn the 7 into a 1.  We can do this by dividing the second row by 7.

                                     

So, we got a fraction showing up here.  That will happen on occasion so don’t get all that
excited about it.  The next step is to change the 3 below this new 1 into a 0.  Note that we
aren’t going to bother with the -2 above it quite yet.  Sometimes it is just as easy to turn
this into a 0 in the same step.  In this case however, it’s probably just as easy to do it later
as we’ll see.

So, using the third row operation we get,

                            
 

Next, we need to get the number in the bottom right corner into a 1.  We can do that with
the second row operation.

                                  
 

Now, we need zeroes above this new 1.  So, using the third row operation twice as follows
will do what we need done.

                              

Notice that in this case the final column didn’t change in this step.  That was only because
the final entry in that column was zero.  In general, this won’t happen.

The final step is then to make the -2 above the 1 in the second column into a zero.  This can
easily be done with the third row operation.

                                  

 
So, we have the augmented matrix in the final form and the solution will be,

                                                        

This can be verified by plugging these into all three equations and making sure that they
are all satisfied.

[Return to Problems]

(b)

Again, the first step is to write down the augmented matrix.

                                                        

We can’t get a 1 in the upper left corner simply by interchanging rows this time.  We could
interchange the first and last row, but that would also require another operation to turn the
-1 into a 1.  While this isn’t difficult it’s two operations.  Note that we could use the third
row operation to get a 1 in that spot as follows.

                            
 

Now, we can use the third row operation to turn the two red numbers into zeroes.

                           

The next step is to get a 1 in the spot occupied by the red 4.  We could do that by dividing
the whole row by 4, but that would put in a couple of somewhat unpleasant fractions.  So,
instead of doing that we are going to interchange the second and third row.  The reason for
this will be apparent soon enough.

                                

 
Now, if we divide the second row by -2 we get the 1 in that spot that we want.

                                   

Before moving onto the next step let’s think notice a couple of things here.  First, we
managed to avoid fractions, which is always a good thing, and second this row is now
done.  We would have eventually needed a zero in that third spot and we’ve got it there for
free.  Not only that, but it won’t change in any of the later operations.  This doesn’t always
happen, but if it does that will make our life easier.

Now, let’s use the third row operation to change the red 4 into a zero.

                            

We now can divide the third row by 7 to get that the number in the lower right corner into a
one.

                                    
 

Next, we can use the third row operation to get the -3 changed into a zero.

                               

The final step is to then make the -1 into a 0 using the third row operation again.

                                   

 
Gaussian Elimination

Introduction

We will now explore a more versatile way than the method of determinants to determine if a
system of equations has a solution. We will indeed be able to use the results of this method to
find the actual solution(s) of the system (if any). It should be noted that this method can be
applied to systems of equations with an unequal number of equations and unknowns.
However, we will only discuss systems with an equal number of equations and unknowns.

It is easiest to illustrate this method with an example. Consider the system of equations

To solve for x, y, and z we must eliminate some of the unknowns from some of the equations.
Consider adding -2 times the first equation to the second equation and also adding 6 times the
first equation to the third equation. The result is

We have now eliminated the x term from the last two equations. Now simplify the last two
equations by dividing by 2 and 3, respectively:
To eliminate the y term in the last equation, multiply the second equation by -5 and add it to
the third equation:

The third equation says z=-2. Substituting this into the second equation yields y=-1. Using
both of these results in the first equation gives x=3. The process of progressively solving for
the unknowns is called back-substitution.

This is the essence of Gaussian elimination. However, we may clean up the notation in our
work by using matrices.

Gaussian Elimination

Convert the system of equations above into an augmented matrix:

This matrix contains all of the information in the system of equations without the x, y, and z
labels to carry around. Now carry out the process outlined above. The notation to the right of
each matrix describes the row operations that were performed to get the matrix on that line.
For example 2R_1+R_2 -> R_2 means "replace row 2 with the sum of 2 times row 1 and row
2".

If we now reverse the conversion process and turn the augmented matrix into a system of
equations we have
We can now easily solve for x, y, and z by back-substitution.

Remember: For a system of equations with a 3x3 matrix of coefficients, the goal of the
process of Gaussian Elimination is to create (at least) a triangle of zeros in the lower left hand
corner of the matrix below the diagonal. Note that you may switch the order of the rows at
any time in trying to get to this form.

Gaussian Elimination and Row Operations

The Idea

This is really the meat of this lesson, here we learn a technique for solving large linear
systems. Gaussian elimination is a step-by-step procedure that starts with a system of linear
equations, or an augmented matrix, and transforms it into another system which is easier to
solve. Usually, we end up being able to easily determine the value of one of our variables,
and, using that variable we can apply back-substitution to solve the rest of the system.

When the equations are represented by an augmented matrix, the process of Gaussian
elimination puts the matrix into echelon form. As we have seen, once we have a matrix in
echelon form we can determine the solutions to the matrix equation it represents.

An Aside: Gauss-Jordan Elimination

Gauss-Jordan elimination is exactly like Gaussian elimination except that the goal is to put a
matrix into reduced row echelon form rather than simple row echelon form. It requires more
work, but will make seeing the solutions rather simple. Now for the technique.

Row operations

Gaussian and Gauss-Jordan elimination work by applying row operations to matrices. A row
operation is a way to simplify the presentation of a matrix while keeping its solution the
same. The following row operations are allowed:

1. You may swap the positions of any two rows


2. You may multiply any row by a non-zero scalar value
3. You may add a scalar multiple of any one row to another row
Example: Swapping Rows

Example: Multiply by a non-zero scalar value

Example: Add a multiple of one row to another


Now lets apply these rules in an example.

Gaussian Elimination Example

Lets start with a simple linear system

x + 2y = 4

2x + y = 1

We can form an augmented matrix and perform row operations until we have a matrix in row
echelon form. Because this is such a small system, this only requires one step:

We see that the entries below the diagonal are all zero (there is only one in this example), so
that the matrix is in row echelon form. From here, we can look at the final row to see that -3y
= -6, which gives y = 2. Now we can substitute this into our first equation to find the x value:

x + 2y = 4

x + 2(2) = 4

x+4=4

x=0
So a solution to the system is given by x=0, y=2.

Gauss-Jordan Elimination Example

You might also like