Professional Documents
Culture Documents
Solution of System of Linear Equations
Solution of System of Linear Equations
Direct methods
a 1 b1 c 1 d 1
(A, B) a 2 b2 c 2 d 2
a 3 b3 c 3 d 3
a 1 b1 c1 d 1
If (A,B) 0 b2 ' c2 ' d 2 '
0 0 c3 ' d 3 '
For example
Solve the system of equations:
x +2y +3z =14, 2x + 5y +2z = 18, 3x +y +5z = 20 by Gauss elimination method
Solution:
The given system of equations can be written as
AX = B
1 2 3 x 14
Where, A = 2 5 2 , X = y , B = 18
3 1 5 z 20
1 2 3 14
(A, B) 2 5 2 18
3 1 5 20
By R3 →R3 + 5R2
1 2 3 14
(A, B) 0 1 −4 −10
0 0 −24 −72
1 0 0 d1 '
If (A,B) 0 1 0 d2 '
0 0 1 d3 '
Then we can write
x = d1’, y = d2’, z = d3’
For example
Solve the system of equations:
x +2y +3z =14, 2x + 5y +2z = 18, 3x +y +5z = 20 by Gauss jordan method
Solution:
The given system of equations can be written as
AX = B
1 2 3 x 14
Where, A = 2 5 2 , X = y , B = 18
3 1 5 z 20
1 2 3 14
(A, B) 2 5 2 18
3 1 5 20
By R3 →R3 + 5R2
1 2 3 14
(A, B) 0 1 −4 −10
0 0 −24 −72
By R1→R1 – 2R2
1 0 11 34
(A, B) 0 1 −4 −10
0 0 −24 −72
By R3 →(-1/24)R3
1 0 11 34
(A, B) 0 1 −4 −10
0 0 1 3
1 0 0 1
(A, B) 0 1 0 2
0 0 1 3
a2x+b2y +c2z = d2
AX = B
a 1 b1 c 1 x d1
Where A = a 2 b2 c 2 , X = y , B = d2
a 3 b3 c 3 z d3
In this method, the coefficient matrix A is factorized into unit lower triangular and upper triangular
matrix.
i.e. A = LU
Multiplying matrix L and U and equating with matrix A, we get matrix L and U
We have
AX = B
LUX = B
Let UX = Y ………(i)
Then LY = B…….(ii)
Y = ..
X = ...
For example
Solution:
AX = B
1 2 3 x 14
Where, A = 2 5 2 , X = y , B = 18
3 1 5 z 20
Now factorizing the coefficient matrix A is into unit lower triangular and upper triangular matrix.
i.e. A = LU
2X3 = - 4, l 31 u11 = 3, l 31= 3/1 =3, l 31 u12 +l 32 u22 =1, l 32 = (1-3X2)/1 = -5, l 31 u13 +l 32 u23 +u33 =5, u33 = 5 – 3X3
– (-5)X (-4) = -24
Now
AX = B
LUX= B
Let UX =Y …….(i)
1 0 0 y 1 14
l 21 1 0 y 2 = 18
l 31 l 32 1 y 3 20
1 0 0 y 1 14
2 1 0 y 2 = 18
3 −5 1 y 3 20
y1 =14
1 2 3 x 14
0 1 −4 y = −10
0 0 −24 z −72
Note:
(i) If the coefficient matrix A is factorized into unit lower triangular matrix and upper triangular matrix
then it is called Dollitle’s factorization.
(ii) If the coefficient matrix A is factorized into lower triangular matrix and unit upper triangular matrix
then it is called Crout’s factorization.
a2x+b2y +c2z = d2
AX = B
a 1 b1 c 1 x d1
Where A = a 2 b2 c 2 , X = y , B = d2
a 3 b3 c 3 z d3
In this method, the coefficient matrix A is factorized into lower triangular and unit upper triangular
matrix.
A = LU
a 1 b1 c 1 l 11 0 0 1 u12 u13
a 2 b2 c 2 =l 21 l 22 0 0 1 u23
a 3 b3 c 3 l 31 l 32 l 33 0 0 1
For example
a2x+b2y +c2z = d2
AX = B
a 1 b1 c 1 x d1
Where A = a 2 b2 c 2 , X = y , B = d2
a 3 b3 c 3 z d3
We know that
adj. A
X = A-1B, where, A-1 = , | A| ≠ 0, adj.(A) = transpose of matrix of cofactors of A
|A|
For example
Solution
AX = B
1 2 3 x 14
Where, A = 2 5 2 , X = y , B = 18
3 1 5 z 20
23 −7 11
Adj.A =transpose of matrix of cofactors of A = −4 −4 4
−13 5 1
23 −7 11
adj. A 1
A-1 = = −4 −4 4
|A| −24 −13 5 1
−23 7 −11
24 24 24
1 1 −1
=
6 6 6
13 −5 −1
24 24 24
−23 7 −11
24 24 24
14
1 1 −1
X = A-1B = 18 =
6 6 6
20
13 −5 −1
24 24 24
Iterative method is more suitable when the main diagonal elements are dominant.
|a 1| ≥|b1| + |c 1|
|b 2| ≥|a2| + |c 2|
|c 3| ≥|a3| + |b 3|
From equation (i)
x = d1 / a1 =a
y = d2 / b2 =b rough values
z = d3 / c3 =c
Second iteration
Third iteration
The process will be continued until getting the same result in last two iterations
x = d1 / a1 =a
Second iteration
x = (d1 - b1b- c1c)/ a1 = d ≠ a
Third iteration
The process will be continued until getting the same result in last two iterations
For example
Solve the following equations by (a) Gauss Jacobi and (ii) Gauss Siedel iterative method:
2x-7y-10z = -17
5x + y + 3z = 14
x + 10y + 9z = 7
Solution
5x + y + 3z = 14 …..(i)
x + 10y + 9z = 7……(ii)
2x-7y-10z = -17….(iii)
x = ( 14-y - 3z)/5…….(iv)
z = ( -17- 2x + 7y)/-10
z = ( 17+ 2x - 7y)/10 …..(vi)
Exercises
1. Solve the following system of equations by Gauss elimination method, Gauss Jordan and
factorization method.
4x + y + 2z = 4
3x + 5y + z = 7
x + y + 3z= 3
2. Solve the following system of equations by Gauss Jacobi and Gauss Sidel iterative method.
10x1 -x2 +2x3 = 4
x1 +10x2- x3 = 3
2x1 +3x2+20x3 =7
Ans[ 0.375, 0.289,0.269]