Gaussian Elimination
Engr. Cristy M. Malasan, MSCE
This 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
2/21/2022 Gaussian Elimination 2
Example 1: Solve this system:
x+y=3
3x - 2y = 4
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 yield x = 2
The solution of this system is therefore,
(x, y) = (2, 1)
3
Example 1: Solve this system:
x+y=3
3x - 2y = 4
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:
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).
4
Example 3: Solve the following system using Gaussian elimination:
x - 2y + z = 0
2x + y - 3z = 5
4x -7y + z = -1
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:
Therefore,
x=3
Now, add −5 times the second row to the third row: y=2
z=1
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 unknown.
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:
2x - 2y = -6
x-y+ z =1
3y - 2z = -5
The augmented matrix which represents this system 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:
Therefore,
The third row now says z = 4. x = -2
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. y=1
The solution of this system is therefore (x, y, z) = (−2, 1, 4)
z=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 contains 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.
Gauss‐Jordan Elimination
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 = ½ gives y=23/4
23/4 =a(1/2) 2 + b (1/2) + c
=¼a+½b+c
while the other two conditions, y(t = 1) = 7 and y(t = 2) = 2, give the following equations for a,
b, and c:
7=a+b+c
2 = 4a + 2b +c
Therefore, the goal is solve the system
¼ a + ½ b + c = 23/4
a+b + c =7
4a +2b + c = 2
The augmented matrix for this system is At this point, the forward part of Gaussian elimination is
reduced as follows: 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 Therefore,
the solution: a = −5, b = 10, a = -5
and c = 2. b = 10
c=2
Example 6: Solve the following system using Gaussian
elimination:
Next, −1 times the second row is
added to the third row:
The augmented matrix for this system is
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.
Multiples of the first row are added to the other rows to
produce zeros below the first entry in the first column:
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.
The way to get started is to quit
talking and begin doing.
Walt Disney Thank you… Engr. CMM
2/21/2022 Gaussian Elimination 13