IT1903
System of Linear Equations (Direct Methods)
A system of linear equations is two or more linear equations that are being solved simultaneously.
• A consistent system is a system that has at least one solution.
• An inconsistent system is a system that has no solution.
Solving Systems of Linear Equations in Two Variables
• In general, a solution of a system in two variables is an ordered pair that makes both equations true. In other
words, it is where the two graphs intersect, what they have in common. Hence, if an ordered pair is a solution to
one equation, but not the other, it is NOT a solution to the system.
• The equations of a system are dependent if all the solutions of one equation are also solutions of the other
equation. In other words, they end up being the same line. The equations of a system are independent if they
do not share all solutions. They can have one point in common, just not all of them.
Solving Systems of Linear Equations in Three Variables
• In general, a solution of a system in three variables is an ordered triple (x, y, z) that makes all three equations
true. It is what they all three have in common. Hence, if an ordered triple is a solution to one equation, but not
another, then it is NOT a solution to the system. If a linear equation is to be graphed in three variables, it would
end up with a figure of a plane in a three-dimensional coordinate system.
• The equations of a system are dependent if all the solutions of one equation are also solutions of the other two
equations. In other words, they end up being the same line. The equations of a system are independent if they
do not share all solutions. They can have one point in common, just not all of them.
There are three possible outcomes in solving a system of linear equations:
1. One solution: If the system in two variables has one solution, it is an ordered pair that is a solution to both
equations. The system is consistent, and the equations are independent.
2. No solution: If the two lines are parallel to each other, they will never intersect. This means they do not have
any points in common. The system is inconsistent, and the equations are independent.
3. Infinite solutions: If the two lines end up lying on top of each other, then there is an infinite number of solutions.
In this situation, they would end up being the same line. Thus, any solution that would work in one equation is
going to work in the other. The system is consistent, and the equations are dependent.
Elimination Method
One way of solving a linear system is to use the elimination method. The elimination method uses the addition property
of equality. The same value can be added to each side of an equation.
Steps in Solving Systems of Linear Equations in Two Variables
Step 1: Simplify and put both equations in the form Ax + By = C if needed.
• Remove ( ) by using the distributive property.
• Remove fractions by multiplying both sides by the LCD of all the fractions.
05 Handout 1 *Property of STI
[email protected] Page 1 of 8
IT1903
Step 2: Multiply one or both equations by a number that will create opposite coefficients for either x or y if needed.
• For example, if there is a 2x in one equation and a 3x in another equation, the first equation can be multiplied by
3 to get a 6x and the second equation can be multiplied by -2 to get a -6x. Hence, when these two are added
together, they will drop out.
Step 3: Add equations.
• The variable that has the opposite coefficients will drop out in this step and there will only be one equation with
one unknown.
Step 4: Solve for the remaining variable.
• Solve the equation found in Step 3 for the variable that is left.
• If both variables drop out and the result is a FALSE statement, there is no solution.
• If both variables drop out and the result is a TRUE statement, that means there are infinite solutions, which would
be the equation of the line.
Step 5: Solve for the second variable.
• If there is a value for the variable in step 4, that means the two equations have one solution.
• Assign the value found in step 4 into any of the equations in the problem and solve for the other variable.
05 Handout 1 *Property of STI
[email protected] Page 2 of 8
IT1903
Step 6: Check the proposed ordered pair solution in both original equations.
• The proposed solution can be assigned to both equations. If it makes both operations true, there is a solution to
the system. If it makes at least one of them false, there is a need to redo the problem.
The ordered pair (11, -25/3) is a solution to the system of two linear equations.
Steps in Solving Systems of Linear Equations in Three Variables
Step 1: Simplify and put all three equations in the form Ax + By + Cz = D if needed.
Step 2: Choose to eliminate any one of the variables from any pair of equations.
Step 3: Eliminate the same variable chosen in step 2 from any other pair of equations, creating a system of two equations
and 2 unknowns.
Step 4: Solve the remaining system found in steps 2 and 3.
05 Handout 1 *Property of STI
[email protected] Page 3 of 8
IT1903
Step 5: Solve for the third variable.
Step 6: Check the proposed ordered triple solution in all three original equations.
The ordered triple (2, 0, 1) is a solution to the system of three linear equations.
Solution algorithms for linear equations may be either direct or iterative. In direct methods, the solution is obtained in a
fixed number of steps subject only to rounding errors, while iterative methods are based on successive improvement
of initial guesses for the solution.
Direct Method 1: Gauss-Jordan Elimination
Gauss-Jordan Elimination is an algorithm that can be used to solve systems of linear equations and to find the inverse
of any invertible matrix. It relies upon three elementary row operations one can use on a matrix:
1. Swap the positions of two of the rows.
2. Multiply one of the rows by a nonzero scalar.
3. Add or subtract the scalar multiple of one row to another row.
05 Handout 1 *Property of STI
[email protected] Page 4 of 8
IT1903
Examples:
First elementary row operation: Swap the positions of the 1st and 3rd row.
Second elementary row operation: Multiply the second row by 3.
Third elementary row operation: Add twice the 1st row to the 2nd row.
In the Gauss-Jordan Elimination method, the given system of linear equations is converted into an equivalent diagonal
system with the aid of elementary row operations. First, convert the given augmented matrix in the upper triangular matrix
by applying elementary row operations as in Gauss elimination method.
Then, use the last equation to vanish the coefficients of xn from the remaining equations by applying the elementary row
operations. Similarly, the elementary row operations are used in reverse order to eliminate the coefficients of x n–1, xn–2
and x1 to get the equivalent diagonal matrix as follows:
Example:
05 Handout 1 *Property of STI
[email protected] Page 5 of 8
IT1903
The associated augmented matrix is as follows.
Eliminate x1 from the remaining equations by applying the elementary row operations R 2 → R2 – 3R1 and R3 → R3− R1
on the augmented matrix.
Apply R3 → R3 – 3R2 to eliminate x2 from 3rd equation. The result is an equivalent upper triangular system.
Apply
Apply R1 → R1 + R2
Therefore
Direct Method 2: LU Decomposition
The LU decomposition of a matrix is the factorization of a given square matrix into two triangular matrices, one upper
triangular matrix and one lower triangular matrix, such that the product of these two matrices gives the original matrix.
Method: [A] Decompose to [L] and [U]
[U] is the same as the coefficient matrix at the end of the forward elimination step.
[L] is obtained using the multipliers that were used in the forward elimination process.
05 Handout 1 *Property of STI
[email protected] Page 6 of 8
IT1903
The LU factorization that requires the diagonal elements of U to be one, is known as Crout’s method. If instead the
diagonal of L is required to be one, the factorization is called Doolittle’s method.
Example (using Crout's method)
Decompose the coefficient matrix A into the product of lower and upper triangular matrices with diagonal elements in
upper triangular matrix as unity.
After equating the terms on both sides, the set of equations will be:
The solution of this system produces the values of lij and uij as follows:
Write the coefficient matrix A in terms of the matrices L and U.
05 Handout 1 *Property of STI
[email protected] Page 7 of 8
IT1903
The system LY = B is given by
Re-write the system of equations.
Therefore
From the first equation
From the second equation
From the third equation
On using these values of y1, y2 and y3 in the system
UX = Y
The result is:
From the last equation x3 = –1, using this value in the second equation x2 = 1, and the first equation gives x1 = 1. So,
the solution is given by
x1 = 1, x2 =1, x3 = −1
References:
Kharab, A. & Guenther R. (2019). An introduction to numerical methods: A MATLAB approach (4th ed.). Boca Raton: CRC Press.
Gupta, R. (2019). Numerical methods: Fundamentals and applications. India: Cambridge University Press.
WTAMU. (n.d.). Intermediate algebra. Retrieved from https://www.wtamu.edu/academic/anns/mps/math/mathlab/int_algebra/index.htm
05 Handout 1 *Property of STI
[email protected] Page 8 of 8