0% found this document useful (0 votes)
47 views

W3 Lesson 3 - Systems of Linear Equation - Module

The document discusses solving systems of linear equations using Cramer's Rule, Gaussian elimination, and Gauss-Jordan elimination. It provides examples to illustrate the step-by-step procedures for Cramer's Rule and Gaussian elimination. Cramer's Rule uses determinants to find the value of one variable at a time, while Gaussian elimination transforms the system into row echelon form in an upper triangular matrix to solve for all variables simultaneously.

Uploaded by

Jitlee Papa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

W3 Lesson 3 - Systems of Linear Equation - Module

The document discusses solving systems of linear equations using Cramer's Rule, Gaussian elimination, and Gauss-Jordan elimination. It provides examples to illustrate the step-by-step procedures for Cramer's Rule and Gaussian elimination. Cramer's Rule uses determinants to find the value of one variable at a time, while Gaussian elimination transforms the system into row echelon form in an upper triangular matrix to solve for all variables simultaneously.

Uploaded by

Jitlee Papa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Numerical Methods

1
Systems of Linear Equation

Module 03 Systems of Linear Equation

Linear equation which is a first-order equation is used typically to describe


the relationship of x and y and is given as the slope. System of linear
equations however contains two or more linear equations using the same
variables but with different coefficients. The solutions for the systems of
linear equations are what Cramer’s Rule, Gaussian Elimination and Gauss-
Jordan are about.
At the end of this module, you will be able to:
1. Understand step by step procedure in performing concept of Cramer’s
rule
2. Understand the concept step by step procedure in performing Gaussian
elimination method
3. Understand the concept and the step by step procedure in performing
Gauss-Jordan elimination method
4. Apply Cramer’s rule to find the solutions of the systems of linear
equations
5. Apply Gaussian Elimination method to find the solutions of the systems of
linear equations
6. Apply Gauss-Jordan Elimination method to find the solutions of the
systems of linear equations

Cramer’s Rule
The knowledge in finding the determinants is essential in Cramer’s Rule. Recall for a
system of linear equations given below,
𝐸𝑞 1

𝑎11 𝑥 + 𝑎12 𝑦 + 𝑎13 𝑧 = 0


𝑎21 𝑥 + 𝑎22 𝑦 + 𝑎23 𝑧 = 0
𝑎31 𝑥 + 𝑎32 𝑦 + 𝑎33 𝑧 = 0

The determinant is given as:


𝑎22 𝑎23 𝑎21 𝑎23 𝑎21 𝑎22
D =𝑎11 |𝑎 | - 𝑎12 | | + 𝑎13 | 𝑎32 |
32 𝑎33 𝑎31 𝑎33 𝑎31

Course Module
Where the blue arrow and the red arrow signifies the sign of the product of the
elements that is, positive and negative respectively.

Cramer’s rule provides a solution to systems of linear equations using the coefficient
matrix and of matrices obtained from it by replacing one column by the vector of
right hand sides of the equations.

Cramer’s rule can only be applied for square matrices obtained from
coefficient matrix since it uses determinants. The determinant should also be
non-zero because the value would be indeterminate.

The procedure is illustrated with the example below.

Example
𝑥 + 2𝑦 +𝑧 =4
2𝑥 −𝑦 −𝑧 = 2
−𝑥 + 2𝑦 + 2𝑧 = 3

Procedure

1. Let D be the determinant of the coefficient matrix. In this example, the coefficient
matrix is given as

1 2 1
D = | 2 −1 −1|
−1 2 2

−1 −1 2 −1 2 −1
D =1 | | - 2| |+ 1| |
2 2 −1 2 −1 2
D = 1 (-2+2) - 2 (4-1)) +1(4-1)

and the determinant is D = -3

2. In Cramer’s Rule, there is no need to go over entire matrix to get the value of one
variable. The next step involved is to replace the column of the vector of the
variable, let’s say column 1 for x, with the column vector of the constant terms.
This will be used to find the determinant, Dx
The column vector of the constant terms is given as
4
column vector of the constant [2]
3
Numerical Methods
3
Systems of Linear Equation

4 2 1
Dx = |2 −1 −1|
3 2 2

Dx = 4 (-2+2) - 2 (4+3)) +1(4+3)


Dx = -7

3. The value of the variable x, is simply determined as:


𝐷𝑥 −7 7
x= = −3 = 3
𝐷

This is the ease of Cramer’s Rule. If you are only concerned with one variable, it
may be possible without using all the other variables at this final point.

In order to find the value of y and z, perform the second step but this time,
replacing Columns 2 and 3 with the column vector of the constant terms. That
will give us:
1 4 1
Dy = | 2 2 −1|
−1 3 2

Dy = 1 (4+3) - 4 (4-1)) +1(6+2)


3
Dy = 3 therefor y = −3 = -1

And

1 2 4
Dz= | 2 −1 2|
−1 2 3
Dz = 1 ((-3)-4) - 2 (6+2)) +4(4-1)
−11 11
Dz = -11 therefore z = =
−3 3

The solution for the systems of linear equation using Cramer’s Rule is
7 11
x = 3 , y = -1 and z = 3

Course Module
Cramer’s rule
1. Create a coefficient matrix for the systems of linear equation.
2. Use the coefficient matrix to solve for the determinant.
3. Create a column vector from the right hand side of the equation
4. Replace the column of the coefficient of the variable to be solved.
5. Perform the operation in finding the determinant for that particular
variable
6. Get the ratio of the determinant obtained by replacing the column of the
variable with the column of the constant terms and the determinant of
the coefficient matrix. (e.g. Dx/D)

Gaussian Elimination
Gaussian Elimination method is the standard method for solving the linear
system by using a calculator or a computer. It transforms a linear system into
an upper triangular form, which is easier to solve.

Unlike the Cramer’s rule, the Gaussian method can work even in non-square
matrices thus it making it more useful in finding the solution for systems of
linear equation.

Using the same given, the procedure for the Gaussian Elimination is
described by the example below:

𝑥 + 2𝑦 +𝑧 =4
2𝑥 −𝑦 −𝑧 = 2
−𝑥 + 2𝑦 + 2𝑧 = 3

Procedure
1. In the first step of the elimination procedure, find the pivot in the 1st column in
the 1st row.
2. The goal is to transform the linear system into an upper triangular form (also
known as the row echelon form)

𝒂𝟏𝟏 𝒙 + 𝒂𝟏𝟐 𝒚 + 𝒂𝟏𝟑 𝒛 = 𝒃𝟏


𝟎 + 𝒂𝟐𝟐 𝒚 + 𝒂𝟐𝟑 𝒛 = 𝒃𝟐
𝟎 +𝟎 + 𝒂𝟑𝟑 𝒛 = 𝒃𝟑

So the next step would be to eliminate the 2x in the second row.

To do that, an x term should be subtracted to it, to make it zero.


Numerical Methods
5
Systems of Linear Equation

So using the first row (R1) to eliminate the x term in second row (R2), R1 must be
multiplied to 2 first
2𝑥 + 4𝑦 + 2𝑧 = 8
2𝑥 −𝑦 −𝑧 = 2
−𝑥 + 2𝑦 + 2𝑧 = 3
then subtract to R2 and the rest to modify R2 and the rest, just restore it.
𝑥 + 2𝑦 +𝑧 =4
0 −5𝑦 −3𝑧 = −6
−𝑥 + 2𝑦 + 2𝑧 = 3
3. The x term at the third row should be eliminated. To do that, using the pivot,
multiply R1 by -1.
−𝑥 − 2𝑦 − 𝑧 = −4
0 +5𝑦 +3𝑧 = +6
−𝑥 + 2𝑦 + 2𝑧 = 3

then subtract to R3 and the rest to modify R3 and the rest, just restore it.

𝑥 + 2𝑦 +𝑧 = 4
0 −5𝑦 −3𝑧 = −6
0 + 4𝑦 +3𝑧 = +7

4. Make the pivot in the 2nd column by dividing the 2nd row by -5
𝑥 + 2𝑦 +𝑧 = 4
3
0 +𝑦 − 𝑧 = −6/5
5
0 + 4𝑦 +3𝑧 = 7

The value of the pivot should be non-zero. If the coefficient of the first
variable is zero, try rearranging the systems of linear equations first. If
possible, try to put the zero values to produce the upper triangular form
without violating the orders of the variables which should all be aligned all
throughout the computations.

5. To eliminate the y term in third row, multiply the second row by 4

Course Module
𝑥 + 2𝑦 +𝑧 = 4
12
0 + 4𝑦 − 𝑧 = −24/5
5
0 + 4𝑦 +3𝑧 = 7

then subtract to R3 and the rest to modify R3 and the rest, just restore it.

𝑥 + 2𝑦 +𝑧 = 4
12 −24
0 + 4𝑦 − 𝑧= 5
5
0 +0 −3𝑧 = −11

This completes the first phase also called as the forward elimination of Gaussian
elimination method. The second phase which is the back substitution involves,
getting the value of the variable from the bottom of the systems of linear
11
equation. This will give, z = 3 . Substituting it backwards to the second equation
7
will give y = -1 and x =3

The solution for the systems of linear equation using Gaussian elimination
method is
7 11
x = 3 , y = -1 and z = 3

For the Gaussian elimination method, there are two processes involved the
forward elimination and the back substitution. There is no particular order of
operations in using this method as long as the upper triangular form is
correctly obtained.

Gauss-Jordan Elimination

Gauss-Jordan elimination is a variation of the Gaussian elimination. The


difference is illustrated by the augmented matrix below:
1 0 0 = 𝑏1

0 1 0 = 𝑏2

0 0 1 = 𝑏3

Notice that it is a “finished” version of the Gaussian elimination method. In


This form, it only shows that since the coefficients are 1, then the right side of
the equation is the value of the variable in question.

Using the previous example, let’s use Gauss-Jordan to solve this:


Numerical Methods
7
Systems of Linear Equation

𝑥 + 2𝑦 +𝑧 =4
2𝑥 −𝑦 −𝑧 = 2
−𝑥 + 2𝑦 + 2𝑧 = 3

1. First set the systems of linear equations into an augmented matrix. An


augmented matrix is a matrix formed by putting the coefficients and the
column vector of the constant terms in a single matrix.

1 2 1 4

2 −1 −1 2

[−1 2 2 3]

2. Normalize the coefficients of the first row. The first element should be 1,
meaning the coefficient of the first linear equation should be non-zero.
Suppose the coefficient of the pivot is 3, then to normalize the first row
means, first row (R1) should be divided by 3. But in the example that we
have, the coefficient is already 1.

Like the Gaussian elimination method, there is no specific step by step


procedure to this; however, the row operations are carefully performed
to come up with the final augmented matrix in Gauss-Jordan form.

Remember that Gauss-Jordan is just a finished version of Gaussian


elimination. It is just that the operations started using an augmented
matrix.

3. Let’s try to do it using different row operations.

a. Multiply the row 1 (R1) by 2


2 4 2 8

2 −1 −1 2

[−1 2 2 3]
b. Subtract R1 from row 2 (R2) and restore it

1 2 1 4

0 −5 −3 −6

[−1 2 2 3]

Course Module
c. Multiply the R1 by -1
−1 −2 −1 −4

0 −5 −3 −6

[−1 2 2 3]

d. Subtract the R1 from the 3rd row (R3) and restore it

1 2 1 4

0 −5 −3 −6

[0 4 3 7]

e. Make the pivot in the 2nd column by dividing the R2 by -5

1 2 1 4
3 6
0 1
5 5
[0 4 3 7]

When trying to get the value of the bottom part of the systems of
linear equation Gaussian elimination method, notice the pivot was
moved to second row second column. The forward elimination should
be done such that, when subtracting rows, the previously eliminated
part should not be affected.

f. Multiply the R2 by 2

1 2 1 4
6 12
0 2
5 5
[0 4 3 7]

g. Subtract the R2 from R1 and restore it

−1 8
1 0
5 5

3 6
0 1
5 5

[0 4 3 7]

h. Multiply the R2 by 4
Numerical Methods
9
Systems of Linear Equation

−1 8
1 0
5 5

12 24
0 4
5 5

[0 4 3 7]

i. Subtract the R2 from the R3 and restore it

−1 8
1 0
5 5

3 6
0 1
5 5

3 11
[0 0
5 5]

j. Make the pivot in the R3 by multiplying it by 5/3

−1 8
1 0
5 5

3 6
0 1
5 5

11
[0 0 1
3]

k. Multiply the R3 by -1/5

−1 8
1 0
5 5

3 6
0 1
5 5

−1 −11
[0 0
5 15 ]

l. Subtract the R3 from the R1 and restore it

Course Module
7
1 0 0
3

3 6
0 1
5 5

11
[0 0 1
3]

m. Multiply the R3 by 3/5


7
1 0 0
3

3 6
0 1
5 5

3 11
[0 0
5 5]

n. Subtract R3 from the R2 and restore it

7
1 0 0
3

0 1 0 −1

11
[0 0 1
3]

If interpreted, since the coefficients of the systems of linear equations


represents the first three columns of the equations, at the third row, z is
equal to 11/3, it follows that at second row, y = -1 and x = 7/3.

The solution using Gauss-Jordan method for the system of linear equations
𝑥 + 2𝑦 +𝑧 =4
2𝑥 −𝑦 −𝑧 = 2
−𝑥 + 2𝑦 + 2𝑧 = 3
Is x = 7/3; y = -1 and z = 11/3.
Numerical Methods
11
Systems of Linear Equation

Similar to Gaussian elimination method, there are two processes


involved in Gauss-Jordan method, the forward elimination and the
back substitution. In Gauss-Jordan method, first is to set the systems
of linear equations into an augmented matrix form. Again, there is no
particular order or operations in using this method as long as the
identity matrix is correctly obtained.

But practically it is more convenient to eliminate all elements below


and above at once when using Gauss-Jordan elimination.

References and Supplementary Materials


Books and Journals

Chapra, Steven C.; Applied numerical methods with MATLAB for engineers and scientists.
Steven C. Chapra. McGraw-Hill; 3rd ed.
Chapra, Steven C.; Numerical methods for engineers . Steven C. Chapra, Raymond P.
Canale. McGraw-Hill; 6th ed
Cheney, E Ward (2013). Numerical Mathematics and Computing Cengage Learning; 7th
ed.

Online Supplementary Reading Materials


Stapel, Elizabeth. "Systems of Linear Equations. Solving By Gaussian Elimination."
Purplemath Available from http://www.purplemath.com/modules/systlin6.htm.
Date Accessed 18 August 2017
Weisstein, Eric W. "Gaussian Elimination." From MathWorld--A Wolfram Web Resource.
http://mathworld.wolfram.com/GaussianElimination.html. Date Accessed 18 August
2017

Online Instructional Videos


Solving Linear Equations Using Gauss Jordan Method / Matrices / Maths Algebra. We
Teach Academy Maths. Date last accessed: September 27, 2017
Elimination with Matrices | MIT 18.06SC Linear Algebra, Fall 2011.
https://www.youtube.com/watch?v=xCIXkm3-ocQ. Date last accessed: September 27,
2017

Course Module

You might also like