ilovepdf_merged (4)
ilovepdf_merged (4)
Unit – 1
Numerical Analysis: Numerical analysis is the area of mathematics and computer science that
creates, analyzes, and implements algorithms for solving numerically the problems of continuous
mathematics.
Iterative method:
Rate of convergence:
An iterative method is said to be of order p or has the rate of convergence p, If p is the largest
positive real number for which there exists a finite constant c (c ≠ 0), such that
k 1
p
c (1)
k
Where k xk is the error in kth iterate. The constant c is called the asymptotic error and usually
depends on the derivative of f(x) at x .
The equation (1) tells us the rate of which the iteration method converges if the initial
approximation to the root is sufficiently close to the desired root.
To find the roots of the equation f ( x) 0 (1) by successive approximation we get equation
(1) as x (x) (2) the roots of equation (1) are the same as points of intersection of the straight
line y x and the curve representing y (x) .
Above figures illustrate the working of the iteration method which provides spiral (or) staircase.
Let x x0 be an initial approximation to the desired root x , then 1st approximation is x1 ( x0 )
, 2nd approximation is x2 ( x1 ) proceeding in this way, the (n+1)th approximation is xn 1 ( xn )
n 0,1,2,3,........
1
Fixed Point Theorem:
Let x be the root of the equation f ( x) 0 and I be the interval containing the point x .
Let (x) and ( x) be continuous functions in I, where (x) is defined as x (x) , which is
equivalent to f ( x) 0 and if ( x ) k 1, x I , then the sequence of approximations
x0 , x1 , x2 ,.....xn defined by ( xn ) converges to the root x provided that the initial
approximation x0 is chosen in I.
() (3)
x1 x 0 (4)
( ) ( x0 )
(0 ) where 0 x0 ,
x0
x1 x0 ( 0 ) , 0 x0 ,
Similarly,
x 2 x1 (1 ) , 1 x1 ,
x3 x2 ( 2 ) , 2 x2 ,
……………………………………………..
2
………………………………………………
x n x n 1 ( n 1 ) , n 1 x n 1 ,
x n 1 x n ( n ) , n xn , (6)
Since ( n ) k 1, n N
xn1 x0 k n1
Let n 1 & n be the errors of the approximations of xn1 & xn respectively, then n 1 xn 1 ,
n xn .
xn1 xn . n
n 1 n .k
n1
k 1
n
By definition of rate of convergence p = 1. This shows that rate of convergence of iteration method
is linear.
3
The linear convergence of an iteration method can be improved with the help of Aitken’s
2
method.
Aitken’s method:
2
Let xn , xn 1 , xn 2 be three successive approximations to the desired root of the equation x (x)
We know that
x n 1 x n ( n )
x n 2 x n 1 ( n 1 )
We assume that error in each iteration is equal to the constant time in the previous error, so we
write
x n 1 k x n
x n 2 k x n 1
We write
x n 1 k x n
x n 2 k x n 1
Eliminating k we get
xn1 xn
xn 2 xn1
xn 1 xn 1 x n 2 xn
2 xn21 2 xn 1 2 xn 2 xn xn xn 2
xn xn 2 xn21 xn 2 2 xn 1 xn
x n x n 2 x n21 x n 2 2 x n 1 x n
4
xn xn 2 xn21
xn 2 2 xn 1 xn
xn xn2 2 xn1 xn xn21 2 xn xn1 xn2
xn2 2 xn1 xn
xn2 2xn1 xn
xn1 xn
2
xn
xn2 2xn1 xn
We know that
xn xn 1 xn
2 x n x n 1 x n
2 xn xn 1 xn
2 x n x n 2 x n 1 x n 1 x n
2 x n x n 2 2 x n 1 x n
xn
2
Therefore x xn , n 1,2,3,4......
*
n
2 xn
5
Example: Perform two iterations of the linear iteration method followed by one Aitken’s
2
method to find the root of the equation, repeat the process two times in each case,
f ( x) x3 5 x 1, x0 0.5 .
f (0) 1 0, f (1) 3 0
x3 1
We write f ( x) x 5 x 1 as x
3
( x)
5
3x 2
( x)
5
3x 2 3(0.5) 2
( x ) 0.15 1
5 5
xn 1 ( xn )
xn3 1
xn1 , n 0,1,2,3.........
5
Given x0 0.5
x03 1 (0.5)3 1
x1 0.225
5 5
x13 1 (0.225)3 1
x2 0.20228
5 5
Aitken’s method
2
xn xn1 xn
2 2
x xn
*
n xn , n 0,1, 2,3,4.......
2 xn xn2 2xn1 xn
6
x1 x0 0.225 0.5
2 2
For n = 0, x x0 0.5
*
0
x2 2x1 x0 0.20228 2(0.225) 0.5
x0* 0.2002
x1* ( x0* )
x0*3 1 (0.2002)3 1
x1* 0.2016
5 5
x1*3 1 (0.2016)3 1
x2* 0.20164
5 5
Aitken’s method
2
x
2
*
n 1 xn*
xn** xn*
xn* 2 2 xn*1 xn*
x
2
x0* 0.2016 0.2002
* 2
1
For n = 0, x x **
0
*
0 0.2002
x2* 2 x1* x0* 0.20164 2(0.2016) 0.2002
x0** 0.20164
Example: Perform two iteration of the linear iterations method followed by one Aitken’s
2
method to find the root of the equation, repeat the process two times in each case, f ( x ) x e x
Solution: Let f ( x ) x e x
We write f ( x ) x e x as x e x ( x )
( x) e x
7
( x) e1 0.3678 1
xn 1 ( xn )
x n 1 e xn , n 0,1, 2, 3.........
Given x0 1
x1 e x0 e 1 0.3678
x2 e x1 e 0.3678 0.6922
Aitken’s method
2
xn xn1 xn
2 2
x xn
*
n xn , n 0,1, 2,3,4.......
2 xn xn2 2xn1 xn
x1 x0 0.3678 1
2 2
For n = 0, x x0 1 0.5821
*
0
x2 2 x1 x0 0.6922 2(0.3678) 1
x0* 0.5821
x1* ( x0* )
*
x1* e x0 e0.5821 0.5587
*
x2* e x1 e0.5587 0.5719
Aitken’s method
2
x
2
*
n 1 xn*
xn** xn*
xn* 2 2 xn*1 xn*
x
2
x0* 0.5587 0.5821
* 2
1
For n = 0, x x **
0
*
0 0.5821 0.5970
x2* 2 x1* x0* 0.5719 2(0.5587) 0.5821
8
x0** 0.5970
Example: Perform two iterations of the linear iteration method followed by one Aitken’s
2
method to find the root of the equation, repeat the process two times in each case, 2 x log10 x 7
Choose x0 4
1 7
We write f ( x) 2 x log10 x 7 as x log10 x ( x )
2 2
1 loge x 7
( x)
2 loge 10 2
1
( x)
2 x log e 10
1 1 1
( x ) 0.05428 1
2 x log e 10 2 x0 log e 10 2(4) log e 10
xn 1 ( xn )
1 7
xn 1 log10 xn , n 0,1, 2, 3.........
2 2
1 7 1 7
x1 log10 x0 log10 (4) 3.8010
2 2 2 2
1 7 1 7
x2 log10 x1 log10 (3.8010) 3.7899
2 2 2 2
Aitken’s method
2
9
xn xn1 xn
2 2
x xn
*
n xn , n 0,1, 2,3,4.......
2 xn xn2 2xn1 xn
x1 x0 3.8010 4
2 2
For n = 0, x x0 4 3.7892
*
0
x2 2x1 x0 3.7899 2(3.8010) 4
x0* 3.7892
x1* ( x0* )
1 7 1 7
x1* log10 x0* log10 (3.7892) 3.7892
2 2 2 2
1 7 1 7
x2* log10 x1* log10 (3.7892) 3.7892
2 2 2 2
Example: Find the smallest root of the equation by linear iteration method
2 3 4
x x x
1 x 0.
2! 3! 4!
2 2 2
x2 x3 x4
x 1
2! 3! 4!
2 2 2
6
Neglecting x and higher powers of x, we get
x2 x3 x4 x5
x 1 ( x)
2! 3! 4! 5!
2 2 2 2
Taking x0 1
xn 1 ( xn )
10
xn2 x n3 x n4 xn5
x n 1 1 , n 0,1, 2, 3.........
2! 3! 4! 5!
2 2 2 2
1 1.3273
2! 3! 4! 5!
2 2 2 2
x 22 x 23 x 24 x 25
x3 1
2! 3! 4! 5!
2 2 2 2
1 1.3807
2! 3! 4! 5!
2 2 2 2
1 1.408
2! 3! 4! 5!
2 2 2 2
x 42 x43 x 44 x 45
x5 1
2! 3! 4! 5!
2 2 2 2
1 1.424
2! 3! 4! 5!
2 2 2 2
1 1.433
2! 3! 4! 5!
2 2 2 2
11
1.433 1.433 1.433 1.433
2 3 4 5
1 1.438 1.44
2! 3! 4! 5!
2 2 2 2
1 1.44
2! 3! 4! 5!
2 2 2 2
x7 x8 1.44
Examples:
1. Perform two iterations of the linear iteration method followed by one Aitken’s method to
2
find the root of the equation, repeat the process two times in each case, f ( x) x 3 3 x 1 .
12
Newton Raphson method [ N-R method]
Let x0 be an approximate value of the root of the equation f ( x) 0 where f ( x) is algebraic and
transcendent. Let h be a number sufficiently small, if x1 x0 h be the exact root of the equation
f ( x) 0 then f ( x1 ) 0 or f ( x0 h) 0 .
h2 h3
f ( x0 h) f ( x0 ) hf ( x0 ) f ( x0 ) f ( x0 ) 0
2! 3!
f ( x0 ) hf ( x0 ) 0
f ( x0 )
h , f ( x0 ) 0
f ( x0 )
f ( x0 )
x1 x0 , f ( x0 ) 0
f ( x0 )
f ( x1 )
x2 x1 , f ( x1 ) 0
f ( x1 )
……………………………
……………………………
f ( xn )
xn1 xn , f ( xn ) 0, n 1,2,3, 4.........
f ( xn )
Let x0 , f ( x0 ) be the point on y f ( x) then the equation of the tangent at the point x0 , f ( x0 ) is
given by
13
y f ( x0 ) f ( x0 ) x x0 this line cuts the X – axis at x x1
f ( x0 ) f ( x0 )
So that x1 x0 x1 x0
f ( x0 ) f ( x0 )
f ( x1 )
x2 x1
f ( x1 )
Let xn be the nth approximation to the root if f ( x) 0 and n be its error then
xn n
(1)
xn 1 n 1
f ( xn )
xn1 xn , f ( xn ) 0 (2)
f ( xn )
f ( n )
n1 n
f ( n )
f ( n )
n1 n
f ( n )
2n 3
f ( ) n f ( ) f ( ) n f ( )
n 1 n 2! 3!
2n
f ( ) n f ( ) f ( )
2!
14
Since x be the root of the equation f ( x) 0 , so we have f ( ) 0
2n 3
n f ( ) f ( ) n f ( )
n 1 n 2! 3!
2n
f ( ) n f ( ) f ( )
2!
3n 2 3
n f ( ) n f ( ) f ( ) n f ( ) n f ( ) n f ( )
2
2! 2! 3!
n 1
n2
f ( ) n f ( ) f ( )
2!
2 2n
n f ( )
2!
n 1
f ( ) 2n f ( )
f ( ) 1 n
f ( ) 2! f ( )
1
2 f ( ) f ( ) 2n f ( )
n 1 n 1 n
2 f ( ) f ( ) 2! f ( )
1 x
1
Using Binomial theorem, we get 1 x x2
2n f ( )
2
f ( ) 2n f ( ) f ( ) 2n f ( )
n 1 1
n
n
2 f ( ) f ( ) 2! f ( ) f ( ) 2! f ( )
2n f ( )
n 1
2 f ( )
n 1 1 f ( )
2n 2 f ( )
15
n1
2
c
n
1 f ( )
Where c is the asymptotic error constant, here p = 2, this shows that the subsequent
2 f ( )
error is proportional to the square of previous error. Hence N-R method has quadratic i.e., second
order rate of convergence.
Example: Using N-R method find the root that lies near x = 4.5 of the equation tan x x correct
to 4 decimal places.
f ( xn )
xn1 xn , n 1,2,3, 4.........
f ( xn )
Given x0 = 4.5,
f (x) tan x x
f ( x ) Sec 2 x 1 tan 2 x
tan xn xn
xn1 xn , n 1,2,3,......
tan 2 xn
Here x2 x3 4.4934 , hence the real root of the given equation tan x x is 4.4934.
16
Example: Find the value of (17)1/3 near x0 2 . Carryout 4 iterations.
x3 17
x3 17 0
Hence f ( x) x 3 17 f ( x ) 3 x 2
f ( xn )
xn1 xn , n 1,2,3, 4.........
f ( xn )
Given x0 = 2,
xn3 17
xn 1 xn , n 1, 2, 3,......
3 xn2
2 xn3 17
xn1
3xn2
2 x 3 17 2 2 17
3
x1 0 2 2.75
3 2
2
3 x0
2 x 3 17 2 2.75 17
3
x2 1 2 2.5826
3 2.75
2
3 x1
2 x 3 17 2 2.5826 17
3
x3 2 2 2.5713
3 2.5826
2
3 x2
2 x 3 17 2 2.5713 17
3
x4 3 2 2.5712
3 2.5713
2
3 x3
17
2 x43 17 2 2.5712 17
3
x5 2.5712
3 2.5712
2
3 x42
1
Example: Find the value of correct up to four decimals.
31
1
Solution: Let x
31
1
31
x
1
31 0
x
1 1
Hence f ( x ) 31 f ( x )
x x2
1
Hence one of the root of the equation f ( x ) 31 lies between (0.03, 0.04)
x
Choose x0 0.03
f ( xn )
xn1 xn , n 1,2,3, 4.........
f ( xn )
1
31
xn
xn 1 xn
1
2
xn
xn 1 xn xn 31xn2
x n 1 2 xn 31x n2
18
x1 2x0 31x02 2(0.03) 31 0.03 0.0321
2
1
Here x3 x4 0.03225 , hence the approximate value of is 0.03225.
31
Solution: Let x 5
x2 5
x2 5 0
Hence f ( x) x 2 5 f ( x) 2x
Choose x0 2
f ( xn )
xn1 xn , n 1,2,3, 4.........
f ( xn )
xn2 5
xn 1 xn
2 xn
2 xn2 xn2 5
xn 1
2 xn
xn2 5
xn 1 , n 1, 2,3,......
2 xn
19
x02 5 2 5
2
x1 2.25
2 x0 2 2
x 2 5 2.25 5
2
x2 1 2.2361
2 x1 2 2.25
x22 5 2.2361 5
2
x3 2.2360
2 x2 2 2.2361
x 2 5 2.2360 5
2
x4 3 2.2360
2 x3 2 2.2360
1
Example: Find the value of using N-R method.
14
1
Solution: Let x
14
1
x2
14
14x2 1 0
Hence f ( x ) 14 x 2 1 f ( x) 28x
Choose x0 0.5
f ( xn )
xn1 xn , n 1,2,3, 4.........
f ( xn )
14 xn2 1
xn 1 xn
28 xn
20
28 xn2 14 xn2 1
xn 1
28 xn
14 xn2 1
xn 1 , n 1, 2,3,......
28 xn
14 x02 1 14 0.5 1
2
x1 0.3214
28x0 28 0.5
14 x12 1 14 0.3214 1
2
x2 0.2718
28x1 28 0.3214
14 x22 1 14 0.2718 1
2
x3 0.2672
28x2 28 0.2718
14 x32 1 14 0.2672 1
2
x4 0.2672
28x3 28 0.2672
1
Here x3 x4 0.2672 , hence the approximate value of is 0.2672.
14
3
Example: Find the value of 24 using N-R method.
Solution: Let x 3 24
x3 24
x3 24 0
Hence f ( x) x3 24 f ( x ) 3 x 2
Choose x0 3
21
f ( xn )
xn1 xn , n 1,2,3, 4.........
f ( xn )
xn3 24
xn 1 xn
3 xn2
3 xn3 xn2 24
xn 1
3 xn2
2 xn3 24
xn 1 , n 1, 2,3,......
3xn2
2 x03 24 2 3 24
3
x1 2.8888
3 3
2
3x02
2 x3 24 2 2.8888 24
3
x2 1 2 2.8845
3 2.8888
2
3 x1
2 x23 24 2 2.8845 24
3
x3 2.8844
3 2.8845
2
3 x22
2 x 3 24 2 2.8844 24
3
x4 3 2 2.8844
3 2.8844
2
3 x3
1
x
30
1/5
1
x5
30
30x5 1 0
22
Hence f ( x ) 30 x 5 1 f ( x) 150 x4
Choose x0 0.5
f ( xn )
xn1 xn , n 1,2,3, 4.........
f ( xn )
30 xn5 1
xn 1 xn
150 xn4
120 xn5 1
xn 1 , n 1, 2, 3,......
28 xn4
x1 0.5066
150 0.5
4
150 x04
x2 0.5064
150 0.5066
4
150 x14
x3 0.5064
150 0.5064
4
150 x24
Example: Find the real root of the equation x 5x 1 0 using N-R method.
3
Solution:
Here f ( x) x3 5x 1 f ( x) 3x 2 5
23
Hence one of the root of the equation f ( x) x3 5x 1 lies between (2, 3)
Choose x0 2
f ( xn )
xn1 xn , n 1,2,3, 4.........
f ( xn )
xn3 5 xn 1
xn 1 xn
3 xn2 5
2 xn3 1
xn 1 , n 1, 2,3,......
3 xn2 5
2 x03 1 2 2 1
3
x1 2 2.1428
3 x0 5 3 2 2 5
2 x 3 1 2 2.1428 1
3
x2 12 2.1285
3 x1 5 3 2.1428 2 5
2 x23 1 2 2.1285 1
3
x3 2 2.1284
3 x2 5 3 2.1285 2 5
2 x 3 1 2 2.1284 1
3
x4 23 2.1284
3 x4 5 3 2.1284 2 5
24
Modified generalized N-R method for multiple roots:
For Example:
f ( x) x 1 ,
3
x 1 is a root of f ( x)
f (1) 1 1 0
3
f ( x) 3 x 1
2
f (1) 3 1 1 0
2
f ( x ) 6 x 1
f ( 1) 6 1 1 0
f (x) 6
f (1) 6 0
f ( xn )
xn1 xn (1)
f ( xn )
xn n , xn 1 n 1
25
Expanding f ( xn ) and f ( xn1 ) by using Taylor’s series, we get
2n 3n
f ( xn ) f ( n ) f ( ) n f ( )
f ( ) f ( )
2! 3!
m1 m m1
n f ( m 1) ( ) n f ( m ) ( ) n f ( m 1) ( )
(m 1)! (m)! (m 1)!
mn ( m) m1
f ( xn ) f ( ) n f ( m1) ( )
(m)! (m 1)!
mn 1 m m1
f ( xn ) f ( n ) f ( m) ( ) n f ( m1) ( ) n f ( m2) ( )
(m 1)! (m)! (m 1)!
mn ( m ) mn 1
f ( ) f ( m1) ( )
(m)! (m 1)!
n1 n m1
n nm ( m1) mn 1
f ( )
( m)
f ( ) f ( m 2)
( )
(m 1)! (m)! (m 1)!
mn ( m ) n
f ( ) f ( m1) ( )
(m)! (m 1)
n1 n m1
n ( m) n ( m1) n 2
f ( ) f ( ) f ( m 2) ( )
(m 1)! m m m 1
n ( m ) n
f ( ) f ( m1) ( )
m (m 1)
n 1 n
(m) n ( m1) n 2
f ( ) f ( ) f ( m 2) ( )
m m m 1
26
2n ( m 1) 3n (m) n
n f ( )
(m)
f ( ) f ( m 2) ( ) n f ( ) f ( m 1) ( )
m m m 1 m (m 1)
n 1
(m) n ( m 1) n2
f ( ) f ( ) f ( m 2) ( )
m m m 1
Since n is small, Ignoring the terms containing 3n and higher powers of n , we get
f ( m) ( ) 1 2 ( m1)
1 n f
m m m(m 1) n
n 1
f ( m1) ( ) 2n f ( m 2) ( )
f ( m) ( ) 1 n ( m)
m f ( ) m m 1 f ( )
( m)
1
1 2 f ( m 1) n f ( m 1) ( ) 2n f ( m 2) ( )
n 1 1 n
n ( m) 1
m m m( m 1) f ( ) m f ( m ) ( ) m m 1 f ( m ) ( )
1 2 f ( m 1)
n 1 1 n n ( m )
m m m( m 1) f ( )
f ( m 1) ( ) 2n f ( m 2) ( ) n f ( m 1) ( ) n2 f ( m 2) ( )
2
1 n
m f ( ) m m 1 f ( ) m f ( ) m m 1 f ( )
(m) (m) (m) (m)
Again neglecting the terms containing 3n and higher powers of n , we get
1 1 2 f ( m 1)
n 1 1 n 1 n ( m )
m m m ( m 1) m m f ( )
f ( m1)
n 1 1 n 2 n2 ( m) (3)
m m (m 1) f ( )
If the modified N-R equation (1) is having quadratic rate of convergence, then the co-efficient of
n must vanish, which gives
1 0
m
1 m
m
27
f ( xn )
xn1 xn m (4)
f ( xn )
f ( m1)
n 1 1 n 2 n2 ( m)
m m (m 1) f ( )
Put m
1 f ( m1)
n1 2n ( m )
m(m 1) f ( )
n 1 1 f ( m 1)
2n m(m 1) f ( m ) ( )
n 1 1 f ( m 1)
c, where c This shows that modified N-R method also a
n
2
m(m 1) f ( m ) ( )
quadratic rate of convergence.
Note 1: Modified N-R method may have linear rate of convergence if m 1 , 1 then from
equation (3) we have
1
n1 1 n , m 1
m
n1 1
1
n m
n 1 1
c , where c 1 , m 1
n m
p = 1 this shows that modified N-R method has linear rate of convergence when m 1(m 1) .
28
Note 2: If the multiplicity of root is not known, then we use the following procedure.
It is known that f ( x) 0 has a root of order m, then f ( x) 0 has the same root of order (m – 1),
f ( x)
hence g ( x) has a simple root (of order 1) .
f ( x)
f ( x) f ( x ) f ( x) f ( x)
and g ( x)
f ( x)
2
g( xn )
xn1 xn
g( xn )
f ( xn )
f ( x n )
x n 1 xn
f ( xn ) f ( xn ) f ( xn ) f ( xn )
f ( xn )
2
f ( xn ) f ( xn )
xn 1 xn (5)
f ( xn )
2
f ( xn ) f ( xn )
Generalized N-R method for multiple roots when multiplicity is unknown also has a quadratic rate
of convergence.
Solution:
(i)N-R Method
Here f ( x ) x 3 3 x 2 4 f ( x ) 3 x 2 6 x
Given x0 1.5
29
For the N-R method we have
f ( xn )
xn1 xn , n 1,2,3, 4.........
f ( xn )
xn3 3xn2 4
xn 1 xn , n 1, 2,3,......
3 xn2 6 xn
30
f ( x) f ( x)
xn 1 xn
f ( x)
2
f ( x) f ( x)
Here f ( x ) x 3 3 x 2 4
f ( x ) 3 x 2 6 x
f ( x) 6x 6
Given x0 1.5
3 xn4 36 xn2 48 xn
xn 1
3 xn4 12 xn3 18 xn2 24 xn 24
xn4 12 xn2 16 xn
xn 1 , n 0,1, 2,3........
xn4 4 xn3 6 xn2 8 xn 8
31
(iii)Modified N-R method for m = 2.
f ( xn )
xn1 xn m , n 1, 2,3, 4.........
f ( xn )
x3 3x 2 4
x n 1 x n 2 n 2 n
3 xn 6 xn
2 x33 6 x32 8 2 2 3 6 2 2 8
x4 x3 2 2
3 x32 6 x3 3 2 2 6 2
1 x
Example: Show that 1 xe 0 has a double root at x = 1, obtain the approximate root by using
modified N-R method, taking x0 0 .
f ( xn )
xn1 xn m , n 1, 2,3, 4.........
f ( xn )
Here f ( x ) 1 xe1 x
32
Given x0 0
2 1 xn e1 xn
xn1 xn
xn 1 e1x n
2 1 x0e1 x0 2 1 0e10
x1 x0 0 0.73576
x0 1 e1x0 0 1 e10
1 x
Here x4 x5 0.99999 , hence the approximate root of 1 xe 0 is 0.99999.
Example: Show that x 7x 16x 12 0 has a double root at x = 2, starting with initial
3 2
approximation x0 1 find the approximate root by using modified N-R method, correct to three
decimal places.
f ( xn )
xn1 xn m , n 1, 2,3, 4.........
f ( xn )
Here f ( x) x3 7 x 2 16 x 12
f ( x ) 3 x 2 14 x 16
f ( x) 6x 14
33
Hence x = 2 is a double root of f(x).
Given x0 1
Example: Find the multiple root of 27x 27x 36x 28x 9x 1 0 starting with initial
5 4 3 2
approximation x0 0 .
f ( x) f ( x)
xn 1 xn
f ( x)
2
f ( x) f ( x)
Here f ( x) 27 x5 27 x 4 36 x3 28 x 2 9 x 1
Given x0 0
(27 xn5 27 xn4 36xn3 28xn2 9xn 1)(135xn4 108xn3 108xn2 56xn 9)
xn1 xn
135x 108xn3 108xn2 56xn 9 (27 xn 27 xn 36xn 28xn 9xn 1)(540xn 324xn 216xn 56)
4 2
5 4 3 2 3 2
n
34
At x = 0
f (0) 1
f (0) 9
f (0) 56
f (0.36) 0.00057
f (0.36) 0.06543
f (0.36) 4.96384
f ( x1 ) f ( x1 ) f (0.36) f (0.36)
x2 x1 0.36
f ( x1 ) f (0.36) f (0.36) f (0.36)
2 2
f ( x1 ) f ( x1 )
(0.00057)(0.06543)
0.36 0.3343
(0.06543) 2 ( 0.00057)( 4.96384)
f (0.3343) 0.0000000271
f (0.3343) 32.0694
f (0.3.43) 0.1742
f ( x2 ) f ( x2 ) f (0.3343) f (0.3343)
x3 x2 0.3343
f ( x2 ) f (0.3343) f (0.3343) f (0.3343)
2 2
f ( x2 ) f ( x2 )
(0.0000000271)( 32.0694)
0.3343 0.33429
(32.0694) 2 (0.0000000271)( 0.1742)
Here x2 x3 0.3342 , hence the approximate root of 27x 27x 36x 28x 9x 1 0 is -
5 4 3 2
0.3342.
35
Bairstow’s Method: This method is used in determining a quadratic factor of a polynomial.
p ( x ) x 2 x 1 x 1 2 x 3
p ( x) x 2 x 2 x 2 1 6 x 1
Bairstow’s method extracts a quadratic factor of the form x 2 px q from the polynomial
This p n ( x ) x 2 px q Q n 2 ( x ) Rx S
Where Qn 2 ( x ) b0 x n 2 b1 x n 3 b2 x n 4 bn 3 x bn 2
Let p 0 and q0 be the initial approximation, with these p 0 and q0 we find the improved value
(corrected value or corrections) as p1 p0 p , q1 q0 q
bn cn 3 bn 1cn 2
Where p
c cn 3 c n 1 bn 1
2
n2
b c b bncn2
q n21 n1 n1
cn2 cn3 cn1 bn1
a0 a1 a2 a3 an 1 an
p0 0 p0b0 p0b1 p0b2 p0bn 2 p0bn 1
q0 0 0 q0b0 q0b1 q0bn 3 q0bn 2
b0 b1 b2 b3 bn 1 bn
p0 0 p0 c0 p0 c1 p0 c2 p0 cn 2 p0 cn 1
q0 0 0 q0 c0 q0c1 q0 cn 3 q0 cn 2
c0 c1 c2 c3 cn 1 cn
36
Example: Perform two iterations of Bairstow’s method to obtain quadratic factor from the
polynomial x x x 2 0 , with initial approximation p0 0.9, q0 0.9 .
3 2
First iteration:
1 1 1 2
p0 0.9 0 0.9 1.71 1.71
q0 0.9 0 0 0.9 1.71
1 1.9 0.19 0.119
b0 b1 b2 b3
p0 0.9 0 0.9 2.52 1.287
q0 0.9 0 0 0.9 2.5
1 2.8 1.43 1.114
c0 c1 c2 c3
Consider
b c bn 1cn 2
p 2 n n 3
c
n2 c n 3 n 1
c bn 1
b c b bncn2
q n21 n1 n1
cn2 cn3 cn1 bn1
Put n = 3
b c b2 c1
p 2 3 0
c1 c0 c2 b2
b c b2 b3c1
q 2 2 2
c1 c0 c2 b2
37
p1 p0 p 0.9 0.1047 1.0047 ,
Second iteration:
1 1 1 2
p1 1.0047 0 1.0047 2.0141 0.01105
q1 1.0031 0 0 1.0031 2.0109
1 2.0047 0.011 0.00013
b0 b1 b2 b3
p1 1.0047 0 1.0047 3.0235 2.0409
q1 1.0031 0 0 1.0031 3.0187
1 3.0094 2.0314 0.9776
c0 c1 c2 c3
b c b2 c1
p 2 3 0
c1 c0 c2 b2
b c b2 b3c1
q 2 2 2
c1 c0 c2 b2
q2 q1 q 1.0031 0.0031 1
38
x2
x2 x 1 x3 x 2 x 2
x3 x 2 x
( ) ( ) ( )
2 x2 2x 2
2 x2 2x 2
( ) ( ) ( )
0
Hence x 3 x 2 x 2 x 2 x 1 x 2
Example: Perform two iterations of Bairstow’s method to obtain quadratic factor from the
polynomial x x 2x x 1 0 , with initial approximation p0 0.5, q0 0.5 .
4 3 2
First iteration:
1 1 2 1 1
p0 0.5 0 0.5 0.25 0.625 0.0625
q0 0.5 0 0 0.5 0.25 0.625
1 0.5 1.25 0.125 0.3125
b0 b1 b2 b3 b4
p0 0.5 0 0.5 0 0.375 0.125
q0 0.5 0 0 0.5 0 0.375
1 0 0.75 0.25 0.0625
c0 c1 c2 c3 c4
Consider
b c bn 1cn 2 b c b bncn2
p 2 n n 3 q n21 n1 n1
cn 2 cn 3 c n 1 bn 1 cn2 cn3 cn1 bn1
Put n = 4
39
b c b c
p 2 4 1 3 2
c2 c1 c3 b3
b c b b4c2
q 3 2 3 3
c2 c1 c3 b3
q1 q0 q 0.5 0.5 1
Second iteration:
1 1 2 1 1
p1 0.67 0 0.67 0.23 0.52 0.099
q1 1 0 0 1 0.33 0.778
1 0.33 0.77 0.148 0.123
b0 b1 b2 b3 b4
p1 0.67 0 0.67 0.227 0 0.32
q1 1 0 0 1 0.34 0
1 0.34 0 0.48 0.21
c0 c1 c2 c3 c4
b c b c
p 2 4 1 3 2
c2 c1 c3 b3
b c b b4c2
q 3 2 3 3
c2 c1 c3 b3
40
0.44 0.75 0.44 0.77 0.45
q 0.32
0.45 0.34 0.78 0.44
2
q2 q1 q 1 0.32 0.68 1
x2 1
x2 x 1 x 4 x3 2 x2 x 1
x 4 x3 x 2
( ) ( ) ( )
x2 x 1
x2 x 2
( ) () ( )
0
Hence x 4 x 3 2 x 2 x 1 x 2 x 1 x 2 1
Example: Perform two iterations of Bairstow’s method to obtain quadratic factor from the
polynomial x 8x 39x 62x 50 0 , with initial approximation p0 1.5, q0 1.5 .
4 3 2
1 8 39 62 50
p0 1.5 0 1.5 9.75 41.1625 15.9375
q0 1.5 0 0 1.5 9.75 41.625
1 6.5 27.75 10.625 7.5625
b0 b1 b2 b3 b4
p0 1.5 0 1.5 7.5 28.125 37.5
q0 1.5 0 0 1.5 7.5 28.125
1 5 18.75 25 1.8125
c0 c1 c2 c3 c4
41
Consider
b c bn 1cn 2
p 2 n n 3
cn 2 cn 3 c n 1 bn 1
b c b bncn2
q n21 n1 n1
cn2 cn3 cn1 bn1
Put n = 4
b c b c
p 2 4 1 3 2
c2 c1 c3 b3
b c b b4c2
q 3 2 3 3
c2 c1 c3 b3
Second iteration:
1 8 39 62 50
p1 2 0 2 12 78 56
q1 2 0 0 12 12 78
1 6 39 28 28
b0 b1 b2 b3 b4
p1 2 0 2 8 90 252
q1 2 0 0 2 8 90
1 4 45 126 190
c0 c1 c2 c3 c4
42
b c b c
p 2 4 1 3 2
c2 c1 c3 b3
28 4 28 45
p 0.567
45 4 126 28
2
b c b b4c2
q 3 2 3 3
c2 c1 c3 b3
28 126 28 28 45
q 0.6139
45 4 126 28
2
p2 p1 p 2 0.567 2.567 2 ,
q2 q1 q 2 0.6139 1.3861 2
x2 2x 2 .
x 2 6 x 25
x2 2 x 2 x 4 8 x3 39 x 2 62 x 50
x 4 2 x3 2 x 2
( ) ( ) ( )
6 x 3 37 x 2 62 x
6 x 3 12 x 2 12 x
( ) ( ) ( )
25 x 2 50 x 50
25 x 2 50 x 50
( ) () (1)
0
Hence x 4 8 x 3 39 x 2 62 x 50 x 2 2 x 2 x 2 6 x 25
43
Solution of system of linear algebraic equation:
Simultaneous linear equations is quite often in engineering and science. The analysis of electronic
circuit, analysis of a network under sinusoidal, study state condition, determination of output of a
chemical plant (or) some of the problem which depend on the solution of simultaneous linear
algebraic equations. The solution of such equations can be obtained by direct method (or) iterative
method.
Direct Method: This method produces exact solution after a finite number of steps.
Iterative Method: This method gives a sequence of approximate solution which converges when
large number of iterations are performed.
Direct Method:
In Gauss elimination method the unknowns are eliminated successively and the system is reduced
to an upper triangular system, from which the unknowns are found by back substitution.
This method is quite general and is well adopted computer for operations.
44
Reduce the augmented matrix into triangular matrix using row operations
x2 a23
a22 x3 b2
x3 b2
a33
, a33
Note: 1) The elements a11 , a22 are called Pivot elements.
, a33
2) This method fails if one of the pivot elements a11 , a22 is zero. In this case the equations are
arranged properly.
Example: Solve the following system of equations using Gauss elimination method
x + y + z = 6, x – y + 2z = 5, 3x + y + z =8
Solution:
x + y + z = 6, x – y + 2z = 5, 3x + y + z =8 (1)
1 1 1 : 6
A : B 1 1 2 : 5
3 1 1 : 8
1 1 1 : 6
A : B 0 2 1 : 1
0 2 2 : 10
45
Operating, R3 R3 R2
1 1 1 : 6
A : B 0 2 1 : 1
0 0 3 : 9
x+y+z=6 (2)
-2y + z = -1 (3)
-3z = -9 (4)
From (4)
-3z = -9
z = -9/-3
z=3
From (3)
-2y + z = -1
-2y + 3 = -1
-2y = -4
y=2
From (2)
x+2+3=6
x=1
46
Example: Solve Using Gauss elimination method 3x y 2z 3 , 2x 3y z 3, x 2y z 4
Solution: The given system of equation is
3x y 2z 3 , 2x 3y z 3, x 2y z 4 . (1)
3 1 2 : 3
A : B 2 3 1 : 3
1 2 1 : 4
3 1 2 : 3
A : B 0 11 7 : 15
0 5 1 : 9
3 1 2 : 3
A : B 0 11 7 : 15
0 0 24 : 24
3x y 2z 3 (2)
24 z 24 (4)
From (4)
2 4 z 24 z 1
From (3)
11y 22 y 2
47
From (2)
3x 2 2 1 3
3x 3 x 1
2x 2 y 4z 7 , 2x y z 7 , x 3y 5z 2 (1)
2 2 4 : 7
A : B 2 1 1 : 7
1 3 5 : 2
2 2 4 7:
A : B 0 1 3 : 0
0 4 6 : 3
Operating, R3 R3 4 R2
2 2 4 7:
A : B 0 1 3 : 0
0 0 6 : 3
2x 2 y 4z 7 (2)
y 3z 0 (3)
6 z 3 (4)
48
From (4)
1
6 z 3 z
2
From (3)
3
y 3 0 y
1
2 2
From (2)
2 x 2 4 7
3 1
2 2
2x 3 2 7 2x 8 x 4
3 1
Hence the solution of the given system is x 4, y , z .
2 2
49
Pivoting:
, a33
In the elimination process, if any one of the pivot elements a11 , a22 vanishes (or) becomes very
small compared to other elements in that column, then we attempt to rearrange the remaining rows,
so as to obtain a non-vanishing pivot (or) to avoid multiplication by a large number. This process
is called pivoting.
(i)Partial pivoting
Partial Pivoting:
In the first stage of elimination, the first column is searched for largest element in magnitude and
brought as the first pivot by interchanging the first equation with the equation having the largest
element in magnitude.
In the second stage of elimination, the second column is searched for the largest element in
magnitude among the (n – 1) elements leaving the first element and this element is brought as
second pivot by interchanging of the second equation with the equation having the largest in
magnitude. This process is continued until we arrive at equation the single variable. This modified
procedure is called partial pivot.
Complete Pivoting:
We search the matrix for the largest element in magnitude and bring it as the first pivot, this
requires not only interchanging of equations but also interchanging of the position of the variables.
This method of elimination is called complete pivoting.
1 1 1 : 6
A : B 3 3 4 : 20
2 1 3 : 13
Since in C1 3 is the largest number, interchanging first and second row, we get
Operating, R1 R2
50
3 3 4 : 20
A : B 1 1 1 : 6
2 1 3 : 13
3 3 4 : 20
A : B 0 0 1 : 2
0 3 1 : 1
Operating, R2 R3
3 3 4 : 20
A : B 0 3 1 : 1
0 0 1 : 2
3 x1 3 x2 4 x3 20 (2)
3 x2 x3 1 (3)
x3 2 (4)
From (4) x3 2 x3 2
3 x2 3 x2 1
3x1 9 x1 3
51
Example: Solve by Gauss elimination method using Partial pivoting method.
x1 4 x2 2 x3 4 , 3x1 2 x2 4 x3 6 , 4 x1 x2 x3 4 ,
1 4 2 : 4
A : B 3 2 4 : 6
4 1 1 : 4
Since in C1 , 4 is the largest number, interchanging first and third row, we get
Operating, R1 R3
4 1 1 : 4
A : B 3 2 4 : 6
1 4 2 : 4
4 1 1 : 4
A : B 0 5 19 : 12
0 15 9 : 12
Operating, R2 R3
4 1 1 : 4
A : B 0 15 9 : 12
0 5 19 : 12
4 1 1 : 4
A : B 0 15 9 : 12
0 0 240 : 120
4 x1 x2 x3 4 (2)
15 x2 9 x3 12 (3)
52
240 x3 120 (4)
1
From (4) 240 x3 120 x3
2
From (3) 15 x 2 9 1 12
2
9 15
15 x2 12
2 2
15 1
15 x2 x2
2 2
From (2) 4 x1 1 1 4
2 2
4 x1 4 x1 1
1 1
Hence the solution of the given system is x1 1, x2 , x3
2 2
x1 x2 x3 2 , 2 x1 3 x2 3 x3 3 , 3 x1 2 x2 3 x3 6 ,
1 1 1 : 2
A : B 2 3 5 : 3
3 2 3 : 6
Since in C1 , 3 is the largest number, interchanging first and third row, we get
Operating, R1 R3
3 2 3 : 6
A : B 2 3 5 : 3
1 1 1 : 2
53
3 2 3 : 6
A : B 0 5 21 : 3
0 1 0 : 0
Operating R3 5 R3 R2
3 2 3 : 6
A : B 0 5 21 : 3
0 0 21 : 3
3 x1 2 x2 3 x3 6 (2)
5 x2 21x3 3 (3)
21x3 3 (4)
1
From (4) 21x3 3 x3
7
1
From (3) 5x2 21 3
7
5 x2 3 3 5 x2 0 x2 0
1
From (2) 3x1 2 0 3 6
7
3
3 x1 6
7
39 13
3 x1 x1
7 7
13 1
Hence the solution of the given system is x1 , x2 0, x3
7 7
54
Example: Solve by Gauss elimination method using Partial pivoting method.
2 x1 x2 x3 2 x4 10 , 4 x1 2 x3 x4 8 , 3x1 2 x2 2 x3 7 , x1 3 x2 2 x3 x4 5
2 1 1 2 : 10
4 0 2 1 : 8
A : B
3 2 2 0 : 7
1 3 2 1 : 5
Since in C1 , 4 is the largest number, interchanging first and third row, we get
Operating, R1 R2
4 0 2 18 :
2 1 1 2 : 10
A : B
3 2 2 0 : 7
1 3 2 1 : 5
4 0 2 1 8 :
0 2 0 5 : 28
A : B
0 8 2 3 : 4
0 12 6 5 : 28
Operating, R2 R4
4 0 2 1 : 8
0 12 6 5 : 28
A : B
0 8 2 3 : 4
0 2 0 5 : 28
4 0 2 1 : 8
0 12 6 5 : 28
A : B
0 0 24 4 : 272
0 0 12 50 : 280
55
Operating R4 2 R4 R3
4 0 2 1 : 8
0 12 6 5 : 28
A : B
0 0 24 4 : 272
0 0 0 104 : 832
4 x1 2 x3 x4 8 (2)
12 x2 6 x3 5 x4 28 (3)
12 x2 28 100
12 x2 72 x2 6
4 x1 20 x1 5
56
Example: Solve by Gauss elimination method using Partial pivoting method.
13 x1 5 x2 3 x3 x4 18 , 2 x1 12 x2 x3 4 x4 13 , x1 4 x2 10 x3 x4 29 ,
2 x1 x2 3x3 9 x4 31
13 5 3 1 : 18
2 12 1 4 : 13
A : B
1 4 10 1 : 29
2 1 3 9 : 31
13 5 3 1 : 18
0 146 19 54 : 133
A : B
0 57 133 12 : 359
0 3 33 115 : 367
13 5 3 1 : 18
0 146 19 54 : 133
A : B
0 0 20501 1326 : 59995
0 0 4875 16952 : 53183
Operating, R3 R4
13 5 3 1 : 18
0 146 19 54 : 133
A : B
0 0 4875 16952 : 53183
0 0 20501 1326 : 59995
13 5 3 1 : 18
0 146 19 54 : 133
A : B
0 0 4875 16952 : 53183
0 0 0 341068702 : 1382785183
57
The reduced form of the given system (1) is
13 x1 5 x2 3 x3 x4 18 (2)
1382785183
From (5) 341068702 x4 1382785183 x4 4.05
341068702
Hence the solution of the given system is x1 0.93, x2 2.25, x3 3.17, x4 4.05
58
LU Decomposition (or) Factorization Method:
AX B (2)
where
In this method the coefficient matrix A of the system (1) is decomposed (or) factorized in to the
product of lower triangular matrix (L) and upper triangular matrix (U).
We write A L U (3)
where
to produce unique solution it is convenient to choose either uii 1 (or) lii 1 , i 1,2,3,..........n .
59
when we choose
(LU ) X B (4)
UX Z LZ B
1
and X U Z .
A1 LU 1
A1 U 1L1
LU-Factorization method/ LU- Decomposition method:
Let AX = B be the system of n linear equations in n unknowns. In this method we decompose the
square matrix in to product of lower triangular matrix L and upper triangular matrix U.
i.e. A = LU
AX = B (LU)X = B
L(UX) = B
z1
z
2
Let UX = Z where Z .
.
z n
Then LZ = B
60
i.e. z1, z2, z3……… zn
Then from UX = Z with known Z we get X (x1, x2, x3……….xn) with back substitution.
l11u12 1 l11u13 1
l11 1
u12 1 u13 1
1 1 1 1 0 0 1 1 1
A 4 3 1 4 1 0 0 1 5
3 5 3 3 2 10 0 0 1
x1 0
AX = B where X x2 and B 3
x3 2
(LU)X = B
L(UX) = B
61
z1
Put UX = Z where Z z 2
z 3
LZ = B
1 0 0 z1 1
4 1 0 z 2 6
3 2 10 z3 4
z1 1 (1)
4 z1 z 2 6 (2)
3 z1 2 z 2 10 z3 4 (3)
From (1) z1 1
1
10 z3 5 z3
2
1
z1 1, z2 2, z3
2
Now consider
UX Z
1 1 1 x1 1
0 1 5 x 2
2
0 0 1 x3 1 / 2
x1 x2 x3 1 (4)
x2 5 x3 2 (5)
1
x3 (6)
2
62
1
From (6) x3
2
From(5) x2 5 1 2
2
5 1 1
x2 2 x2
2 2 2
From (4) x1 1 1 1 x1 1
2 2
1 1
Hence the solution of the given system is x1 1, x2 , x3
2 2
63
2 3 1 1 0 0 2 3 1
1 2 3 1/ 2 1 0 0 1/ 2 5 / 2
3 1 2 3 / 2 7 1 0 0 18
x 9
AX =B where X y and B 6
z 8
(LU)X =B
L(UX) =B
z1
Put UX=Z where Z z 2
z 3
LZ = B
1 0 0 z1 9
1/ 2 1 0 z 6
2
3 / 2 7 1 z3 8
z1 = 9
1/2z1 + z2 = 6
3/2z1-7z2+z3=8
z1 = 9, z2 = 3/2, z3 = 5
Now consider
UX = Z
2 3 1 x 9
0 1/ 2 5 / 2 y 3 / 2
0 0 18 z 5
2x+3y+z=9
64
18z = 5
Solution:
l11u12 2 l11u13 1
l11 1
u12 2 u13 1
1 2 1 1 0 0 1 2 1
2 2 3 2 2 0 0 1 1/ 2
1 3 0 1 1 1/ 2 0 0 1
x1 0
AX =B where X x2 and B 3
x3 2
(LU)X =B
65
L(UX) =B
z1
Put UX=Z where Z z 2
z 3
LZ = B
1 0 0 z1 0
2 2 0 z 3
2
1 1 1/ 2 z3 2
z1 = 0
2z1 – 2z2 = 3
-z1-z2-(1/2)z3=3
z1 = 0, z2 = -3/2, z3 = 1
Now consider
UX = Z
1 2 1 x1 0
0 1 1/ 2 x 3 / 2
2
0 0 1 x3 1
x1+2x2+x3=0
x2+(-1/2)x3= -3/2
x3 = 1
66
Example: Solve the system of equations using Dolittle’s method x + 3y = 1, 2x + y = 2,
3x + 4y + z = 0.
Solution:
1 3 0 1 0 0 1 3 0
2 1 0 2 1 0 0 5 0
3 4 1 3 1 1 0 0 1
x 1
AX =B where X y and B 2
z 0
(LU)X =B
L(UX) =B
z1
Put UX=Z where Z z 2
z 3
67
LZ = B
1 0 0 z1 1
2 1 0 z 2
2
3 1 1 z3 0
z1 = 1
2z1 + z2 = 2
3z1+z2+z3=0
z1 = 1, z2 = 0, z3 = -3
Now consider
UX = Z
1 3 0 x 1
0 5 0 y 0
0 0 1 z 3
x+3y=1
-5y = 0
z = -3
68
Equating L.H.S and R.H.S. we get
l11u12 3 l11u13 2
l11 2 2u12 3 2u13 2
u12 3/ 2 u13 1
x1 2
AX =B where X x2 and B 16
x3 6
(LU)X =B
L(UX) =B
z1
Put UX=Z where Z z 2
z 3
LZ = B
2 0 0 z1 2
10 12 0 z 2 16
3 3 / 2 11/ 4 z3 6
2z1 = 2
10z1 –12z2 = 16
3z1+(3/2)z2-(11/4)z3=-6
69
Solving above equations we get
z1 = 1, z2 = -1/2, z3 = 3
Now consider
UX = Z
1 3 / 2 1 x1 1
0 1 1/ 2 x2 1/ 2
0 0 1 x3 3
x1+(3/2)x2+x3=1
x2+(1/2)x3= -1/2
x3 = 3
Example: Solve the system of equations using Crout’s method x + 2y + 3z =1, 2x + 3y + 8z =2,
x + y + z = 3.
Solution:
l11u12 2 l11u13 3
l11 1
u12 2 u13 3
70
l31u12 l32 1 l31u13 l32 u23 l33 1
l31 1 (1)(2) l32 1 (1)(3) (1)(2) l33 1
l32 1 l33 4
1 2 3 1 0 0 1 2 3
2 3 8 2 1 0 0 1 2
1 1 1 1 1 4 0 0 1
x 1
AX =B where X y and B 2
z 3
(LU)X =B
L(UX) =B
z1
Put UX=Z where Z z 2
z 3
LZ = B
1 0 0 z1 1
2 1 0 z 2
2
1 1 4 z3 3
z1 = 1
2z1 – z2 = 2
z1 - z2 - 4z3=3
z1 = 1, z2 = 0, z3 = - 1/2
Now consider
UX = Z
1 2 3 x 1
0 1 2 y 0
0 0 1 z 1/ 2
71
x + 2y + 3z = 1
y – 2z = 0
z = -1/2
Example: Solve the system of equations using Crout’s method 4x 1 + x2 + x3 = 4, x1-3x2 -2x3 = 4,
3x1+2x2-4x3 = 6.
Solution:
l11u12 1 l11u13 1
l11 4 4u12 1 4u13 1
u12 1/ 4 u13 1/ 4
4 1 1 4 0 0 1 1/ 4 1/ 4
1 3 2 1 13 / 4 0 0 1 9 /13
3 2 4 3 5 / 4 73 /13 0 0 1
72
x1 4
AX =B where X x2 and B 4
x3 6
(LU)X =B
L(UX) =B
z1
Put UX=Z where Z z 2
z 3
LZ = B
4 0 0 z1 4
1 13 / 4 0 z 2 4
3 5/4 73 /13 z3 6
4z1 = 4
z1 –(13/4)z2 = 4
3z1+(5/4)z2-(73/13)z3=6
z1 = 1, z2 = -12/13, z3 = -54/73
Now consider
UX = Z
1 1/ 4 1/ 4 x1 1
0 1 9 /13 x 12 /13
2
0 0 1 x3 54 / 73
x1+(1/4)x2+(1/4)x3=1
x2+(9/13)x3= -12/13
x3= -54/73
73
Example: Solve the system of equations using Dolittle’s method x y z 1 , 3 x y 3 z 5 ,
x 2 y 5 z 10 .
1 1 1 1 0 0 1 1 1
3 1 3 3 1 0 0 2 6
1 2 5 1 3 / 2 1 0 0 3
x 1
AX =B where X y and B 5
z 10
(LU)X =B
L(UX) =B
74
z1
Put UX=Z where Z z 2
z 3
LZ = B
1 0 0 z1 1
3 1 0 z 2 5
1 3 / 2 1 z3 10
z1 = 1
3z1 + z2 = 5
z1+(3/2)z2+z3=10
z1 = 1, z2 = 2, z3 = 6
Now consider
UX = Z
1 1 1 x 1
0 2 6 y 2
0 0 3 z 6
x + y + z =1
-2y-6z = 2
3z = 6
75
Example: Solve the system of equations using Dolittle’s method
6x1-2x2 -4x3+4x4 = 2, 3x1-3x2 -6x3+x4= -4, -12x1+8x2 +21x3-8x4 = 8 , -6x1-10x3 +7x4 = 43.
Solution:
u11l21 3 u12 l21 u22 3 u13 l21 u23 6 u14 l21 u24 1
(6)l21 3 ( 2)(1/ 2) u22 3 (4)(1/ 2) u23 6 (4)(1/ 2) u24 1
l21 1/ 2 u 22 2 u23 4 u24 1
u11l31 12 u12 l31 u22 l32 8 u13l31 u23l32 u33 21 u14 l31 u24 l32 u34 8
(6)l31 12 (2)(2) (2)l32 8 (4)(2) (4)(2) u33 21 (4)(2) (1)(2) u34 8
l31 2 l32 2 u33 5 u34 2
u11l41 6
u12 l41 u22 l42 0 u13l41 u23l42 u33l43 10 u14 l41 u24 l42 u34 l43 u 44 7
(6)l41 6 (2)(1) (2)l42 0 (4)(1) (4)(1) (5)l43 10 (4)( 1) ( 1)(1) ( 2)( 2) u 44 7
l41 1 l42 1 l43 2 u44 8
6 2 4 4 1 0 0 0 6 2 4 4
3 3 6 1 1/ 2 1 0 0 0 2 4 1
A
12 8 21 8 2 2 1 0 0 0 5 2
6 0 10 7 1 1 2 1 0 0 0 8
x1 2
x 4
AX =B where X 2
and B
x3 8
x4 43
76
(LU)X =B
L(UX) =B
z1
Put UX=Z where Z z 2
z3
z4
LZ = B
1 0 0 0 z1 2
1/ 2 1
0 0 z 2 4
2 2 1 0 z3 8
1 1 2 1 z 4 43
z1 = 2
(1/2)z1 + z2 = -4
-2z1 - 2z2+z3=8
-z1 +z2-2z3+z4=43
z1 = 2, z2 = -5, z3 = 2, z4=54
Now consider
UX = Z
6 2 4 4 x1 2
0 2 4 1 x 5
2
0 0 5 2 x3 2
0 0 0 8 x4 54
6x1-2x2-4x3+4x4=2
-2x2-4x3-x4=-5
5x3-2x4=2
8x4=54
77
Solving above equations we get
Examples:
3 2 1
Example: Find the inverse of the matrix A 2 3 2 using LU decomposition method,
1 2 2
taking uii 1 .
Solution:
l11u12 2 l11u13 1
l11 3 3u12 2 3u13 1
2 1
u12 u13
3 3
78
l21u12 l22 3 l21u13 l22u23 2
2 1 5
(2) l22 3 (2) u23 2
3 3 3
l21 2 4 5 2 4
l22 3 u23 2
3 3 3 3
5 4
l22 u23
3 5
l31u12 l32 2 l31u13 l32u23 l33 2
2 1 4 4
(1) l32 2 (1) l33 2
3 3 3 5
l31 1 2 1 8
l32 2 l33 2
3 3 15
4 3
l32 l33
3 5
3 2 1 3 0 0 1 2 / 3 1 / 3
A 2 3 2 2 5 / 3 0 0 1 4 / 5
1 2 2 1 4 / 3 3 / 5 0 0 1
3 0 0 1 2 / 3 1 / 3
L 2 5 / 3 0
U 0 1 4 / 5
1 4 / 3 3 / 5 0 0 1
1/ 3 0 0 1 2 / 3 1 / 5
L1 2 / 5 3 / 5 0 U 1 0 1 4 / 5
1/ 3 4 / 3 5 / 3 0 0 1
A1 U 1L1
1 2 / 3 1 / 5 1 / 3 0 0
1
A 0 1
4 / 5 2 / 5 3 / 5 0
0 0 1 1 / 3 4 / 3 5 / 3
79
2 / 3 2 / 3 1 / 3 3 2 1
A 2 / 3 5 / 3 4 / 3 A 2 3 2
1
1/ 3 4 / 3 5 / 3 1 2 2
Example: Show that LU decomposition method fails to solve the system of equation
x y z 2 , 2x 2 y 5z 3 , 3x 2 y 3z 6
Solution:
x y z 2 , 2x 2 y 5z 3 , 3x 2 y 3z 6 (1)
Taking lii 1
Therefore, LU decomposition method as the pivot u22 0 fails to solve the system of equation
(1).
Taking uii 1
80
1 1 1 l11 0 0 1 u12 u13
A 2 2 5 l21 l22 0 0 1 u 23
3 2 3 l31 l32 l33 0 0 1
l11u12 1 l11u13 1
l11 1 1u12 1 1u13 1
u12 1 u13 1
Therefore, LU decomposition method as the pivot l22 0 fails to solve the system of equation
(1).
Note: We note that the matrix A is not a positive definite and hence the LU decomposition is not
guaranteed.
If A is any n×n matrix, let (r)A denote the r×r submatrix in the upper left corner of A; that is, (r)A
is the matrix obtained from A by deleting the last n−r rows and columns. The matrices (1)A, (2)A,
(3)
A, ..., (n)A = A are called the principal submatrices of A.
A square matrix is called positive definite if it is symmetric and all its eigenvalues λ are positive,
that is λ > 0.
1. A is positive definite.
3. A = UTU where U is an upper triangular matrix with positive entries on the main diagonal.
81
1 1 1
Example: If A 2 2 5
3 2 3
1 1 0
1 1
22 0
2 2
1 1 1
2 2 5 30
3 2 3
Note:
82
Cholesky Method:
This method is also known as square root method. In this method if the coefficient matrix A is
symmetric and positive definite then matrix A can be decomposed as
A LLT (1)
A UU T (2)
LLT X B (3)
LZ B (4)
Where LT X Z (5)
The values zi , i 1, 2, 3, 4..... are obtained from equation (4) by forward substitution method, and
the values xi , i 1, 2,3, 4..... are obtained from equation (5) by back substitution method.
1
Alternatively, we can find only one inverse L and obtain
Z L1 B
X LT Z
1
X L 1 Z
T
1 2 3 x1 5
where A 2
8 22 , X x2 , B 6
3 22 82 x3 10
83
1 2 3 l11 0 0 l11 l21 l31
A 2 8 22 l21 l22 0 0 l22 l32
3 22 82 l31 l32 l33 0 0 l33
1 2 3 l11 l11l31
2
l11l21
A 2 8 22 l21l11 l21 l22
2 2
l21l31 l22l32
3 22 82 l31l11 l31l21 l32l22 l312 l322 l332
l11l21 2 l11l31 3
l112 1 l11 1 1l21 2 1l31 3
l21 2 l31 3
1 0 0 1 2 3
L 2 2 0 LT 0 2 8
3 8 3 0 0 3
Consider,
LZ B
1 0 0 z1 5
2 2 0 z 6
2
3 8 3 z3 10
z1 5 (2)
2 z1 2 z 2 6 (3)
3 z1 8 z2 3 z3 10 (4)
From (2) z1 5
84
2 z2 4 z2 2
3 z3 9 z3 3
Now consider,
LT X Z
1 2 3 x1 5
0 2 8 x2 2
0 0 3 x3 3
x1 2 x2 3 x3 5 (5)
2 x2 8 x3 2 (6)
3x3 3 (7)
From (7) x3 1
2 x2 6 x2 3
x1 2
85
Solution of Tri-diagonal System of Equations (or) Thomas Algorithm
In tridiagonal system all the non-zero elements in the co-efficient matrix must be on the main
diagonal (or) just below and above the main diagonal.
1 1 0 0 0 0 0 x1 b1
2 2 0 0 0 0 x2 b2
2
0 3 3 3 0 0 0 x3 b3
(1)
0 0 0 0 n 1 n 1 n 1 xn 1 bn 1
0 0 0 0 0 n n xn bn
To find the solution of this system we need to find the unknowns x2 , x2 , x3 ,.........xn from
T
equation (1)
1 x1 1 x2 b1 (2)
2 x1 2 x2 2 x3 b2
---------------------------
---------------------------
i xi 1 i xi i xi 1 bi (3)
i 3,4,........n 1
n xn 1 n xn bn (4)
xi 1 g i xi hi (5)
i 1,2,3,4,........n 1
Here we need to find gi and hi , i 1,2,3,.....n 1to find xi 1 find xn from equation (4),
bn n xn 1
xn (6)
n n
86
From (5) we have xi 1 g i xi hi , put i 1 n
xn g n 1 xn 1 hn 1 (7)
n b
g n 1 and hn 1 n
n n
i xi 1 i xi i xi 1 bi
i xi 1 i xi i g i x i hi bi
i xi 1 i xi i gi xi i hi bi
i xi 1 i i g i xi i hi bi
i i g i xi i x i 1 bi i hi
i b h
xi xi1 i i i
i i gi i i gi
xi g i 1 xi 1 hi 1 , i 1,2,3,.....n 1
i b h
where gi 1 , hi1 i i i
i i gi i i gi
1 x1 1 x2 b1
1 x1 1 g 1 x1 h1 b1 |Using (5)
1 1 g 1 x1 1 h1 b1
1 1 g 1 x1 b1 1 h1
b1 1h1
x1
1 1g1
Thus we have the solution of the tridiagonal system of equations in the form
87
xi 1 g i xi hi , i 1,2,3,4,........n 1 we get x 2 , x3 ,......... xn and
b1 1h1 i bi i hi n b
x1 , gi 1 , hi1 , g n 1 and hn 1 n
1 1g1 i i g i i i gi n n
The process of finding the unknowns in this form is known as algorithms (or) tri-diagonal matrix
algorithm.
Thomas algorithm is a simplified form of Gauss elimination method that can be used to solve the
tridiagonal system of equations.
Examples of such matrices commonly arise in one dimensional diffusion problems and natural
cubic spline interpolation.
2 1 0 0 x1 1
2 3 1 0 x 2
Example: Solve the equation 2
0 1 4 2 x3 3
0 0 1 3 x4 4
Solution: Comparing the coefficient matrix with the general coefficient matrix of the tridiagonal
system
2 1 0 0 1 1 0 0
2 3 1 0 2 2 2 0
and n 4, i 1,2,3
0 1 4 2 0 3 3 3
0 0 1 3 0 0 4 4
n 1
gn1 g3 4
n 4 3
bn b4 4
hn1 h3
n 4 3
i
gi 1
i i g i
3 1 1 3
For i 3 g2
3 3 g3 4 2(1/ 3) 10 / 3 10
3
g2
10
88
bi i hi
hi1
i i gi
b3 3h3 3 2 4 / 3 1/ 3 1
For i 3 , h2
3 3 g3 4 2(1/ 3) 10 / 3 10
1
h2
10
2 2 2 20
For i 2 g1
2 2 g2 3 1(3 /10) 27 /10 27
20
g1
27
b2 2 h2 2 11/10 19 /10 19
For i 2 , h1
2 2 g2 3 1(3 /10) 27 /10 27
19
h1
27
4
x1
17
xi 1 g i xi hi , i 1,2,3
20 4 19 9
For i 1 , x2 g1x1 h1
27 17 27 17
9
x2
17
3 9 1 1
For i 2 , x3 g2 x2 h2
10 17 10 17
1
x3
17
89
1 1 4 23
For i 3 , x4 g3 x3 h3
3 17 3 17
23
x4
17
T
4 9 1 23
Hence the solution is , , , .
17 17 17 17
4 1 0 x1 48
Example: Solve the system of equations 1 4 1 x2 24
0 1 4 x3 48
Solution: Comparing the coefficient matrix with the general coefficient matrix of the tridiagonal
system
4 1 0 1 1 0
1
4 1 2 2 2 and n 3, i 1,2
0 1 4 0 3 3
n 1
gn1 g2 3
n 3 4
bn b3 48
hn1 h2 12
n 3 4
i
gi 1
i i g i
2 1 1 4
For i 2 g1
2 2 g2 4 1(1/ 4) 15 / 4 15
4
g1
15
bi i hi
hi1
i i gi
b2 2 h2 24 112 12 16
For i 2 , h1
2 2 g2 4 1(1/ 4) 15 / 4 5
90
16
h1
5
x1 12
xi 1 g i xi hi , i 1, 2
4 16 16 16
For i 1 , x2 g1 x1 h1 12 0
15 5 5 5
x2 0
1
For i 2 , x3 g2 x2 h2 0 12 12
40
x3 12
3 1 0 x1 6
Example: Solve the equation 1 3 1 x2 4 using tri diagonal system method
0 1 3 x3 6
Solution: Comparing the coefficient matrix with the general coefficient matrix of the tridiagonal
system
3 1 0 1 1 0
1 3 1 2 2 and n 3, i 1,2
2
0 1 3 0 3 3
n 1
gn1 g2 3
n 3 3
bn b3 6
hn1 h2 2
n 3 3
i
gi 1
i i g i
91
2 1 1 3
For i 2 g1
2 2 g2 3 1(1/ 3) 8/ 3 8
3
g1
8
bi i hi
hi1
i i gi
b2 2h2 4 1 2 2 6 3
For i 2 , h1
2 2 g2 3 1(1/ 3) 8 / 3 8 4
3
h1
4
x1 2
xi 1 g i xi hi , i 1, 2
3 3 3 3
For i 1 , x2 g1 x1 h1 2 0
8 4 4 4
x2 0
1
For i 2 , x3 g2 x2 h2 0 2 2
3
x3 2
3 1 0 0 x1 2
2 4 2 0 x2 2
Example: Solve the equation
0 1 3 2 x3 11
0 0 4 5 x4 23
92
Iterative method:
Iterative method is that method in which we assume the initial approximation to the solution and
obtain better and better solution with desired degree of accuracy through number of iterations.
Now we should discuss some iterative methods called
a 22 a 21 a 23 a 24 a 2 n
-----------------------------------------
-----------------------------------------
a nn a n 1 a n 2 a n 3 a n 1 n
1
x1 b1 a12 x2 a13 x3 a1n xn
a11
1
x2 b2 a21x1 a23 x3 a2 n xn
a22
1 (2)
x3 b3 a31 x1 a32 x2 a3n xn
a33
1
xn bn an1 x1 an 2 x2 ann1xn1
ann
93
Given the initial approximation x1( 0 ) , x 2( 0 ) , x3( 0 ) ,............, x n( 0 )
First approximation:
1
x1(1)
a11
b1 a12 x2(0) a13 x3(0) a1n xn(0)
1
x2(1)
a22
b2 a21x1(0) a23 x3(0) a2n xn(0)
1
x3(1)
a33
b3 a31 x1(0) a32 x2(0) a3n xn(0)
---------------------------------------------------------
---------------------------------------------------------
1
xn(1)
ann
bn an1 x1(0) an 2 x2(0) ann1 xn(0)1
Second approximation:
1
x1(2)
a11
b1 a12 x2(1) a13 x3(1) a1n xn(1)
1
x2(2)
a22
b2 a21 x1(1) a23 x3(1) a2 n xn(1)
1
x3(2)
a33
b3 a31 x1(1) a32 x2(1) a3n xn(1)
---------------------------------------------------------
---------------------------------------------------------
1
xn(2)
ann
bn an1 x1(1) an 2 x2(1) ann1 xn(1)1
Proceeding this way we obtain third approximation, fourth approximation till we get desired
accuracy.
94
Gauss – Seidel iterative method:
This method is a modification of Gauss-Jacobi method and gives faster convergence compare to
Gauss-Jacobi method.
Let us consider the system of equation (1) on which a11 0 and consider the equation (2) with
initial approximation x1( 0 ) , x 2( 0 ) , x3( 0 ) ,............, x n( 0 )
First approximation:
1
x1(1)
a11
b1 a12 x2(0) a13 x3(0) a1n xn(0)
1
x2(1)
a22
b2 a21 x1(1) a23 x3(0) a2n xn(0)
1
x3(1)
a33
b3 a31 x1(1) a32 x2(1) a3n xn(0)
---------------------------------------------------------
---------------------------------------------------------
1
xn(1)
ann
bn an1 x1(1) an 2 x2(1) ann1 xn(1)1
Second approximation:
1
x1(2) b a x(1) a13 x3(1) a1n xn(1)
a11 1 12 2
1
x2(2) b a x(2) a23 x3(1) a2n xn(1)
a22 2 21 1
1
x3(2) b a x(2) a32 x2(2) a3n xn(1)
a33 3 31 1
---------------------------------------------------------
---------------------------------------------------------
1
xn(2) b a x(2) an2 x2(2) ann1xn(2)1
ann n n1 1
95
Proceeding in this way we obtain third approximation, fourth approximation till we get desired
accuracy.
The Gauss – Seidel iterative method is also called method of successive displacement.
Note: This method cannot be applied to any system of equations. It is applicable only when the
system is diagonally dominant.
Example: Solve the following system of equations by using Gauss-Jacobi and Gauss - Seidel
method 27x 6 y z 85,6x 15 y 2z 72, x y 54z 110 taking the initial approximation
x (0) 0, y (0) 0, z (0) 0
27 6 1 , 15 6 2 , 54 1 1
1
x 85 6 y z
27
1
y 72 6 x 2 z
15
1
z 110 x y
54
Gauss-Jacobi Method:
1 1 85
x (1)
27
85 6 y (0) z (0)
27
85 0 0 3.1481
27
1 1 72
y (1)
15
72 6 x (0) 2 z (0) 72 6(0) 2(0)
15 15
4.8
1 1 110
z (1)
54
110 x (0) y (0) 110 0 0
54 54
2.037
96
1 1
x (2)
27
85 6 y (1) z (1)
27
85 6(4.8) 2.037 2.1569
1 1
y ( 2)
15
72 6 x (1) 2 z (1) 72 6(3.1481) 2(2.037) 3.2691
15
1 1
z (2)
54
110 x (1) y (1) 110 3.1481 4.8 1.8898
54
1 1
x (3)
27
85 6 y (2) z (2)
27
85 6(3.2691) 1.8898 2.4916
1 1
y (3)
15
72 6 x (2) 2 z (2) 72 6(2.1569) 2(1.8898) 3.6852
15
1 1
z (3)
54
110 x (2) y (2) 110 2.1569 3.2691 1.9365
54
1 1
x (4)
27
85 6 y (3) z (3)
27
85 6(3.6852) 1.9365 2.4009
1 1
y (4)
15
72 6 x (3) 2 z (3) 72 6(2.4916) 2(1.9365) 3.5451
15
1 1
z (4)
54
110 x (3) y (3) 110 2.4916 3.6852 1.9226
54
1 1
x (5)
27
85 6 y (4) z (4)
27
85 6(3.5451) 1.9226 2.4315
1 1
y (5)
15
72 6 x (4) 2 z (4) 72 6(2.4009) 2(1.9226) 3.5832
15
1 1
z (5)
54
110 x (4) y (4) 110 2.4009 3.5451 1.9269
54
Hence after five iterations the approximate solution of the given system of equations is
97
Gauss-Seidel Method:
1 1 85
x (1)
27
85 6 y (0) z (0)
27
85 0 0 3.1481
27
1 1 53.1114
y (1)
15
72 6 x (1) 2 z (0) 72 6(3.1481) 2(0)
15 15
3.5408
1 1 103.3111
z (1)
54
110 x (1) y (1)
54
110 3.1481 3.5408
54
1.9132
1 1 65.6684
x (2)
27
85 6 y (1) z (1)
27
85 6(3.5408) 1.9132
27
2.4322
1 1 53.5804
y (2)
15
72 6 x (2) 2 z (1) 72 6(2.4322) 2(1.9132)
15 15
3.5720
1 1 103.9958
z (2)
54
110 x (2) y (2)
54
110 2.4322 3.5720
54
1.9258
1 1 65.4938
x (3)
27
85 6 y (2) z (2)
27
85 6(3.5720) 1.9258
27
2.4257
1 1 53.5942
y (3)
15
72 6 x (3) 2 z (2) 72 6(2.4257) 2(1.9258)
15 15
3.5729
1 1 104.0014
z (3)
54
110 x (3) y (3)
54
110 2.4257 3.5729
54
1.9259
Hence after three iterations the approximate solution of the given system of equations is
98
Example: Solve the following system of equations by using Gauss – Jacobi and Gauss - Seidel
method 10x + y + z = 12, x + 10y + z = 12, x + y + 10z = 12
10 1 1 , 10 1 1 , 10 1 1
1
x 12 y z
10
1
y 12 x z
10
1
z 12 x y
10
Gauss-Jacobi Method:
1 1 12
x (1)
10
12 y (0) z (0 ) 12 0 0
10 10
1.2
1 1 12
y (1)
10
12 x (0) z (0) 12 0 0
10 10
1.2
1 1 12
z (1)
10
12 x (0) y (0) 12 0 0
10 10
1.2
1 1 9.6
x (2)
10
12 y (1) z (1) 12 1.2 1.2
10 10
0.96
1 1 9.6
y (2)
10
12 x (1) z (1) 12 1.2 1.2
10 10
0.96
1 1 9.6
z (2)
10
12 x (1) y (1) 12 1.2 1.2
10 10
0.96
99
The third approximations are as follows
1 1 10.08
x (3)
10
12 y (2) z (2) 12 0.96 0.96
10 10
1.008 1
1 1 10.08
y (3)
10
12 x (2) z (2) 12 0.96 0.96
10 10
1.008 1
1 1 10.08
z (3)
10
12 x (2) y (2) 12 0.96 0.96
10 10
1.008 1
1 1 10
x (4)
10
12 y (3) z (3) 12 1 1
10 10
1
1 1 10
y (3)
10
12 x (2) z (2) 12 1 1
10 10
1
1 1 10
z (3)
10
12 x (2) y (2 ) 12 1 1
10 10
1
Hence after three iterations the approximate solution of the given system of equations is
x 1, y 1, z 1
Gauss-Seidel Method:
1 1 12
x (1)
10
12 y (0) z (0 ) 12 0 0
10 10
1.2
1 1 10.8
y (1)
10
12 x (1) z (0) 12 1.2 0
10 10
1.08
1 1 9.72
z (1)
10
12 x (1) y (1) 12 1.2 1.08
10 10
0.972
100
The second approximations are as follows
1 1 9.948
x (2)
10
12 y (1) z (1) 12 1.08 0.972
10 10
0.9948
1 1 10.0332
y (2)
10
12 x (2) z (1) 12 0.9948 0.972
10 10
1.00332
1 1 10.00188
z (2)
10
12 x (2) y (2) 12 0.9948 1.00332
10 10
1.000188
1 1 9.9965
x (3)
10
12 y (2) z (2) 12 1.00332 1.000188
10 10
0.9965
1 1 10.003312
y (3)
10
12 x (3) z (2) 12 0.9965 1.000188
10 10
1.0003312
1 1 10.00317
z (3)
10
12 x (3) y (3) 12 0.9965 1.0003312
10 10
1.000317
Hence after three iterations the approximate solution of the given system of equations is
Example: Solve the following system of equations by using Gauss Jacobi and Gauss - Seidel
method 20x + y - 2z = 17, 3x + 20y - z = -18, 2x - 3y + 20z = 25
10 1 2 , 10 3 1 , 10 2 3
1
x 17 y 2 z
20
1
y 18 3 x z
20
1
z 25 2 x 3 y
20
101
Gauss-Jacobi Method:
1 1 17
x (1)
20
17 y (0) 2 z (0)
20
17 0 0 0.85
20
1 1 18
y (1)
20
18 3 x (0) z (0)
20
18 3(0) 0 0.9
20
1 1 25
z (1)
20
25 2 x (0) 3 y (0) 25 2(0) 3(0)
20 20
1.25
1 1
x (2)
20
17 y (1) 2 z (1)
20
17 ( 0.9) 2(1.25) 1.02
1 1
y (2)
20
18 3 x (1) z (1)
20
18 3(0.85) 1.25 0.965
1 1
z (2)
20
25 2 x (1) 3 y (1)
20
25 2(0.85) 3( 0.9) 1.03
1 1
x (3)
20
17 y (2) 2 z (2) 17 ( 0.965) 2(1.03) 1.0012 1
20
1 1
y (3)
20
18 3 x (2) z (2) 18 3(1.02) 1..3 0.988 1
20
1 1
z (3)
20
25 2 x (2) 3 y (2)
20
25 2(1.02) 3( 0.965) 1.0032 1
Hence after three iterations the approximate solution of the given system of equations is
x 1, y 1, z 1
102
Gauss-Seidel Method:
1 1 17
x (1)
20
17 y (0) 2 z (0)
20
17 0 0 0.85
20
1 1 20.55
y (1)
20
18 3 x (1) z (0)
20
18 3(0.85) 0
20
1.0275
1 1 20.2175
z (1)
20
25 2 x (1) 3 y (1)
20
25 2(0,85) 3( 1.0275)
20
1.0109
1 1 20.0493
x (2)
20
17 y (1) 2 z (1)
20
17 (1.0275) 2(1.0109)
20
1.0025
1 1 19.9966
y (2)
20
18 3 x (2) z (1)
20
18 3(1.0025) 1.0109
20
0.9998
1 1 19.9956
z (2)
20
25 2 x (2) 3 y (2)
20
25 2(1.0025) 3( 0.9998)
20
0.9998
1 1 19.9994
x (3)
20
17 y (2) 2 z (2)
20
17 ( 0.9998) 2(0.9998)
20
0.99997 1
1 1 20.0002
y (3)
20
18 3 x (3) z (2)
20
18 3(1) 0.9998
20
1.00001 1
1 1 20
z (3)
20
25 2 x (3) 3 y (3)
20
25 2(1) 3(1) 1
20
Hence after three iterations the approximate solution of the given system of equations is
x 1, y 1, z 1
103
Example: Solve the following system of equation using Gauss-Jacobi and Gauss - Seidel
method 4 x1 x2 x3 2, x1 3 x2 2 x3 6, x1 2 x2 3 x3 4 , taking initial condition
x1( 0) 0.5, x2( 0) 0.5, x3( 0) 0.5
4 1 1, 3 1 2 , 3 1 2
1
x1 2 x2 x3
4
1
x2 6 x1 2 x3
3
1
x3 4 x1 2 x2
3
Gauss-Jacobi Method:
1 1
x1(1)
4
2 x2(0) x3(0) 2 0.5 0.5 0.25
4
1 1
x2(1)
3
6 x1(0) 2 x3(0) 6 0.5 2(0.5) 1.5
3
1 1
x3(1)
3
4 x1(0) 2 x2(0) 4 0.5 2(0.5) 0.833 0.84
3
1 1
x1(2)
4
2 x2(1) x3(1) 2 1.5 0.84 0.085
4
1 1
x2(2)
3
6 x1(1) 2 x3(1) 6 0.25 2(0.84) 1.356
3
1 1
x3(2)
3
4 x1(1) 2 x2(1) 4 0.25 2(1.5) 0.25
3
104
The third approximations are as follows
1 1
x1(3)
4
2 x2(2) x3(2) 2 1.356 0.25 0.0985
4
1 1
x2(3)
3
6 x1(2) 2 x3(2) 6 0.085 2(0.25) 1.86 1.9
3
1 1
x3(3)
3
4 x1(2) 2 x2(2) 4 0.085 2(1.356) 0.457 0.46
3
1 1
x1(4)
4
2 x2(3) x3(3) 2 1.9 0.46 0.09
4
1 1
x2(4)
3
6 x1(3) 2 x3(3) 6 0.0985 2(0.46) 1.66 1.9
3
1 1
x3(4)
3
4 x1(3) 2 x2(3) 4 0.0985 2(1.9) 0.0338
3
1 1
x1(5)
4
2 x2(4) x3(4) 2 1.66 0.0338 0.01
4
1 1
x2(5)
3
6 x1(4) 2 x3(4) 6 ( 0.09) 2(0.0338) 2
3
1 1
x3(5)
3
4 x1(4) 2 x2(4) 4 ( 0.09) 2(1.66) 0.25
3
1 1
x1(6)
4
2 x2(5) x3(5) 2 2 0.25 0.0625 0
4
1 1
x2(6)
3
6 x1(5) 2 x3(5) 6 0.01 2(0.25) 1.83 2
3
1 1
x3(6)
3
4 x1(5) 2 x2(5) 4 0.09 2(2) 0.0033 0
3
Hence after six iterations the approximate solution of the given system of equations is
x1 0, x2 2, x3 0
105
Gauss-Seidel Method:
1 1
x1(1)
4
2 x2(0) x3(0) 2 0.5 0.5 0.25
4
1 1
x2(1)
3
6 x1(1) 2 x3(0) 6 0.25 2(0.5) 1.5833
3
1 1
x3(1)
3
4 x1(1) 2 x2(1) 4 0.25 2(1.5833) 0.1945
3
1 1
x1(2)
4
2 x2(1) x3(1) 2 1.5833 0.1945 0.0555
4
1 1
x2(2)
3
6 x1(2) 2 x3(1) 6 0.0555 2(0.1945) 1.8518
3
1 1
x3(2)
3
4 x1(2) 2 x2(2) 4 0.0555 2(1.8518) 0.0803
3
1 1
x1(3)
4
2 x2(2) x3(2) 2 1.8518 0.0803 0.017
4
1 1
x2(3)
3
6 x1(3) 2 x3( 2) 6 0.017 2(0.0803) 1.9408
3
1 1
x3(3)
3
4 x1(3) 2 x2(3) 4 0.017 2(1.9408) 0.0338
3
1 1
x1(4)
4
2 x2(3) x3(3) 2 1.9408 0.0338 0.00635
4
1 1
x2(4)
3
6 x1( 4) 2 x3(3) 6 0.00635 2(0.0338) 1.9726
3
106
1 1
x3(4)
3
4 x1(4) 2 x2(4) 4 0.00635 2(1.9726) 0.01615
3
Hence after fourth iterations the approximate solution of the given system of equations is
Example: Solve the following system of equations by using Gauss-Jacobi and Gauss - Seidel
method 2x + y + 6z = 9, 8x + 3y + 2z = 13, x + 5y + z = 7
8x + 3y + 2z = 13, x + 5y + z = 7, 2x + y + 6z = 9
8 3 2 , 5 1 1, 6 2 1
1
x 13 3 y 2 z
8
1
y 7 x z
5
1
z 9 2 x y
6
Gauss-Jacobi Method:
1 1 13
x (1)
8
13 3 y (0) 2 z (0) 13 3(0) 2(0)
8 8
1.625
1 1 7
y (1)
5
7 x (0) z (0) 7 0 0 1.4
5 5
1 1 9
z (1)
6
9 2 x (0) y (0) 9 2(0) 0 1.5
6 6
107
The second approximations are as follows
1 1
x (2)
8
13 3 y (1) 2 z (1) 13 3(1.4) 2(1.5) 0.725
8
1 1
y (2)
5
7 x (1) z (1) 7 1.625 1.5 0.775
5
1 1
z (2)
6
9 2 x (1) y (1) 9 2(1.625) 1.4 0.725
6
1 1
x (3)
8
13 3 y (2) 2 z (2) 13 3(0.775) 2(0.725) 1.1531
8
1 1
y (3)
5
7 x (2) z (2) 7 0.725 0.725 1.11
5
1 1
z (3)
6
9 2 x (2) y (2) 9 2(0.725) 0.775 1.1291
6
1 1
x (4)
8
13 3 y (3) 2 z (3) 13 3(1.11) 2(1.1091) 0.9314
8
1 1
y (4)
5
7 x (3) z (3) 7 1.1531 1.1291 0.9435
5
1 1
z (4)
6
9 2 x (3) y (3) 9 2(1.1531) 1.11 0.9306
6
Hence after three iterations the approximate solution of the given system of equations is
Gauss-Seidel Method:
1 1 13
x (1)
8
13 3 y (0) 2 z (0) 13 3(0) 2(0)
8 8
1.625
108
1 1 5.375
y (1)
5
7 x (1) z (0) 7 1.625 0
5 5
1.075
1 1 4.675
z (1)
6
9 2 x (1) y (1) 9 2(1.625) 1.075
6 6
0.7791
1 1 8.2168
x (2)
8
13 3 y (1) 2 z (1) 13 3(1.075) 2(0.7791)
8 8
1.0271
1 1 5.1938
y (2)
5
7 x (2) z (1) 7 1.0271 0.7791
5 5
1.0388
1 1 5.907
z (2)
6
9 2 x (2) y (2) 9 2(1.0271) 1.0388
6 6
0.9845
1 1 7.9146
x (3)
8
13 3 y (2) 2 z (2) 13 3(1.0388) 2(0.9845)
8 8
0.9893
1 1 5.0261
y (3)
5
7 x (3) z (2) 7 0.9893 0.9846
5 5
1.0052
1 1 6.0162
z (3)
6
9 2 x (3) y (3) 9 2(0.9893) 1.0052
6 6
1.0027
Hence after three iterations the approximate solution of the given system of equations is
Solve the following system of equations using Gauss-Jacobi and Gauss - Seidel method
109
Gauss-Jacobi method error analysis
k 0,1,2,3......
L and U are lower and upper triangular matrices with zero diagonal entries, D is diagonal matrix
such that A = L + D + U.
X ( k 1) X ( k ) X ( k ) D 1 ( L U ) X ( k ) D 1b
X ( k 1) X ( k ) X ( k ) I D 1 ( L U ) D 1b
X ( k 1) X ( k ) X ( k ) D 1 D ( L U ) D 1b
X (k 1) X (k ) D1 b AX (k )
Where r
(k )
b AX (k ) =residual error
X (k1) X (k ) D1r(k)
( k ) D 1 r ( k )
D ( k ) r ( k )
We solve for (k ) and find X ( k 1) X ( k ) ( k ) these equations describe the Gauss-Jacobi method
in error format.
110
Gauss-Seidel method error analysis
k 0,1,2,3......
X ( k 1) X ( k ) X ( k ) ( D L ) 1UX ( k ) ( D L) 1 b
X ( k 1) X ( k ) X ( k ) I ( D L ) 1U ( D L ) 1 b
X ( k 1) X ( k ) X ( k ) ( D L ) 1 ( D L ) U ( D L ) 1 b
X ( k 1) X ( k ) ( D L) 1 AX ( k ) ( D L) 1 b
X (k 1) X (k ) (D L)1 b AX (k )
X ( k 1) X ( k ) ( D L) 1 r ( k )
Where r
(k )
b AX (k ) = residual error
X ( k 1) X ( k ) ( D L)1 r ( k )
( k ) ( D L ) 1 r ( k )
( D L ) ( k ) r ( k )
Where ( k ) X ( k 1) X ( k )
Solve this for (k ) and then find X ( k 1) X ( k ) ( k ) , this equation describes the Gauss-Seidel
method in an error format.
111
Gauss-Jacobi method error analysis
k 0,1,2,3......
L and U are lower and upper triangular matrices with zero diagonal entries, D is diagonal matrix
such that A = L + D + U.
X ( k 1) X ( k ) X ( k ) D 1 ( L U ) X ( k ) D 1b
X ( k 1) X ( k ) I D 1 ( L U ) X ( k ) D 1b
X ( k 1) X ( k ) D 1 D ( L U ) X ( k ) D 1b
X (k 1) X (k ) D1 b AX (k )
Where r
(k )
b AX (k ) =residual error
X (k1) X (k ) D1r(k)
( k ) D 1 r ( k )
D ( k ) r ( k )
We solve for (k ) and find X ( k 1) X ( k ) ( k ) these equations describe the Gauss-Jacobi method
in error format.
110
Gauss-Seidel method error analysis
k 0,1,2,3......
X ( k 1) X ( k ) X ( k ) ( D L ) 1UX ( k ) ( D L) 1 b
X ( k 1) X ( k ) I ( D L ) 1U X ( k ) ( D L ) 1 b
X ( k 1) X ( k ) ( D L ) 1 ( D L ) U X ( k ) ( D L ) 1 b
X ( k 1) X ( k ) ( D L) 1 AX ( k ) ( D L) 1 b
X (k 1) X (k ) (D L)1 b AX (k )
X ( k 1) X ( k ) ( D L) 1 r ( k )
Where r
(k )
b AX (k ) = residual error
X ( k 1) X ( k ) ( D L)1 r ( k )
( k ) ( D L ) 1 r ( k )
( D L ) ( k ) r ( k )
Where ( k ) X ( k 1) X ( k )
Solve this for (k ) and then find X ( k 1) X ( k ) ( k ) , this equation describes the Gauss-Seidel
method in an error format.
111