Simultaneous Linear Equations
Simultaneous Linear Equations
where
a 11 , a12 , a 13 , a21 , a22 , a23 , a31 , a 32 , a33 , b1 , b 2 ,b 3 are constants and x 1 , x2 , x 3 are variables to
be found.
Matrix Form
The given system of simultaneous linear equations can be written in the matrix form as
AX =B
( ) ()
a11 a12 a 13 b1
A= a21 a22 a 23 B= b 2
a31 a32 a 33 b3
Where is the Co-efficient matrix, is the Constant matrix and
()
x1
X = x2
x3
is the variable matrix.
Methods
In numerical methods, there are two of methods to solve simultaneous linear equations.
1. Direct method
2. Iterative method
There are two types of direct methods to solve simultaneous linear equations.
1. Gauss-Elimination method
2. Gauss-Jordan method
Augmented Matrix
The matrix obtained by adjoining the constant matrix B with the co-efficient matrix A is
[ A|B ]
called augmented matrix and is denoted by , given by
a11 a12 a 13 b 1
[ A|B ] =⟨ a21 a22 a 23|b 2 ⟩
a31 a32 a 33 b 3
Gauss-Elimination method
In Gauss-Elimination method, using row transformations the augmented matrix
corresponding to the given system of equations are converted in to upper triangular matrix of
the form
Gauss-Jordan method
In Gauss Jacobi method, using row transformations the augmented matrix corresponding to
the given system of equations are converted in to diagonal or unit matrix of the form
Example
Solution
1 2 1 3
[ A|B ]=⟨ 2 3 3|10 ⟩
3 −1 2 13
Gauss-Elimination method
a 11=1
The pivotal element is
1 2 1 3 R1 → R1
[ A|B ] =⟨ 2 3 3|10 ⟩ R2 →1 R2 −2 R1
3 −1 2 13 R3 →1 R3 −3 R1
1 2 1 3
[ A|B ]≈⟨ 0 −1 1 |4 ⟩
0 −7 −1 4
a 22=−1
The pivotal element is
1 2 1 3 R1 →R 1
[ A|B ] =⟨ 0 −1 1 |4 ⟩ R2 →R 2
0 −7 −1 4 R →(−1) R −(−7 )R
3 3 2
1 2 1 3
[ A|B ]≈⟨ 0 −1 1 | 4 ⟩
0 0 −8 −24
⇒ x +2 y + z=3
− y + z=4
−8 z=−24
−8 z=−24 ⇒ z=3
− y +z=4 ⇒ y=−1
x +2 y+z=3⇒ x=2 .
()
2
X = −1
3
Gauss-Jordan method
a 11=1
The pivotal element is
1 2 1 3 R1 → R1
[ A|B ] =⟨ 2 3 3|10 ⟩ R2 →1 R2 −2 R1
3 −1 2 13 R3 →1 R3 −3 R1
1 2 1 3
[ A|B ]≈⟨ 0 −1 1 |4 ⟩
0 −7 −1 4
a 22=−1
The pivotal element is
1 2 1 3 R1 →(−1)R 1−2 R2
[ A|B ] =⟨ 0 −1 1 |4 ⟩ R2 →R 2
0 −7 −1 4 R →(−1) R −(−7 )R
3 3 2
1 0 3 11
[ A|B ]≈⟨ 0 −1 1 | 4 ⟩
0 0 −8 −24
a 33=−8
The pivotal element is
1 0 3 11 R 1 →(−8 )R1 −3 R3
[ A|B ] =⟨ 0 −1 1 | 4 ⟩ R 2 →(−8 )R2 −R3
0 0 −8 −24 R 3 → R3
−8 0 0 −16
[ A|B ]≈⟨ 0 8 0 | −8 ⟩
0 0 −8 −24
⇒−8 x=16
8 y=−8
−8 z=−24
()
2
X = −1
3
Example
Solution
1 1 1 1 2
[ A|B ]=⟨ 2 −1 2 −1 |−5 ⟩
3 2 3 4 7
1 −2 −3 2 5
Gauss-Elimination method
a 11=1
The pivotal element is
1 1 1 1 2 R1 → R1
R →1 R2 −2 R1
[ A|B ] =⟨ 2 −1 2 −1 |−5 ⟩ 2
3 2 3 4 7 R3 →1 R3 −3 R1
1 −2 −3 2 5 R →1 R −1 R
4 4 1
1 1 1 1 2
[ A|B ]≈⟨ 0 −3 0 −3|−9 ⟩
0 −1 0 1 1
0 −3 −4 1 3
a 22=−3
The pivotal element is
1 1 1 1 2 R1 →R 1
R2 →R 2
[ A|B ] =⟨ 0 −3 0 −3 |−9 ⟩
0 −1 0 1 1 R3 →(−3 )R 3 −(−1) R2
0 −3 −4 1 3 R →(−3 )R −(−3 )R
4 4 2
1 1 1 1 2
[ A|B ]≈⟨ 0 −3 0 −3 | −9 ⟩
0 0 0 −6 −12
0 0 12 −12 −36
a 33=0 R3 R4
The pivotal element is . Interchanging and
1 1 1 1 2
[ A|B ]=⟨ 0 −3 0 −3 | −9 ⟩
0 0 12 −12 −36
0 0 0 −6 −12
⇒ x + y + z +w=2
−3 y−3 w=−9
12 z−12 w=−36
−6 w=−12
−6 w=−12 ⇒ w=2
12 z−12 w=−36 ⇒ z=−1
−3 y−3 w=−9⇒ y=1
x+ y+z+w=2⇒ x=0
()
0
1
X=
−1
2
Gauss-Jordan method
a 11=1
The pivotal element is
1 1 1 1 2 R1 → R1
R →1 R2 −2 R1
[ A|B ] =⟨ 2 −1 2 −1 |−5 ⟩ 2
3 2 3 4 7 R3 →1 R3 −3 R1
1 −2 −3 2 5 R →1 R −1 R
4 4 1
1 1 1 1 2
[ A|B ]≈⟨ 0 −3 0 −3|−9 ⟩
0 −1 0 1 1
0 −3 −4 1 3
a 22=−3
The pivotal element is
1 1 1 1 2 R1 →(−3) R1 −1 R 2
R2 →R 2
[ A|B ] =⟨ 0 −3 0 −3 |−9 ⟩
0 −1 0 1 1 R3 →(−3 )R 3 −(−1) R2
0 −3 −4 1 3 R →(−3 )R −(−3 )R
4 4 2
−3 0 −3 0 3
[ A|B ]≈⟨ 0 −3 0 −3 | −9 ⟩
0 0 0 −6 −12
0 0 12 −12 −36
a 33=0 R3 R4
The pivotal element is . Interchanging and
−3 0 −3 0 3
[ A|B ]=⟨ 0 −3 0 −3 | −9 ⟩
0 0 12 −12 −36
0 0 0 −6 −12
a 33=12
The pivotal element is .
36 0 0 0 0
[ A|B ]=⟨ 0 −3 0 0 | −3 ⟩
0 0 12 0 −12
0 0 0 −6 −12
()
0
1
X=
−1
2
( ) ( )
a11 a12 a 13 1 0 0
A= a21 a22 a 23 I= 0 1 0
a31 a32 a 33 0 0 1
Augment the given matrix with identity matrix of same
order.
Using linear transformation the augmented matrix reduced into the following form
Example
( )
3 −1 1
A= −15 6 −5
5 −2 2
Solution
3 −1 1 1 0 0
[ A|I ]=⟨−15 6 −5|0 1 0 ⟩
5 −2 2 0 0 1
a 11=3
The pivotal element is
3 −1 1 1 0 0 R1 →R 1
[ A|I ] =⟨−15 6 −5|0 1 0 ⟩ R2 →3 R2 −(−15 )R 1
5 −2 2 0 0 1 R3 →3 R3 −5 R1
3 −1 1 1 0 0
[ A|I ]=⟨0 3 0 |15 3 0 ⟩
0 −1 1 −5 0 3
a 22=6
The pivotal element is
3 −1 1 1 0 0 R1 →R1
[ A|I ] =⟨ 0 3 0 |15 3 0 ⟩ R2 →R 2
0 −1 1 −5 0 3 R3 →6 R 3 +2 R2
3 −1 1 1 0 0
[ A|I ]=⟨0 3 0 |15 3 0 ⟩
0 0 6 0 6 18
i)
3 −1 1 1
⟨ 0 3 0 |15 ⟩
0 0 6 0
⇒3 x− y+z =1
3 y =15
6 z=0
6 z=0 ⇒ z=0
3 y=15 ⇒ y=5
3 x− y +z=1 ⇒ x=2 .
()
2
X 1= 5
0
ii)
3 −1 1 0
⟨ 0 3 0 |3 ⟩
0 0 66
⇒3 x− y+z =0
3 y =3
6 z=6
6 z=6 ⇒ z=1
3 y=3 ⇒ y=1
3 x− y +z=0 ⇒ x =0 .
()
0
X 2= 1
1
iii)
3 −1 1 0
⟨ 0 3 0| 0 ⟩
0 0 6 18
⇒3 x− y+z =0
3 y =0
6 z=18
6 z=18 ⇒ z=3
3 y=0⇒ y=0
3 x− y +z=0 ⇒ x =−1.
()
−1
X 3= 0
3
( )
2 0 −1
−1
A =5 1 0
0 1 3
Hence,
Example
( )
0 1 1
A= 1 2 0
3 −1 −4
Solution
0 1 1 1 0 0
[ A|I ]=⟨1 2 0 |0 1 0 ⟩
3 −1 −4 0 0 1
1 2 0 0 1 0 R1 →R1
[ A|I ] =⟨0 1 1 |1 0 0 ⟩ R2 →1 R2 −(0 )R 1
3 −1 −4 0 0 1 R →1 R −3 R
3 3 1
1 2 0 0 1 0
[ A|I ]=⟨0 1 1 |1 0 0 ⟩
0 −7 −4 0 −3 1
a 22=1
The pivotal element is
1 2 0 0 1 0 R1 →R 1
[ A|I ] =⟨ 0 1 1 |1 0 0 ⟩ R2 →R 2
0 −7 −4 0 −3 1 R3 →1 R3 +7 R2
1 2 00 1 0
[ A|I ]=⟨0 1 1 |1 0 0 ⟩
0 0 3 7 −3 1
i)
1 2 00
⟨ 0 1 1|1 ⟩
0 0 37
⇒ x +2 y=0
y + z =1
3 z=7
7
3 z=7 ⇒ z=
3
−4
y + z=1 ⇒ y =
3
8
x +2 y=0 ⇒ x= .
3
()
8
3
−4
X 1=
3
7
3
ii)
1 2 0 1
⟨ 0 1 1| 0 ⟩
0 0 3 −3
⇒ x +2 y=1
y +z=0
3 z=−3
3 z=−3 ⇒ z=−1
y +z=0⇒ y=1
x +2 y=1⇒ x=−1 .
()
−1
X 2= 1
−1
iii)
1 2 00
⟨ 0 1 1|0 ⟩
0 0 31
⇒ x +2 y=0
y +z=0
3 z=1
1
3 z=1⇒ z=
3
−1
y + z=0⇒ y=
3
2
x +2 y=0 ⇒ x= .
3
()
2
3
−1
X 3=
3
1
3
( )
8 2
−1
3 3
−1 −4 −1
A = 1
3 3
7 1
−1
3 3
Hence, .
3.4. Iterative methods
There are two types of direct methods to solve simultaneous linear equations.
a 11 x 1 + a12 x 2 + a13 x 3 =b 1
a 21 x 1 +a 22 x 2 +a 23 x 3 =b2
a 31 x 1 +a 32 x 2 +a 33 x 3 =b3
In iterative methods, the solution converges if the given system are diagonally dominant.
If the given equations are not diagonally dominant then rearrange the equations such that the
systems are diagonally dominant.
In this method previous iterative values are used for evaluating new values for variables and
the equations for evaluating variables are
b1 −a12 x i +a13 x i
2 3
x i +1=
1 a11
b2 −a21 x i +a 23 x i
1 3
x i +1=
2 a22
b3 −a 31 x i +a 32 x i
1 2
x =
3i +1 a
33
In this method current values are used for evaluating new values for variables and the
equations for evaluating variables are
b1 −a12 x i +a13 x i
2 3
x i +1=
1 a11
b2 −a21 x i+1 + a23 x i
1 3
x i +1=
2 a22
b3 −a 31 x i+1 +a32 x i +1
1 2
x i +1 = .
3 a33
Example
Solution
Diagonally dominant
10> 5+ 2
10 > 4+3
10 > 1+ 6 .
Gauss-Jacobi method
3+5 y i +2 z i
x i+1 =
10
−3−4 xi −3 z i
y i+1=
−10
−3−x i−6 y i
z i+1 = .
10
Substituting i=0
3+5 y 0 +2 z 0
x 1=
10
0 0
1 −3−4 x −3 z
y =
−10
−3−x 0 −6 y 0
z 1= .
10
Initial values
x 0 =0 ; y 0 =0 ; z 0=0;
1 3+5 y 0 +2 z 0
x= =0 .3
10
−3−4 x 0 −3 z 0
y 1= =0 .3
−10
0 0
1 −3−x −6 y
z= =−0 . 3 .
10
Substituting i=1
3+5 y 1 +2 z1
x 2= =0 . 39
10
1 1
2 −3−4 x −3 z
y= =0 . 33
10
−3−x 1 −6 y 1
z2= =−0 .51 .
10
Iteration x y z
initial 0 0 0
1 0.3 0.3 -0.3
2 0.39 0.33 -0.51
3 0.363 0.303 -0.537
4 0.3441 0.2841 -0.5181
5 0.33843 0.2822 -0.50487
6 0.34013 0.28391 -0.50316
7 0.34182 0.28510 -0.50436
8 0.34168 0.28522 -0.50519
9 0.34168 0.28522 -0.50519
Gauss-Seidel method
3+5 y i +2 z i
x i+1 =
10
−3−4 xi+1 −3 z i
y i+1=
−10
−3−x i+1 −6 y i+1
z i+1 = .
10
Substituting i=0
3+5 y 0 +2 z 0
x 1=
10
1 0
1 −3−4 x −3 z
y=
−10
−3−x 1 −6 y 1
z 1= .
10
Initial values
x 0 =0 ; y 0 =0 ; z 0=0;
1 3+5 y 0 +2 z 0
x= =0 .3
10
−3−4 x 1 −3 z 0
y 1= =0. 42
−10
1 1
1 −3−x −6 y
z= =−0 .582 .
10
Substituting i=1
3+5 y 1 +2 z1
x 2= =0 . 3936
10
−3−4 x 2 −3 z1
y 2= =0 . 28284
10
−3−x 2 −6 y 2
z2= =−0 . 50906.
10
Iteration x y z
initial 0 0 0
1 0.3 0.42 -0.582
2 0.3936 0.28284 -0.50906
3 0.33961 0.28312 -0.50383
4 0.34079 0.28517 -0.50518
5 0.34155 0.28508 -0.50520
6 0.34149 0.28504 -0.50517
7 0.34149 0.28504 -0.50517
Example
Diagonally dominant
1<1+ 54
6 < 27+1
2 <6 + 15 .
The given system is not diagonally dominant. Hence re-arranging the equation such that it
is diagonally dominant as follows
27 x+6 y−z=85 ;
6 x+15 y+2 z=72;
x + y+54 z=110.
Gauss-Jacobi method
85−6 y i +z i
x i+1 =
27
72−6 xi −2 z i
y i+1=
15
110−x i− yi
z i+1 = .
54
Substituting i=0
1 85−6 y 0 +z 0
x=
27
72−6 x 0 −2 z0
y 1=
15
0 0
1 110−x − y
z= .
54
Initial values
x 0 =0 ; y 0 =0 ; z 0=0;
85−6 y 0 +z 0
x 1= =3 .14815
27
72−6 x 0 −2 z0
y 1= =4 . 8
15
110−x 0 − y 0
z 1= =2 . 03704
54
Substituting i=1
2 85−6 y1 +z 1
x = =2 . 15693
27
72−6 x 1 −2 z 1
y 2= =3 . 26913
15
1 1
2 110− x − y
z= =1 .88985
54
Iteration x y z
initial 0 0 0
1 3.14815 4.8 2.03704
2 2.15693 3.26913 1.88985
3 2.49167 3.68525 1.93655
4 2.40093 3.54513 1.92265
5 2.43155 3.58327 1.92692
6 2.42323 3.57046 1.92565
7 2.42603 3.57395 1.92604
8 2.42527 3.57278 1.92593
i+1 85−6 y i +z i
x =
27
72−6 xi+1 −2 z i
y i+1=
15
i+1 i+1
i+1 110−x − y
z = .
54
Substituting i=0
85−6 y 0 +z 0
x 1=
27
1 0
1 72−6 x −2 z
y =
15
110−x 1 − y 1
z 1= .
54
Initial values
x 0 =0 ; y 0 =0 ; z 0=0;
85−6 y 0 +z 0
x 1= =3 .14815
27
1 0
1 72−6 x −2 z
y = =3 . 54074
15
110−x 1 − y 1
z 1= =1. 91317
54
Substituting i=1
2 85−6 y1 +z 1
x = =2 . 43218
27
72−6 x 2 −2 z 1
y 2= =3 . 57204
15
2 2
2 110− x − y
z= =1 . 92585
54
Iteration x y z
initial 0 0 0
1 3.14815 3.54074 1.91317
2 2.43218 3.57204 1.92585
3 2.42569 3.57294 1.92595
4 2.42549 3.57301 1.92595
5 2.42548 3.57301 1.92595
6 2.42548 3.57301 1.92595
Exercise
( )
2 1 1
3 2 3
1 4 9
a.
( )
3 −3 4
2 −3 4
0 −1 1
b.
3. Solve the following systems by i) Gauss-Jacobi ii) Gauss-Seidel methods
5 x−2 y+ z=−4 ; x +6 y−2 z=−1 ; 3 x+ y+5 z=13 .
a.
30 x−2 y +3 z=75 ; 2 x+2 y +18 z=30 ; x +17 y−2 z=48 .
b.
14 x−5 y=5. 5 ; 2 x+7 y=19 .3 .
c.
10 x−2 y−z−t=3 ; −2 x+10 y−z−t=15 ;
−x− y+10 z−2 t=27 ; −x− y−2 z+10 t=−9 .
d.
y−x +10 z=35 . 61; x+z+10 y=20 . 08 ; y −z+10 x=11. 19 .
e.