L2 - Simultaneous Equation Solution
L2 - Simultaneous Equation Solution
L2 - Simultaneous Equation Solution
M.L. KANSAL
NEEPCO Chair Professor & Professor,
Department of Water Resources Development and Management,
Indian Institute of Technology Roorkee, ROORKEE 247 667
b
1. a 0 then x = = a −1b . In this case the equation ax = b has a unique solution for x .
a
2. a = 0 , b = 0 then the equation ax = b becomes 0 = 0 and any value of x will do. In this
case the equation ax = b has infinitely many solutions.
3. a = 0 , b 0 then ax = b becomes 0 = b which is a contradiction. In this case the equation
ax = b has no solution for x .
MLK_SDT_L2_20-21_1/10
AX = b
where A is the coefficient matrix, X is the column vector of unknown quantities, and b is the
column vector of known quantities.
If A is square and non-singular (whose determinant is not zero) then,
X = A-1 b
Therefore, the values of X can be found by pre-multiplying the vector of known quantities by
the inverse of the coefficient matrix A.
Problem. 1. Find the inverse of matrix
1 2 3
0 1 5
5 6 0
Solution:
Step 1: Determinate of matrix A, i.e., |A|
Repeat the first two columns
MLK_SDT_L2_20-21_2/10
−30 25 −5
Cofactor of A = 18 −15 4
7 −5 1
−30 18 7
Adjoint of A = 25 −15 −5
−5 4 1
Step 4: Inverse matrix is obtained by dividing the elements of Adjoint matrix by the
determinant value.
1
A−1 = Adjoint of A
| A|
18 7
−6
−30 18 7 5 5
−1 1
A = 25 −15 −5 = 5 −3 −1
5
−5 4 1 4 1
−1
5 5
1. SOLUTION OF SIMULTANEOUS EQUATIONS
A. MATRIX METHOD
2x − 3 y − 4z = −3
x+ y+z =0
1 2 −1 x 7
2 −3 −4 y = −3
1 1 1 z 0
Solution:
Follow the above steps to find out inverse of a matrix
MLK_SDT_L2_20-21_3/10
1 3 11
− 16 16 16
So, A-1 =
3 1 1
− −
8 8 8
− 5 −
1 7
16 16 16
1 3 11 1 3 11
− 16 16
16 1 2 −1 x 16
−
16 16 7
3 1 1
− 2 −3 −4 y =
1 3 1
− − − −3
8 8 8 8 8 8
1 1 1 z 0
− 5 1 7 − 5 1 7
− −
16 16 16 16 16 16
x −1
y = 3
z −2
B. CRAMER’S RULE
Another simple way of solving the simultaneous linear equations is the Cramer’s rule
provided A 0 . Using this rule, the values of X vector can be estimated as:
4𝑥 + 𝑦 − 3𝑧 = 11
3𝑥 − 2𝑦 + 5𝑧 = 21
Step 1: Find the determinant, D, by using the x, y and z values from the problem
2 3 −1 2 3 −1 2 3
D = |4 1 −3| = |4 1 −3| 4 1 = -9 – 69 = -78
3 −2 5 3 −2 5 3 −2
Since A 0 we can proceed with Cramer’s Rule
MLK_SDT_L2_20-21_4/10
Step 2: Find the determinant, Dx, by replacing the coefficient of x in the first column with
the RHS values of the equations leaving the y and z columns unchanged.
1 3 −1 1 3 −1 1 3
DX = |11 1 −3| = |11 1 −3| 11 1 = -162 - 150 = -312
21 −2 5 21 −2 5 21 −2
Step 3: Find the determinant, Dy, by replacing the coefficient of y in the first column with
the RHS values of the equations leaving the x and z columns unchanged.
2 1 −1 2 1 −1 2 1
Dy = |4 11 −3| = |4 11 −3| 4 11 = 17-(-139) = 156
3 21 5 3 21 5 3 21
Step 4: Find the determinant, Dz, by replacing the coefficient of z in the first column with the
RHS values of the equations leaving the x and y columns unchanged.
2 3 1 2 3 1 2 3
Dz = |4 1 11| = |4 1 11| 4 1 = 133 – 211 = -78
3 −2 21 3 −2 21 3 −2
Step 5: Use Cramer’s Rule to find the values of x, y and z.
Dx −312
x = = = 4
D −78
𝐷𝑦 156
y = = = -2
𝐷 −78
𝐷𝑧 −78
z = = = 1
𝐷 −78
Generally, the answer is written as an order triple (4, -2, 1) representing the x, y and z
values.
Note:
The Cramer’s rule and Matrix method become tedious for large systems. However, there exist other
numerical methods of solution which are well suited for large problems. These are the Direct Methods
and the Iterative Methods of Solution.
x + y + z = 6;
x − y + z = 2;
2x − y + 3z = 9 ;
Solution:
1. Arrange the equations such that 1st equation is with the largest coeff. of X; 2nd is with
largest coeff. of Y and 3rd is with largest coefficient of Z (Preferable but not necessary).
MLK_SDT_L2_20-21_5/10
x+ y+z =6 (1)
x− y+z =2 (2)
2x − y + 3z = 9 (3)
1 1 1 6
[1 −1 1| 2]
2 −1 3 9
MLK_SDT_L2_20-21_6/10
2. ITERATIVE METHODS OF SOLUTION
In this method, one start from an approximation close to true solution and keep on improving
the solution in each cycle till the solution matches with the previous cycle solution with a
desired level of satisfaction.
Consider the equations:
a2 x + b2 y + c2 z = d 2 (2)
a3 x + b3 y + c3 z = d 3 (3)
Arrange the equations such that 1st equation is with the largest coeff. of x; 2nd is with largest
coeff. of y and 3rd is with largest coefficient of z. If, a1, b2 and c3 are large as compared to other
coefficients, then solve the Eq. 1 for x, Eq. 2 for y and Eq. 3 for z.
1
x= (d1 − b1 y − c1z ) (4)
a1
1
y= (d2 − a2 x − c2z ) (5)
b2
1
z= (d3 − a3x − b3 y) (6)
c3
MLK_SDT_L2_20-21_7/10
3. Repeat this process till the 1
y2 = (d 2 − a2 x2 − c2 z1 )
difference between the two b2
consecutive approximations is 1
negligible. z2 = (d3 − a3 x2 − b3 y2 )
c3
3. Repeat this process till the difference
between the two consecutive
approximations is negligible.
Example: Solve the system of linear Example: Solve the system of linear
equations equations
20x + y - 2z =17 20x + y - 2z =17
3x + 20y – z = -18 3x + 20y – z = -18
2x – 3y + 20z = 25 2x – 3y + 20z = 25
Rearrange the given equations as follows: Rearrange the given equations as follows:
1 1
x = (17 − y + 2z) (1) x= (17 − y + 2z) (1)
20 20
1 1
y = (−18 − 3x + z) (2) y = (−18 − 3x + z) (2)
20 20
1 1
z = (25 − 2x + 3y) (3) z = (25 − 2x + 3y) (3)
20 20
Iteration 1: Iteration 1:
Initial Assumption: X = y = z = 0. Initial Assumption: y = z = 0.
Substituting these on the right sides of the So, x = 17 = 0.85 from Eq. (1)
1
above equations, we get 20
17 18 Substitute x = 0.85 and z = 0 in Eq. (2)
x1 = = 0.85 ; y1 = − = −0.9 ; (−18−3×0.85+1×0)
20 20 Then, 𝑦1 = = −1.0275
20
25 Substitute x = 0.85 and y = -1.0275 in Eq. (3)
z1 = = 1.25
20 Then,
Iteration 2: {25 − 2 0.85 + 3 (−1.0275)}
z1 = = 1.0109
Substituting these new values again on the 20
right sides of the equations (1), (2) and (3), Iteration 2:
we get Substitute the value of y = -1.0275 and z =
1 1.0109 in Eq. (1), then
x 2 = (17 − y1 + 2 z1 )
20 {17 − (−1.0275) + 2 1.0109}
x2 = = 1.0025
1 20
= [17 − (−0.9) + 2 (1.25)] = 1.02
20 Substitute the value of x = 1.0025 and z =
1 1.0109 in Eq. (2), then
y2 = (−18 − 3 x1 + z1 ) (−18 − 3 1.0025 + 1.0109)
20 y2 = = −0.9998
1 20
= [−18 − 3 (0.85) + 1.25] = −0.965 Substitute the value of x = 1.0025 and y = -
20
1 0.9998 in Eq. (3), then
z2 = (25 − 2 x1 + 3 y1 ) {25 − 2 1.0025 + 3 (−0.9998)}
20 z2 = = 0.9998
1 20
= [25 − 2 (0.85) + 3 (−0.9)] = 1.03
20
Iteration 3:
MLK_SDT_L2_20-21_8/10
Iteration 3: Similarly, if we proceed then, x3 = 1, y3 = -1, z3
Substituting these new values, i.e. (x1,y2 & = 1.
z2) again on the right sides of the Iteration 4:
equations (1), (2) and (3), we get X4 = 1, y4 = -1 and z4 = 1.
x3 = 1.0013, y3 = -1.0015 & z3 = 1.0033
Iteration 4: Hence, the solution is x=1, y= -1 and z = 1.
Substituting the values of x3 = 1.0013, y3 =
-1.0015 & z3 = 1.0033 we get x4 = 1.0004, Here, precision up to 4th decimal place is
y4 = -1.0000 and z4 = 0.9996. considered.
Iteration 5:
Substituting the values of x4 = 1.0004, y4 =
-1.0000 and z4 = 0.9996 we get x5 = 1.0000,
y5 = -1.0001 and z5 = 1.0000.
Iteration 6:
Substituting the values of x5 = 1.0000, y5 =
-1.0001 and z5 = 1.0000 we get x6 = 1, y6 =
-1 and z6 = 1.
Iteration 7:
Substituting the values of x6 = 1, y6 = -1 and
z6 = 1 we get x7 = 1, y7 = -1 and z7 = 1.
REFERENCES
1. Grewal, B.S. (2005). Higher Engineering Mathematics. Khanna Publishers, New Delhi.
2. Kansal, M.L. (2004). System Analysis Techniques in Water Resources Management.
3. Matrix solution of equations, Helping Engineers Learn Mathematics, http://helm.lboro.ac.uk/
4. http://atozmath.com/Menu/Algebra.aspx
MLK_SDT_L2_20-21_9/10
Appendix – A Exercises
Solve the system of linear equations with 3 variables.
Problem 1. Problem 5:
4x + 2y - 2z = 10 −x + 3y − 2z = 5
2x + 8y + 4z = 32 4x − y − 3z = −8
30x + 12y - 4z = 24 2x + 2y − 5z = 7
79 91
Solution: ( -2, 6, -3) Solution: (-10, - , − )
11 11
Problem 2. Problem 6:
3x - 2y + z = 24 x + 2y + 3z = −5
2x + 2y + 2z = 12 3x + y − 3z = 4
x + 5y - 2z = -31 −3x + 4y + 7z = −7
Solution: (3, -4, 7) Solution: (-1,1,-2)
Problem 3. Problem 7:
−2x − y − 3z = 3
5x - 2y + 4x = 0
2x − 3y + z = −13
2x - 3y + 5z = 8 2x − 3z = −11
3x + 4y - 3z = -11 Solution: (-4,2,1)
Solution: (-2, 1, 3) Problem 8:
Problem 4. −y − 2z = −8
x + 2y + 2z = 5 x + 3z = 2
3x - 2y + z = -6 7x + y + z = 0
2x + y - z = -1 Solution: (-1,6,1)
Solution: (-1, 2, 1)
MLK_SDT_L2_20-21_10/10