Download as pdf or txt
Download as pdf or txt
You are on page 1of 117

For More Visit : www.LearnEngineering.

in
1MA8491 Numerical Methods .

UNIT I : Solution of Equations and Eigenvalue Problems


Solution of equation – Fixed point iteration: x = g(x) method – Newton’s
method – Solution of linear system by Gaussian elimination and Gauss
–Jordon methods – Iterative methods – Gauss-Seidel methods – Inverse of a
matrix by Gauss Jordon method – Eigen value of a matrix by power method
and by Jacobi method for symmetric matrix.

Topic 1 : Solution of equation


A value satisfies given equation is called solution of that equation.

.in
Y axis [ = f(x) ]

–X
x = x1 x = x2 x = x3 x = 0 ing x = x4 x = x5
X axis
eer
gin

–Y
En

Here the curve f(x) with f(x = x2) = f(x = x3) = f(x = x4) = 0
 x2, x3 and x4 are solutions of f(x).
and f(x) > 0 for x2 < x < x3 and x4 < x < x5
arn

f(x) < 0 for x1 < x < x2 and x3 < x < x4

Topic 2 :Fixed point iteration: x = g(x) method


Le

Write the given equation as f(x) = 0.


Find x1, x2 with opposite signs of f(x).
Find an relation as x = g(x) such that g '  x1   1
w.

g '  x2   1
ww

 x , f  x1   f  x2   f  x1  is nearer to zero.
X0   1
 x2 , f  x1   f  x2   f  x2  is nearer to zero.
X1  g  X 0 
X 2  g  X1 

X n  g  X n 1   Stop method if the consecutive values of
 X n & X n 1 are equal upto required place of decimal.
X n 1  g  X n   i.e., X =X
n n 1
Iteration method is a indirect (or successive approximation) method.
Iteration method is a self correction method.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
2 UNIT I : Solution of Equations and Eigenvalue Problems
Part A:
1. If g(x) is continuous in [a,b] then under what condition the iterative
method x = g(x) has unique solution in [a,b].
Sol: g '  x   1 in  a, b  with order of convergence is one.
Part B:
3 2
Eg.1. Solve the equation x  x  100  0 by iteration method.
Sol: Let f  x   x  x  100  0
3 2

f  x  0    0    0   100  100  0  ' ' ve 


3 2

f  x  1  1  1  100  98  0  ' ' ve 


3 2

f  x  2    2    2   100  88  0  ' ' ve 


3 2

.in
f  x  3   3   3  100  64  0  ' ' ve 
3 2

f  x  4    4    4   100  20  0  ' ' ve 


3 2

 f  x  has a root between 4 and 5.


2

ing
f  x  5    5    5   100  50  0  ' ' ve 
eer
i.e, f  x  has a positive root.
gin

This equation f  x   x  x  100  0 can be written as


3 2

x3  x 2  100  0
En

i.e., x 2  x  1  100
10
i.e., x    g  x  , say 
arn

x 1
1
10
 g  x   10  x  1 2
Le

x 1
d
Therefore, g   x    g  x  
dx 
w.

1  1 3
d   1  1 5
 10  x  1 2  10    x  1 2  5  x  1 2 
ww

dx  2 3
  
 x  1 2
5 5
 g  x   3
 3
 x  1 2  x  1 2
5 5 5 1 1
g   x  4       0.57735 1
At x = 4,  4  1 3/ 2
 5 3/ 2
5 5 5 2.23606
5 5
g   x  5    0.34020 1
At x = 5,  5  1 3/ 2
 6 3 / 2

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
3MA8491 Numerical Methods .

 g   x   1 in (4,5).
So the fixed point iteration method can be applied.
Let x0  4 ∵ f  x  4   f  x  5  
 

Use xn 1  g  xn 
Now, put n = 0 in xn 1  g  xn  , we get
10 10 10
x1  g  x0      4.47214
x0  1 4 1 5 (round off at 5th decimal)
10
x2  g  x1    4.27486
4.47214  1

.in
10
x3  g  x2    4.35406
4.27486  1

ing
10
x4  g  x3    4.32174
4.35406  1
eer
10
x5  g  x4    4.33484
4.32174  1
10
x6  g  x5  
gin

 4.32952
4.33484  1
10
x7  g  x6    4.33168
En

4.32952  1
10
x8  g  x7    4.33080
arn

4.33168  1
10
x9  g  x8    4.33116
4.33080  1
Le

10
x10  g  x9    4.33101
4.33116  1
w.

10
x11  g  x10    4.33107
4.33101  1
ww

10 
x12  g  x11    4.33105  these values are same 
4.33107  1  
 at fifth decimal, i.e., x12  x .
13 
10
x13  g  x12    4.33105  so stop the method 

4.33105  1 
 3 2
The root of the given equation x  x  100  0 is 4.33105

Note: In above problem, the root is 4.33105(at 5th decimal)


or 4.3311(at 4th decimal) or 4.331(at 3rd decimal)

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
4 UNIT I : Solution of Equations and Eigenvalue Problems

3 2
CW.2. Solve the equation x  2 x  10 x  20 by fixed point iteration
method. {Solution : x13  x14  1.36880 }
3
HW.3. Solve the equationx  x  1  0 by fixed point iteration method.
{Solution : g  x    1  x  ; x23  x24  0.682 }
1/3

Eg.4. Solve the equation 3 x  cos x  2  0 by fixed point iteration


method correct to 3 decimal places.
Sol: Let f  x   3 x  cos x  2  0
f  x  0   3  0   cos  0   2  0  1  2  3  0  ' ' ve 
f  x  1  3 1  cos 1  2  0.459697  0  ' ' ve 

.in
 f  x  has a root between 0 and 1.

i.e, f  x  has a positive root.

ing
This equation f  x   3 x  cos x  2  0 can be written as
3 x  cos x  2  0
eer
i.e.,3 x  2  cos x
2  cos x
  g  x  , say 
gin

i.e., x 
3
2  cos x
 g  x 
En

3
d
Therefore, g   x    g  x  
dx 
arn

d  2  cos x   1  d 1  sin x


 
dx  3    3  dx  2  cos x    3   0  sin x   3
    
Le

 sin x sin x
 g x  
3 3
w.

sin  0 
g   x  0   0 1
ww

At x = 0, 3
sin 1
g   x  1   0.2804 1
At x = 1, 3
 g   x   1 in (0,1).
So the fixed point iteration method can be applied.
Let x0  0  we hvae to take x0  1,∵ f  x  1  f  x  0  
 

Use xn 1  g  xn 
Now, put n = 0 in xn 1  g  xn  , we get

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
5MA8491 Numerical Methods
2  cos  x0  2  cos  0  2  1
.

x1  g  x0     1
3 3 3
2  cos  x1  2  cos 1
x2  g  x1     0.84677
3 3
2  cos  x2  2  cos  0.84677 
x3  g  x2     0.88747
3 3
2  cos  x3  2  cos  0.84747 
x4  g  x3     0.87713
3 3
2  cos  x4  2  cos  0.87713 
x5  g  x4     0.87979   x5  x6 
3 3  rd

  at 3 decimal, 

.in
2  cos  x5  2  cos  0.87979   
x6  g  x5     0.87910   so stop the method 
3 3 

ing
 The root of the given equation 3 x  cos x  2  0 is 0.879

CW.5. Solve the equationcos x  3 x  1 by iteration method upto 5 decimal.


eer
{Solution : x  0.60710 }
HW.6. Solve the equation 2sin x  x by fixed point iteration method.
{Hint : g  x  1  1, so use g  x  1.5   1& g  x  2   1 ,
  
gin

Soln. : x  1.89549 }
x
Eg.7. Solve the equation e  3x  0 by iteration method upto 3 decimal.
En

Let f  x   e  3 x  0
x
Sol:
arn

f  x  0   e0  3  0   1  0  ' ' ve 
f  x  1  e1  3 1  0.2817  0  ' ' ve 
Le

 f  x  has a root between 0 and 1.

i.e, f  x  has a positive root.


w.

This equation f  x   e  3 x  0 can be written as


x
ww

3x  e x
ex
i.e., x    g  x  , say 
3 
d d  ex  ex
Therefore, g   x    g  x      
dx dx  3  3

ex ex
 g x  
3 3

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
6 UNIT I : Solution of Equations and Eigenvalue Problems
e0 1
g   x  0    0.333  1
At x = 0, 3 3
e1
g   x  1   0.906  1
At x = 1, 3
 g   x   1 in (0,1).
So the fixed point iteration method can be applied.
Let x0  0 , use xn 1  g  xn 
Now, put n = 0 in xn 1  g  xn  , we get
e x0 e0
x1  g  x0     0.33333

.in
3 3 e x6 e0.59983
x7    0.60727
e x1 e0.33333 3 3
x2    0.46520

ing
3 3 e x7 e0.60727
x8    0.61180
e x2 e0.46520 3 3
x3    0.53078
e x8 e0.61180
eer
3 3
x9    0.61458
e x3 e0.53078 3 3
x4    0.56675
e x9 e0.61458
gin

3 3
x10    0.61629
e x4 e0.56675 3 3
x5    0.58751
3 3 e x10 e0.61629
x11    0.61735
En

e x5 e0.58751 3 3
x6    0.59983
3 3
arn

e x11 e0.61735 
x12  g  x11     0.61800   x12  x13 
3 3  rd
  at 3 decimal, 
Le

x12 0.61800
e e  
x13  g  x12     0.61840   so stop the method 
3 3 
w.

 x
The root of the given equation e  3x  0 is 0.618
Eg.8. Solve the equation 2 x  log x  7 by iteration method upto 5 decimal.
ww

Sol: Let f  x   2 x  log x  7  0


f  x  0   2  0   log10  0   7  Undefined 
f  x  1  2 1  log10 1  7  5  0  ' ' ve 
f  x  2   2  2   log10  2   7  3  0  ' ' ve 
f  x  3  2  3  log10  3  7  1  0  ' ' ve 
f  x  4   2  4   log10  4   7  0.39  0  ' ' ve 
 f  x  has a root between 3 and 4.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
7MA8491 Numerical Methods
i.e, f  x  has a positive root.
.

This equation f  x   2 x  log x  7  0 can be written as


2 x  7  log x
7  log x
i.e., x    g  x  , say 
2
7  log x
 g  x 
2
1
d d  7  log x  x 1
Therefore, g   x    g  x       2  2x
dx  dx  2 

.in
1 1
 g x  
2x 2x

ing
1 1
g   x  3    0.166  1
At x = 3, 2  3 6
eer
1 1
g   x  4    0.125  1
At x = 4, 2  4 8
gin

 g   x   1 in (3,4).
So the fixed point iteration method can be applied.
Let x0  4
En

Use xn 1  g  xn 
Now, put n = 0 in xn 1  g  xn  , we get
arn

7  log  x0  7  log  4 
x1  g  x0     3.80103
Le

2 2
7  log  x1  7  log  3.80103
x2  g  x1     3.78995
w.

2 2
7  log  x2  7  log  3.78995 
x3  g  x2     3.78932
ww

2 2
7  log  x3  7  log  3.78932   x4  x5 
x4  g  x3     3.78928   
2 2  th
  at 5 decimal, 
7  log  x4  7  log  3.78928   
x5  g  x4     3.78928  so stop the method 
2 2 

The root of the given equation 2 x  log x  7 is 3.78928
HW.9. Solve the equation 3 x  log10 x  6 by fixed point iteration method.
{ Solution. : x  2.1080 }

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
8 UNIT I : Solution of Equations and Eigenvalue Problems

Topic 3 : Newton’s method


(Newton–Raphson method or method of tangents)

Newton–Raphson method formula is


f  xn 
xn 1  xn     xn  , where n  0,1, 2,...
f '  xn 
Part A:
2. State the order of convergence and convergence condition for
Newton–Raphson method.
Sol: Order of convergence is 2. Convergence condition is
2
f  x  f ''  x   f '  x 

.in
3. Find an iterative formula to find N , where N is positive number.

ing
Sol: Let x  N
2 2
 x  N  x N 0
f ' x   2x
eer
Let f  x   x  N 
2

By Newton’s formula
f  xn  x 2  N 2 x 2n  x 2n  N x 2n  N
gin

xn 1  xn   xn  n  
f '  xn  2 xn 2 xn 2 xn
En

4. Derive Newton’s algorithm for finding the pth root of a number N.


1/ p p
Sol: Let x  N  N
arn

p
 x N 0
Let f  x   x  N  f '  x   px
p p 1
Le

By Newton’s formula
xp  N px p  x p  N  p  1 x np  N
w.

n n n
xn 1  xn   
px p 1 px p 1
px p 1
ww

5. Establish an iteration formula to find the reciprocal of a positive


number N by Newton–Raphson method.
1  1
x ∵ The reciprocal of a positive number N is 
Sol: Let N  N 
1 1
N   N 0
 x x
1 1
f  x   N f ' x    2
Let x  x
By Newton’s formula ,

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
9MA8491 Numerical Methods .

1
N
xn  1 
xn 1  xn   xn    N  xn2  xn  2  Nxn 
1  xn 
 2
xn
3
6. Locate the negative root of x  2 x  5  0 , approximately.
Let f  x   x  2 x  5  0
3
Sol:
f  1  1  2  5  6  ve 
f  2   8  4  5  1 ve 
f  3  27  6  5  16  ve 
 Root lies between –2 and –3.

.in
and root is closer to –2 since f  2   f  3
7. Evaluate 12 applying Newton formula.
Sol: Let x  12
2 2
 x  12  x  12  0 ing
eer
f ' x   2x
Let f  x   x  12 
2

f  3  9  12  3  ve 
gin

f  4   16  12  4  ve 
 Root lies between 3 and 4.
and root is closer to 3 since f  3  f  4 
En

Take x0  3
arn

f  xn 
xn 1  xn 
Newton’s formula is f '  xn 
Le

f  x0  f  3  32  12
x1  x0   3  3  3.5
f '  x0  f '  3 2  3
w.

f  x1  f  3.5   3.52  12
x2  x1   3.5   3.5   3.4642
f '  x1  f '  3.5  2  3.5 
ww


The root is 3.4642

Part B:
Eg.10. Using Newton–Raphson method, find a ‘+’ve root correct to 3
3
decimal places for the equation x  x  2  0 .
Sol: Newton–Raphson method formula is
f  xn 
xn 1  xn  , where n  0,1, 2,...
f '  xn 

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
10 UNIT I : Solution of Equations and Eigenvalue Problems
Let f  x   x  x  2
3

 f  x   3 x 2  1
f  x  0   03  0  2  2  0  '  've 
f  x  1  1  1  2  2  0
3
 '  've 
f  x  2   23  2  2  4  0  ' ' ve 
 A root lies between 1 and 2.
Take x0  1
f  xn 
xn 1  xn  ,
Now, put n = 0 in f '  xn  we get

.in
f  x0   x0   x0  2
3 13  1  2 
x1  x0   x0  1   2

ing
f '  x0  3  x 2  1 3 12  1
 0   
f  x1   3
  
 x1  1
 x   x1  2  2  
3 2 2 2
  1.63636
eer
x2  x1 
f '  x1  3  x 2  1 3  2 2  1
 1   
f  x2   x2  x2 2
3
1.6363631.636362
gin

x3  x2   x2   1.63636   1.53039
f '  x2  3  x 2 1 3 1.63636 2  1
 2   
f  x3   x3  x32
3
1.5303931.530392
En

x4  x3  x3  1.53039   1.52144


f '  x3  3  x 2 1 3 1.53039 2  1
 3
  
arn

f  x4   x4  x4 2
3
1.5214431.52144 2
x5  x4   x4   1.52144   1.52138
f '  x4  3  x 2 1 3 1.52144 2  1
 4   
Le

f  x5   x5  x5 2
3 3
1.52138  1.52138 2
x6  x5   x5   1.52138   1.52138
f '  x5  3  x 2 1 3 1.52138 2  1
w.

 5
  
 A root of given equation is 1.521
ww

x3  5 x  3  0 by Newton–Raphson method.
CW.11. Solve the equation
{Solution. : x3  x4  0.65662 }
4
x  x  9  0 by Newton–Raphson method.
HW.12. Solve the equation
{Solution. : x6  x7  1.813 upto 3rd decimal}
Eg.13. Using Newton–Raphson method, find a ‘+’ve root correct to 5
decimal places for the equation x tan x  1.28
Sol: Newton–Raphson method formula is

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
11 .

f  xn 
xn 1  xn  , where n  0,1, 2,...
f '  xn 

Let f  x   x tan x  1.28


 f  x   x sec 2 x  tan x
f  x  0    0  tan  0   1.28  1.28  0  '  've 
f  x  0.5    0.5  tan  0.5   1.28  1.006  0  '  've 
f  x  1  1 tan 1  1.28  0.2774  0  ' ' ve 
 A root lies between 0.5 and 1.
Take x0  0.5

.in
f  xn 
xn 1  xn  ,
Now, put n = 0 in f '  xn  we get

ing
f  x0  x0 tan x0 1.28  0.5 tan  0.51.28
x1  x0   x0   0.5   1.34218
f '  x0  2
x0 sec x0 tan x0  0.5 sec2  0.5tan  0.5
eer
f  x1  1.34218 tan 1.342181.28
x2  x1   1.34218   1.19469
f '  x1  1.34218 sec2 1.34218tan 1.34218
f  x2  1.19469  tan 1.19469 1.28
gin

x3  x2   1.19469   1.04143
f '  x2  1.19469  sec2 1.19469 tan 1.19469 
f  x3  1.04143 tan 1.041431.28
x4  x3   1.04143   0.95512
f '  x3 
En

1.04143 sec2 1.04143tan 1.04143


f  x4   0.95512  tan  0.95512 1.28
x5  x4   0.95512   0.93871
f '  x4    sec2  0.95512 tan  0.95512 
arn

0.95512
f  x5   0.93871 tan  0.938711.28
x6  x5   0.93871   0.93826
f '  x5   0.93871 sec2  0.93871tan  0.93871
f  x6 
Le

 0.93826  tan  0.93826 1.28


x7  x6   0.93826   0.93826
f '  x6   0.93826  sec2  0.93826 tan  0.93826 
w.

 A root of given equation is 0.93826


x sin x  cos x  0 by Newton–Raphson method.
CW.14. Solve the equation
ww

{Solution. : x4  x5  2.79839 }
2 x
xe
HW.15. Solve the equation  0.5sin x by Newton–Raphson method.
{Solution. : x2  x3  3.12962 upto 5th decimal}
Eg.16. Using Newton–Raphson method, find a root correct to 5 decimal
x
places for the equation e  4 x  0
f  xn 
xn 1  xn 
Sol: Newton–Raphson method formula is f '  xn 

Let f  x   e  4 x  f  x   e  4
x x

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
12 UNIT I : Solution of Equations and Eigenvalue Problems
f  x  0   e0  4  0   1  0  ' ' ve 
f  x  1  e1  4 1  1.28272  0  '  've 
 A root lies between 0 and 1.
Here f 1  1.28172  f  0   1
 Root is nearer to 0.
Take x0  0
f  xn 
xn 1  xn  ,
Now, put n = 0 in f '  xn  we get
f  x0  e x0  4 x0 e0  4  0 
x1  x0   x0  x  0  0.33333

.in
f '  x0  e 0 4 e0  4
f  x1  e x1 4 x e0.33333 4  0.33333
x2  x1   x1  x 1  0.33333   0.35725

ing
f '  x1  e 1 4 e0.33333 4
f  x2  e x2 4 x2 e0.35725 4  0.35725 
x3  x2   x2  x  0.35725   0.35740
f '  x2  e0.35725 4
eer
e 2 4
f  x3  e x3 4 x e0.35740 4  0.35740 
x4  x3   x3  x 3  0.35740   0.35740
f '  x3  e 3 4 e0.35740 4
gin

 A root of given equation is 0.35740


En

x
CW.17. Solve the equation cos x  xe , by x0  0.5 by Newton–Raphson
method. {Solution. : x2  x3  0.51776 }
arn

2 x  log10 x  7 by Newton–Raphson method.


HW.18. Solve the equation
{Solution. : x5  x6  3.78928 upto 5th decimal}
Le

1
Eg.19. Find the Newton–Raphson formula to find the value of N where
1
w.

N is a real number, hence evaluate 26 correct to 4 decimal places.


ww

1
x
Sol: Let N
1 1
N   N 0
 x x
1 1
f  x   N f ' x    2
Let x  x
By Newton’s formula ,

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
13 .

1
N
xn  1 
xn 1  xn   xn    N  xn2  xn  2  Nxn 
1  xn 
 2
xn
1
This is the Newton’s–Raphson formula to find the value of N .
1
To find :
26
Put N = 26 and n = 0 in xn 1  xn  2  Nxn  , we get
x1  x0  2  26 x0  (1)

.in
1  1 1 
Take  0.04 as x0 ∵ is nearer to 
25  25 26 

ing
 1  x1  x0  2  26 x0   0.04  2  26  0.04    0.0384
x2  x1  2  26 x1   0.0384  2  26  0.0384    0.03846
eer
x3  x2  2  26 x2   0.03846  2  26  0.03846    0.03846
 A root of given equation is 0.03846 or 0.0385
gin

CW.20. Find the Newton–Raphson formula to find the value of N where


N is a real number, hence evaluate 142 correct to 5 decimal
{Solution. : x2  x3  11.91638 }
En

places.
1
p
HW.21. Find the Newton–Raphson formula to find the value of N where
arn

N is a real number, hence evaluate 3 17 correct to 5 decimal


places. {Solution. : x4  x5  2.57128 }
Le

Anna University Questions:


AU1. Find Newton’s iterative formula for the reciprocal of a number N
w.

1
and hence find the value of23 , correct to five decimal places.
ww

(Anna Univ. Nov./Dec, 2009(ECE)) Ans: x = 0.04347


AU2. Prove the quadratic convergence of Newton’s-Raphson method.
3
Find a positive root of f ( x)  x  5 x  3  0 , using this method.
(May/June, 2007) Ans: x = 0.6566
AU3. Use Newton’s method to find the real root of 3x − cos x − 1 = 0.
(Nov./Dec., 2007) Ans: 0.607102
3
AU4. Obtain the positive root of 2 x  3 x  6  0 that lies between 1 and
2 by using Newton’s-Raphson method.
(May/June, 2007(EEE)) Ans: 1.7838

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
14 UNIT I : Solution of Equations and Eigenvalue Problems
Topic 4 : Solution of linear system by Gaussian elimination method
Gauss elimination method:
Step1: Write the augmented matrix for the given system of
simultaneous equations
 a11 a12 a13 b1 
 a21 a22 a23 b2 
a 
 31 a32 b33 b3 
Step2: Using elementary row operations reduce the given
matrix into an upper–triangular matrix say
 c11 c12 c13 d1 
 0 c22 c23 d 2 
 0 0 c33 d3 

.in
Step3: By back substitution we get the values for unknowns.
Topic 5 : Solution of linear system by Gaussian Jordan method
Gauss Jordan method:

ing
Step1: Write the augmented matrix for the given system of
simultaneous equations
 a11 a12 a13 b1 
eer
 a21 a22 a23 b2 
a 
 31 a32 b33 b3 
gin

Step2: Using elementary row operations reduce the given


matrix into a diagonal matrix say
 c11 0 0 d1    c11 0 0   diagonal matrix  
 0 c22 0 d 2    
En

  
 0   Here  0 c22 0  is a  or  
 0 c d 3
33
     
  0 0 c33   unit matrix  
arn

Step3: By direct substitution we get the values for unknowns.


(Note: Gauss elimination and Gauss Jordan methods are direct methods.)
Part A:
Le

8. For solving a linear system AX = B, compare Gauss elimination


method and Gauss Jordan method.
w.

Sol:
9. Gauss elimination method Gauss Jordan method
Coefficient matrix is transmitted Coefficient matrix is transmitted
ww

into upper triangular matrix into diagonal matrix or unit matrix


Direct method Direct method
Obtain the solution by back No need of back substitution
substitution method method
State the two difference between direct and iterative
methods for solving system of equations.
Sol: Direct Method Iterative Method
It gives exact value It gives only approximate value
Simple, takes less time Time consuming and labourious
This method determine all the This method determine only one
roots at the same time root at a time

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
15 .

Part B:
Eg.22.Solve the system of equations by (i) Gauss elimination method (ii)
Gauss Jordan method
3 x1  2 x2  3 x3  6
x1  x2  x3  1
2 x1  5 x2  4 x3  5
Sol: The given system of equations can be written as
x1  x2  x3  1
3 x1  2 x2  3 x3  6
2 x1  5 x2  4 x3  5
Given system of the form AX = B
(i) Gauss elimination method:

.in
The augmented matrix form is
 1 1 1 1 

ing
 A | B    3 2 3 6
 2 5 4 5 
eer
 1 1 1 1 
R  R2  3R1
∼  3  3 2  3 3  3 6  3 2
R  R3  2 R1
gin

 2  2 5  2 4  2 5  2  3
1 1 1 1 
∼ 0 1 0 3
En

0 3 2 3 
arn

1 1 1 1 

∼ 0 1 0 3  R3  R3  3R2
0 3  3 2  0 3  9 
Le

1 1 1 1 
∼ 0 1 0 3
w.

0 0 2 12 
ww

By back substitution to find the solution of the system of equations


2 x3  12  x3  6
 x2  3  x2  3
x1  x2  x3  1  x1  2
  2, 3, 6  is the solution for the system of equations.
(ii) Gauss–Jordan method:
The augmented matrix form is

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
16 UNIT I : Solution of Equations and Eigenvalue Problems
 1 1 1 1 
   3 2 3 6
A | B 
 2 5 4 5 
 1 1 1 1 
R  R2  3R1
∼  3  3 2  3 3  3 6  3 2
R  R3  2 R1
 2  2 5  2 4  2 5  2  3
1 1 1 1
∼ 0 1 0 3
0 3 2 3 
1 1 1 1

.in
∼ 0 1 0 3 R2  R2   1

ing
0 3 2 3
1  0 1  1 1 0 1 3 
R  R1  R2
∼  0 3  1
eer
1 0
R  R3  3R2
 0 3  3(1) 2  3(0) 3  3(3)  3
1 0 1 4 
gin

∼ 0 1 0 3 
0 0 2 12 
En

1 0 1 4 
R
∼ 0 1 0 3  R3  3
arn

2
0 0 1 6 
1 0 0 2 
Le

∼ 0 1 0 3  R1  R1  R3
0 0 1 6 
w.

 x1  2, x2  3, x3  6   x1 , x2 , x3    2,3,6 
ww

CW23. Solve the system of equation by (i) Gauss elimination method (ii)
Gauss Jordan method
28 x  4 y  z  32  x, y, z    0.99359,1.50697,1.84855
x  3 y  10 z  24
2 x  17 y  4 z  35 {Sol: }
HW24. Solve the system of equation by (i) Gauss elimination method (ii)
Gauss Jordan method
pqrs2  p, q, r , s   1, 0, 1, 2 
p  q  3r  2 s  6
2 p  3q  r  2 s  7
p  2q  r  s  2 { Sol: }

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
17 .

AU5. Solve the given system of equations by Gauss elimination method:


 x1  x2  10 x3  35.61,10 x1  x2  x3  11.19, x1  10 x2  x3  20.08
(Nov./Dec. 2008(ECE))
AU6. Solve by Gauss Jordan method, the following system
10x + y − z = 11.19; x + 10y + z = 20.08; − x + y + 10z = 35.61.
(Nov./Dec., 2009(ECE))
AU7. Apply Gauss Jordan method to solve the equations
x + y + z = 9; 2x − 3y + 4z = 13; 3x + 4y + 5z = 40.
11 19 59
x  ,y  ,z 
(Nov./Dec., 2007) Ans: 12 6 12
AU8. Using Gauss-Jordon method, solve the following system of
equations 2x − y + 3z = 8; − x + 2y + z = 4; 3x + y − 4z = 0

.in
(Nov./Dec., 2007(EEE)) Ans: x = 2, y = 2, z = 2

ing
Topic 6 : Gauss-Seidel method(Iterative method):
Step1: Let the system of equations be
a11 x  a12 y  a13 z  b1
eer
a21 x  a22 y  a23 z  b2
a31 x  a32 y  a33 z  b3 with diagonally dominant
Step2: The above system should write into the form
gin

1
x  b1  a12 y  a13 z  ...(1)
a11
1
 b2  a21 x  a23 z  ...(2)
En

y
a22
1
z  b3  a31 x  a32 y  ...(3)
arn

a33
 0  0
Step3: Start with the initial values y  0, z  0 for y, z and get
Le

x  from the first equation.


1

x  
1

1

b1  a12 y    a13 z  
0 0
w.

 (1) becomes a11


1  0 1
ww

Step4: Using this x in (2), we use z for z and x for x


 0
instead of x , we get

 (2) becomes
y  
1 1

a22
1

b2  a21 x   a23 z  
0

1 1
Step5: Substitute x , y for x, y in the third equation.

 (3) becomes
z  
1 1

a33
1

b3  a31 x   a32 y  
1

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
18 UNIT I : Solution of Equations and Eigenvalue Problems
Step5: To find the values of unknowns, use the latest available
r r r
values on the right side. If x , y , z are the rth iterate
values, then the next iteration will be
x  
r 1
1
a11

b1  a12 y    a13 z  
r r

y  r 1
 
1
a22

b2  a21 x   a23 z  
r 1 r

z  r 1
 1
a33
b3  a31 x   a32 y  
r 1

r 1

Step6: This process of continued until the convergence is


confirmed.

.in
Part A:
10. Write the first iteration values of x, y, z when the equations
27 x  y  z  8, x  1 y  2 z  72, x  y  z  110 are solved by

ing
Gauss–Seidel method.
Sol:
eer
1 85
x   85  6 y  z  
27 27 = 3.14815 [putting y = z = 0]
1 1
y   72  6 x  2 z   72  6  3.14815   2  0    3.54074
gin

15 15
[putting x= 3.14815 , z = 0]
En

1 1
z  110  x  y   110  3.14815  3.54074  20.66222
5 5
[putting x = 3.14815 , y = 3.54074 ]
arn

Part B:
Eg.25. Solve by Gauss-Seidel iterative method
Le

x  y  54 z  110
27 x  6 y  z  85
6 x  15 y  2 z  72
w.

Sol: This can be written in diagonally dominant matrix as


27 x  6 y  z  85  (1)
ww

6 x  15 y  2 z  72  (2)
x  y  54 z  110  (3)
1
(1)  x  85  6 y  z   (4)
27
1
(2)  y   72  6 x  2 z   (5)
15
1
(3)  z  110  x  y   (6)
54

Iteration 1:

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
19 .

Put y  z  0 in (4)
1
(4)  x  85  6  0   0   3.14815
27 
 1
(5)  y  72  6  3.14815   2  0    3.54074
15
1
(6)  z  110  3.14815  3.54074   1.91317
54
Iteration 2: [Substitute the latest values of x, y, z in (4), (5), (6)]
1
x 85  6  3.54074   1.91317   2.43218
27 
1
y  72  6  2.43218   2 1.91317    3.57204

.in
15
1
z  110  2.43218  3.57204  1.92585
54

ing
1
Iteration 3: x 85  6  3.57204   1.92585  2.42569
27 
1
eer
y  72  6  2.42569   2 1.92585    3.57294
15
1
z  110  2.42569  3.57294  1.92595
gin

54
1
Iteration 4: x 85  6  3.57294   1.92595  2.42549
27 
En

1
y  72  6  2.42549   2 1.92595    3.57301
15
1
z  110  2.42549  3.57301  1.92595
arn

54
1
Iteration 5: x 85  6  3.57301  1.92595  2.42548
27 
Le

1
y  72  6  2.42548   2 1.92595    3.57301
15
w.

1
z  110  2.42548  3.57301  1.92595
54
ww


Solution is  x, y, z    2.42548, 3.57301, 1.92595 
Note : Iterations of the above given problem are given as follows:
Iteration x y z
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
CW.26. Solve by Gauss-Seidel iterative method

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
20 UNIT I : Solution of Equations and Eigenvalue Problems
8 x  3 y  2 z  20
6 x  3 y  12 z  35
4 x  11 y  z  33
Sol:  x, y, z    3.016,1.985, 0.911
HW.27. Apply Gauss–Seidel method to solve the system of equations
20 x  y  2 z  17,3x  20 y  z  18, 2 x  3 y  20 z  25
Sol:  x, y, z    0.999969  1, 1.0000064  1,1.000002  1
AU9. Solve the following system by Gauss- Seidal method :
28x + 4y − z = 32; x + 3y + 10z = 24; 2x + 17y + 4z = 35
(May./June, 2007)Ans: x=0.9936,y=1.507,z=1.8486
AU10.By using Gauss-Seidel method, solve the system of equations
6x + 3y + 12z = 35; 8x − 3y + 2z = 20; 4x + 11y − z = 33.

.in
(May./June, 2007(EEE))
AU11.By using Gauss-Seidel iteration method, solve the following

ing
system of equations upto four decimals.
10x − 2y − z − w = 3; −2x + 10y − z − w = 15;
−x − y + 10z − 2w = 27; − x − y − 2z + 10w = −9.
eer
(Nov./Dec, 2009(IT))Ans: x = 3.017, y = 1.986, z = 0.91

Topic 7 : Inverse of a matrix by Gauss Jordan Method:


gin

Given Matrix An  n ,
Row
 An n | I n n  ~  I n  n | A1n  n 
 
En

Form Operations
Part A:

 
arn

1 3
11. Find the inverse of a matrix 2 7 by Gauss–Jordan method.
1 3:1 0 
Le

Sol: Consider [A | I] =  2 7:0 1 


∼ 1 3: 1 0  R2  R2  2 R1
w.

0 1: 2 1 
∼ 1 0: 7 3 R1  R1  3R2
0 1: 2 1 
ww

 A1   7 3
 2 1 

Part B:
Eg.28.Using Gauss–Jordan method, find the inverse of the matrix
1 0 1
3 4 5 
 
0 6 7 

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
21 .

1 0 1
A   3 4 5 
Sol: Let 0 6 7 
1 0 1 1 0 0
Consider  A | I    3 4 5 0 1 0  Apply R2  R2  3R1
0 6 7 0 0 1 
 1 0 1 1 0 0 

∼ 3  3 1 4  3  0  5  3  1 0  3 1 1  3  0  0  3  0  
 0 6 7 0 0 1 
1 0 1 1 0 0 

.in
R
∼ 0 4 8 3 1 0  R2  2
4
0 6 7 0 0 1 
1 0 1 1 0 0
∼ 0 1 2 3 / 4 1 / 4 0  R3  R3  6  R2  ing
eer
0 6 7 0 0 1 
1 0 1 1 0 0 
gin

 
∼ 0 1 2 3 / 4 1/ 4 0 
0 6  6 1 7  6  2  0  6  3 / 4  0  6 1 / 4  1  6  0  
En

1 0 1 1 0 0
R
∼ 0 1 2 3 / 4 1 / 4 0  R3  3

5
arn

0 0 5 9 / 2 3 / 2 1 
1 0 1 1 0 0 
R1  R1  R3
∼ 0 1 2 3 / 4 1 / 4 0 
Le

R  R2  2  R3 
0 0 1 9 / 10 3 / 10 1 / 5 2
w.

 1 0 00 1  1 1 9 / 10  0 3 / 10  01 / 5  


 
∼ 02  0  12  0  22 1  3 / 4 2  9 / 10  1 / 4 2  3 / 10  02 1 / 5  
ww

 0 0 1 9 / 10 3 / 10 1 / 5 
1 0 0 1 / 10 3 / 10 1 / 5 
∼ 0 1 0 21 / 20 7 / 20 2 / 5   I | A1 
 
0 0 1 9 / 10 3 / 10 1 / 5 
 1 3 1
1 
 A1   21/ 2 7 / 2 4 
10
 9 3 2 

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
22 UNIT I : Solution of Equations and Eigenvalue Problems
1 1 3
 1 3 3
CW.29. Find the inverse of a matrix  2 4 4  by Gauss–Jordan
1 12 4 6 
A1   5 1 3
4  1 1 1
method. Soln. :
HW.30. Using Gauss–Jordan method, find the inverse of the matrix
2 2 6  12 4 6 
 2 6 6  1 
 
1
A  1 5 3
56 
 4 8 8 Soln. :  5 3 1
1 2 1

.in
4 1 0 
AU12.Find the inverse of the matrix  2 1 3  by using Gauss–Jordan

ing
 1/ 5 1/ 3 1/ 15
A1   4 / 5 1/ 3 4 / 15 
method. (M/J,'07(EEE)) Ans:  2 / 5 1/ 3 7 / 15 
eer
AU13.Find the inverse of the matrix by Gauss-Jordan method:
4 1 2   4 / 3 2 7/3 
gin

A   2 3 1 A1   5 / 3 2 8 / 3 
1 2 2  (M/,'07) Ans:  7 / 3 3 10 / 3
En

Topic 8 : Eigen value of a matrix by power method(Iterative method)


Suppose a given square matrix is A.
arn

1 
X1   0 
Let 0  be an arbitrary initial eigen vector of the matrix A.
Le

 value1   numerically largest value   1 


AX1  value2    of matrix A say  value2 / value1  1  X 2 
 value3    
value1   value3 / value1
w.

 value1   numerically largest value   value1/ value2 


AX 2  value2    of matrix A say  1   2  X 3 
ww

  value3 / value2 
 value3   value2  

AX n  n  X n 1   If n =n 1 and X n 1  X n  2 are same
AX n 1  n 1  X n  2  upto required decimals, then stop iteration.

Dominant eigen value = n  or  n 1 and the corresponding


eigen vector = X n  or  X n 1

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
23 .

To find the smallest eigen value of A


 1 
Y1  0 
Form B = A – I & 0  be an arb. eigen vector of the matrix B.
 value1   numerically largest value   1 
BY1  value2    of matrix B say  value2 / value1  1 Y2 
   value3 / value1
 value3   value1  
 value1   numerically largest value   value1/ value2 
BY2  value2    of matrix B say  1   2 Y3 
 value3   value2  value3 / value2 
 

.in
BYn  n Yn 1   If n =n 1 and Yn 1  Yn  2 are same
BYn 1  n 1 Yn  2  upto required decimals, then stop iteration.

ing
Smallest eigen value of B
 
 The smallest eigen value of A =   Dominant eigen value of A
eer
To find third eigen value of A:
1  2  3  Sum of the main diagonal elements
gin

Part A:
12. What type of eigen value can by obtained by using power method.
Sol: We can obtain dominant eigen value of the given matrix
En

13. Write down all possible initial vectors of a matrix 2 x 2 order.


T T T
Sol: The initial vectors are (0,1) ,(1,0) ,(1,1) .
arn

A   4 1
14. Find the dominant eigen value of 1 3 by power method
1
Le

upto two decimals and choose 1 as the initial eigen vector.
X1  1
w.

Sol: Let 1


AX1   4 1 1  5   5  1 
ww

 5X 2
1 3 1  4  0.8
AX 2   4 1  1    4.8  4.8  1   4.8 X 3
1 3 0.8 3.4  0.71
AX 3   4 1   1    4.71   4.71  1   4.71X 4
1 3 0.71 3.13 0.67 
AX 4   4 1   1    4.67   4.67  1   4.67 X 5
1 3 0.67  3.01  0.65

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
24 UNIT I : Solution of Equations and Eigenvalue Problems
AX 5   4 1  1    4.65  4.65  1   4.65 X 6
1 3 0.65  2.95 0.63
AX 6   4 1   1    4.63   4.63  1   4.63 X 7
1 3 0.63  2.89  0.62 
AX 8   4 1   1    4.62   4.62  1   4.62 X 8
1 3 0.62   2.86  0.62 

 The eigen value = = 4.62 and
 1 
the corresponding eigen vector = X = 0.62 
Part B:
Eg.31.Find the dominant eigen value and eigen vector of the matrix
 4 5

.in
 1 2  by power method.
1 
X1   

ing
Sol: Let 0  be an arbitrary initial eigen vector.

 4 5 1   4  1   5  0    4   1 
eer
AX1            4    4 X 2 , say
 1 2  0   1  1   2  0    1   0.25
4 5  1    41   5 0.25   2.75   2.75  1   2.75 X
gin

AX 2 
 1 2  0.25  1  1   2   0.25  0.5  0.18182 3
 
 4 5  1   3.0909   1 
En

AX 3          3.0909    3.0909 X 4
1 2   0.18182   0.63636    0.20588 
 4 5  1   2.9706   1 
arn

AX 4          2.9706    2.9706 X 5
1 2   0.20588  0.58824   0.06666 
 4 5  1   3.6667   1 
Le

AX 5     0.06666    0.86668    3.6667  0.23637   3.6667 X 6


 1 2      
 4 5  1   2.81815  1 
w.

AX 6         2.81815    2.81815 X 7
1 2   0.23637   0.52726   0.18709 
 4 5  1   3.06455  1 
ww

AX 7         3.06455    3.06455 X 8
1 2   0.18709   0.62582   0.19579 
 4 5  1   3.02105  1 
AX 8         3.022105    3.022105 X 9
 1 2   0.19579   0.60842   0.20133
Dominant Eigen value =  = –3 and the corresponding
 1  1 
Eigen vector = X =  0.19529   0.2 

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
25 .

CW.32. Find by power method, the largest eigen value and the
1 3 1
3 2 4
corresponding eigen vector of the matrix  1 4 10  .
 0.02404 
0.42582 
Sol: Dom. Eigen value = = 11.72 and Eigen vector = X =  1 
1 6 1 
1 2 0 
Eg.33. Find all the eigen values of the matrix 0 0 3  by power method.
Sol: Dominant Eigen value =  = 4
Smallest Eigen value = X = –1

.in
Other Eigen value = 3
AU14. Obtain by power method the numerically largest eigen value of the
 15 4 3   

ing
 10 12 6 
matrix  20 4 21 (N/D., 2007) Ans: = −19.977 −20
eer
1 2 3 
0 4 2 
AU15. Find the all eigen values of the matrix by power method 0 0 7 
gin

(Nov./Dec., 2007(EEE)) Ans:  = −4, 1, 7


AU16. Find the dominant Eigen value and the corresponding Eigen vector
1 6 1  
En

1 2 0 
of the matrix 0 0 3 (May./June, 07)Ans: = −1, 3, 4
arn

AU17. Find, by power method, the largest eigen value and the eigen vector
 25 1 2 
 1 3 0
of the matrix  2 0 4  (May./June, 2007(EEE))
Le

Ans:  = 25.1821 ; X = (1, 0.0451, 0.0685)T


w.

AU18. Solve by power method, to find the dominant Eigen value for the
1 1 3 
1 5 1
ww

following matrix 3 1 1 (Nov./Dec., 2009(ECE)) Ans: =


AU19. Determine, by power method, the largest eigenvalue of the matrix
 2 1 0  
 1 2 1
 0 1 2  (Nov./Dec., 2009(IT)) Ans: =

Topic9: Eigenvalue of a matrix by Jacobi method for symmetric matrix


For a given symmetrical matrix A, find a dominant element aij in
off–diagonal element(i.e., element not in diagonal),
Change element elements as

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
26 UNIT I : Solution of Equations and Eigenvalue Problems
aij =  sin  , a ji = sin  , aii  a jj  cos 
Change the remaining diagonal elements as 1
Change the remaining off–diagonal elements as 0
 The first rotation matrix is
i th col. j th col.
1 0 0 ⋯ 0 ⋯ 0 ⋯ 0
0 1 0 ⋯ 0 ⋯ 0 ⋯ 0
⋮ 
th 0 0 0 ⋯ cos  ⋯  sin 
S1  i row ⋯ 0
⋮ ⋮ ⋮ 
th
j row  0 ⋯ ⋯ ⋯ sin  ⋯ cos  ⋯ 0
⋮ 
0 ⋯ ⋯ ⋯ 0 ⋯ 0 ⋯ 1 

.in
1  2aij 
 tan 1   , if aii  a jj

ing
2  aii  a jj 


    , if a  0 
 4 ij 
eer
   , if aii  a jj
 4 , if aij  0 
Use 
gin

 
  
Here 4 4
T
and form transformation as B1  S1 A S1
En

If B1  
a diagonal matrix, then S1 is its corresponding vector.
not a diagonal matrix, then form seond rotation matrix S2 .
arn

T
and form transformation as B2  S 2 A S2

a diagonal matrix, then S2 is its corresponding vector.


Le

If B2 
not a diagonal matrix, then form seond rotation matrix S3 .

w.

continue till Bn as diagonal matrix with


eigen values as its diagonal elements.
ww

Now eigen vectors obtained as follows:


Form S  S1S2 S3 ...Sn with columns as eigen vectors of
eigen values.
Part A:
15. Using Jacobi’s method find the eigne values and eigen vectors of
1 2 
 2 1  .
1 2 
Sol: Let A =  2 1 
The largest off–diagonal element a12  a21  2

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
27 .

S1  cos   sin  
The rotation matrix  sin  cos  
a11  a22 

Since , we have 4
  
cos 4  sin 4  1/ 2 1/ 2 
S1   
   1/ 2 1/ 2 
 sin cos 
  4 4 
Then the transformation gives
   
B1  S1 A S1   1/ 2 1/ 2  1 2  1/ 2 1/ 2    3 0 
T
 1/ 2 1/ 2  
 2 1 
 1 / 2 1/ 2  0 1

.in
This is a diagonal matrix. So, the eigen values are 3, –1 and the
corresponding eigen vectors are the columns of S1 i.e.,

ing
1/ 2   1/ 2 
1/ 2  ,  1/ 2 
   .
eer
1 5 2
 5 4 7 
gin

16. Using Jacobi’s method find the rotation matrix of  2 7 4  .


1 5 2
 5 4 7 
En

Sol: Let A =  2 7 4 
The numerically largest off–diagonal element a23  a32  7
arn

1 0 0 
S1  0 cos   sin  
The rotation matrix 0 sin  cos  
Le
w.

Part B:
Eg.34.Find all the eigen values and eigen vectors of the matrix
ww

 1 2 2 
A 2 3 2
 
 2 2 1 
by Jacobi method.
Sol: Given matrix is symmetric matrix.
Numerically largest element in off diagonal element is 2 in a13 &
in a31 so multiply with  sin  & sin  and other elements
a11 & a33 are both multiplied by cos  remaining diagonal a22
with ‘1’ and a12 , a21 , a23 , a32 with ‘0’.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
28 UNIT I : Solution of Equations and Eigenvalue Problems
cos  0  sin  
 Suitable orthogonal matrix is S1   0 1 0 
 sin  0 cos  
1  2a13  1 1  2  2   1   
 tan 1    tan    
2  a11  a33  2  11  2  2  4
cos  / 4  0 sin  / 4   1 / 2 0 1 / 2 
 S1   0 1 0  0 1 0 
 sin  / 4  0 cos  / 4   1 / 2 0 1 / 2 
   
 1/ 2 0 1/ 2   1 2 2  1/ 2 0 1/ 2 
Now B1  S1T AS1   0 1 0  2 3 2  0 1 0 
 1/ 2 0 1/ 2   2 2 1

1/ 2 0 1/ 2 
    

.in
3 2 0 
 2 3 0 

ing
 0 0 1
cos   sin  0 
Here S2   sin  cos  0 
 0 1 
eer
0
1  2a12  1 1  2  2   1 1  
Now   tan 1    tan       
1
  tan 
2 a  a
 11 22  2  3  3  2 2 2  4
gin

1/ 2 1/ 2 0 
 S2  1/ 2 1/ 2 0 
 0 1 
En

0
 
 1/ 2 1/ 2 0   3 2 0  1/ 2 1/ 2 0 
arn

B2  S2T B1S2   1/ 2 1/ 2 0   2 3 0  1/ 2 1/ 2 0 


 0 0 1   0 0 1  0 0 1 
   
5 0 0
Le

 0 1 0  , a diagonal matrix with 5,1, 1 as eigen values


0 0 1
w.

To find Eigen vectors:


ww

X1 X2 X3
1/ 2 0 1/ 2  1/ 2 1/ 2 0   1/ 2 1/ 2 1/ 2 
S1S2   0 1 0  1/ 2 1/ 2 0   1/ 2 1/ 2 0 
1/ 2 0 1/ 2   0 0 1   1/ 2 1/ 2 1/ 2 
 
     
1/ 2   1/ 2   1/ 2 
 Eigen vectors are X1  1 / 2  , X 2  1/ 2  , X 3  0 
1/ 2   1/ 2  1/ 2 
     
for corresponding eigen values 5,1, 1.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
29 .

CW.35. Find all the eigen values and eigen vectors of the matrix
1/ 2 1 2 
A 1 3/ 2 1 
 
 2 1 1/ 2 
by Jacobi method.
Sol: Eigen values = 5 / 2, 1/ 2,  1/ 2 and
 1 / 2   1 / 2   1 / 2 
1 / 2  , 1 / 2  ,  0 
 1 / 2   1 / 2   1 / 2 
Eigen vectors =      
HW.36. Find all the eigen values and eigen vectors of the matrix
 2 1 1 
A   1 2 1

.in
 1 1 2  by Jacobi method.
Sol: Eigen
Corresponding eigen vectors

ing
Values
1,4,1 1/ 6  1   1/ 3   1  1   1/ 2   1
 2 / 6  or  2  ,  1/ 3  or  1  ∼  1 ,  0  or  0 
eer
             
1/ 6  1   1/ 3   1  1   1/ 2   1 
gin
En
arn
Le
w.
ww

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
30 UNIT I : Solution of Equations and Eigenvalue Problems

Unit I : Assignments Problems

1. Solve the equation 3 x  cos x  2  0 by iteration method.


Sol: x = 0.879
2. Solve the equation 2 x  log x  7 by iteration method.
Sol: x = 3.789
3. Find Newton’s iterative formula for the reciprocal of a number N
1
and hence find the value of23 , correct to five decimal places.
Ans: x = 0.04347
4. Use Newton’s method to find the real root of 3x − cos x − 1 = 0.

.in
Ans: 0.607102
5. Solve the system of equation by (i) Gauss elimination method (ii)
Gauss Jordan method

ing
3 x1  2 x2  3 x3  6
x1  x2  x3  1
2 x1  5 x2  4 x3  5
eer
Sol:  x1 , x2 , x3    2,3,6 
6. Solve the given system of equations by (i) Gauss elimination
gin

method (ii) Gauss Jordan method


 x1  x2  10 x3  35.61,10 x1  x2  x3  11.19, x1  10 x2  x3  20.08
7. Solve the following system by Gauss- Seidal method :
En

28x + 4y − z = 32; x + 3y + 10z = 24; 2x + 17y + 4z = 35


Ans: x=0.9936,y=1.507,z=1.8486
arn

8. By using Gauss-Seidel method, solve the system of equations


6x + 3y + 12z = 35; 8x − 3y + 2z = 20; 4x + 11y − z = 33.
1 2 1
Le

4 1 0 
9. Find the inverse of the matrix  2 1 3  by using Gauss–Jordan
w.

 1/ 5 1/ 3 1/ 15


A1   4 / 5 1/ 3 4 / 15 
method. Ans:  2 / 5 1/ 3 7 / 15 
ww

10. Find the inverse of the matrix by Gauss-Jordan method:


4 1 2   4 / 3 2 7/3 
A   2 3 1 A1   5 / 3 2 8 / 3 
1 2 2  Ans:  7 / 3 3 10 / 3
11. Obtain by power method the numerically largest eigen value of the
 ≃
 15 4 3 
 10 12  6 
matrix  20 4 21 Ans: = −19.977 −20

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
31 .

12. Find the all eigen values of the matrix by power method
1 2 3  
0 4 2 
0 0 7  Ans: = −4, 1, 7
13. Find the dominant Eigen value and the corresponding Eigen vector
1 6 1  
1 2 0 
of the matrix 0 0 3 Ans: = −1, 3, 4
14. Find all the eigen values and eigen vectors of the matrix
 1 2 2 
A 2 3 2
 

.in
 2 2 1 
by Jacobi method.
Sol: Eigen values = 5, 1, –1 and

ing
 1 / 2   1 / 2   1 / 2 
1 / 2  , 1 / 2  ,  0 
 1 / 2   1 / 2   1 / 2 
Eigen vectors =      
eer
15. Find all the eigen values and eigen vectors of the matrix
1/ 2 1 2 
gin

A 1 3/ 2 1 
 
 2 1 1/ 2 
by Jacobi method.
En

Sol: Eigen values = 5 / 2, 1/ 2,  1/ 2 and


 1 / 2   1 / 2   1 / 2 
1 / 2  , 1 / 2  ,  0 
arn

 1 / 2   1 / 2   1 / 2 
Eigen vectors =      
16. Find all the eigen values and eigen vectors of the matrix
Le

 2 1 1 
A   1 2 1
 1 1 2  by Jacobi method.
w.

Sol: Eigen values = 1, 4, 1 and


ww

1/ 6   1/ 3   1/ 2 


 2 / 6  ,  1/ 3  ,  0 
   
1/ 6   1/ 3   1/ 2 
Eigen vectors = 

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
1MA8491 Numerical Methods .

UNIT II: INTERPOLATION AND APPROXIMATION


Lagrangian Polynomials – Divided differences – Interpolating with a cubic
spline – Newton’s forward and backward difference formulas.

Topic 1 : Lagrangian Polynomials(Equal and unequal intervals)


Lagrange’s interpolation formula(x given, finding y in terms of x)
Let y =f(x) be a function which takes the values y = y0, y1,…, yn
corresponding to x = x0, x1,…, xn.
( x  x1 )( x  x2 )… ( x  xn )
y  y ( x)  f ( x)  y0
( x0  x1 )( x0  x2 )… ( x0  xn )
( x  x0 )( x  x2 )… ( x  xn )

.in
 y1  …
( x1  x0 )( x1  x2 )… ( x1  xn )
( x  x0 )( x  x1 )… ( x  xn 1 )

ing
 yn
( x2  x0 )( x2  x1 )… ( x  xn 1 )
Inverse Lagrange’s interpolation formula(y given, finding x in
eer
terms of y)
( y  y1 )( y  y2 )… ( y  yn )
x  x( y )  f ( y )  x0
( y0  y1 )( y0  y2 )… ( y0  yn )
gin

( y  y0 )( y  y2 )… ( y  yn )
 x1  …
( y1  y0 )( y1  y2 )… ( y1  yn )
En

( y  y0 )( y  y1 )… ( y  yn 1 )
 xn
( y2  y0 )( y2  y1 )… ( y  yn 1 )
arn

Note:
Lagrange’s interpolation formula can be used for
equal and unequal intervals.
Le

Part A:
1. What is the assumptions we make when Lagrange’s formula is
used?
w.

Sol: Lagrange’s interpolation formula can be used whether the


values of x, the independent variable are equally spaced or not
ww

whether the difference of y become smaller or not.


2. What is the disadvantage in practice in applying Lagrange’s
interpolation formula?
Sol: Though Lagrange’s formula is simple and easy to
remember, its application is not speedy. It requires close attention
to sign and there is always a chance of committing some error due
to a number of positive and negative signs in the numerator and the
denominator.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
2 UNIT II: Interpolation And Approximation

3. What is ‘inverse interpolation’?


Sol: Suppose we are given a table of values of x and y. Direct
interpolation is the process if finding the values of y corresponding
to a value of x, not present in the table. Inverse interpolation is the
process of finding the values of x corresponding to a value of y, not
present in the table.
4. Construct a linear interpolating polynomial given the points
( x0 , y0 ) and ( x1, y1 ).
( x  x1 ) ( x  x0 )
y  y ( x)  f ( x)  y0  y1
Sol: ( x0  x1 ) ( x1  x0 )
5. What is the Lagrange’s formula to find ‘y’ if three sets of values

.in
( x0 , y0 ),( x1 , y1 ) and ( x2 , y2 ) are given.
( x  x1 )( x  x2 ) ( x  x0 )( x  x2 ) ( x  x0 )( x  x1 )

ing
y y0  y1  y2
Sol: ( x0  x1 )( x0  x2 ) ( x1  x0 )( x1  x2 ) ( x2  x0 )( x2  x1 )
6. Find the second degree polynomial fitting the following data:
eer
x 1 2 4
Sol: y 4 5 13 Here x0 =
1, x1 = 2, x2 =4
gin

y0 = 4, y2 = 5, y3 = 13
By Lagrange’s formula for three points is
( x  x1 )( x  x2 ) ( x  x0 )( x  x2 ) ( x  x0 )( x  x1 )
y y0  y1  y2
En

( x0  x1 )( x0  x2 ) ( x1  x0 )( x1  x2 ) ( x2  x0 )( x2  x1 )
( x  2)( x  4) ( x 1)( x  4) ( x 1)( x  2)
y (4)  (5)  (13)
arn

(1  2)(1  4) (2 1)(2  4) (4 1)(4  2)


( x 2  6 x  8) ( x 2  5 x  4) ( x 2  3 x  2)
y (4)  (5)  (13)
Le

(1)(3) (1)(2) (3)(2)


( x 2  6 x  8) ( x 2  5 x  4) ( x 2  3 x  2)
 (4)  (5)  (13)
w.

3 2 6
1
 8 x 2  48 x  64  15 x 2  75 x  60  13 x 2  39 x  26 
6 
ww

1 2
 6 x  12 x  30 
6 
 y  f ( x)  x 2  2 x  5
Part B:
Eg.1. Using Lagrange interpolation formula, find f(4) given that
f (0)  2, f (1)  3, f (2)  12, f (15)  3578.
Sol:
Given x x0  0 x1  1 x2  2 x3  15
y0  2
y = f(x) y1  3 y2  12 y3  3587
Lagrange interpolation formula is

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
3MA8491 Numerical Methods .

( x  x1 )( x  x2 )( x  x3 ) ( x  x0 )( x  x2 )( x  x3 )
y y0  y1
( x0  x1 )( x0  x2 )( x0  x3 ) ( x1  x0 )( x1  x2 )( x1  x3 )
( x  x0 )( x  x1 )( x  x3 ) ( x  x0 )( x  x1 )( x  x2 )
 y2  y3
( x2  x0 )( x2  x1 )( x2  x3 ) ( x3  x0 )( x3  x1 )( x3  x2 )
(4 1)(4  2)(4 15) (4  0)(4  2)(4 15)
f  4   2   3
(0 1)(0  2)(0 15) (1  0)(1  2)(1 15)
(4  0)(4 1)(4 15) (4  0)(4 1)(4  2)
 12    3587 
(2  0)(2 1)(2 15) (15  0)(15 1)(15  2)
(3)(2)( 11) (4)(2)( 11)
  2   3
( 1)(  2)( 15) (1)(1)( 14)
(4)(3)( 11) (4)(3)( 2)
 12    3587 
(2 )(1)( 13) (15)(14)(13)

.in
 77.99  78
CW.2. Find polynomial f(x) by using Lagrange formula from the given

ing
data and find f(8).
x 3 7 9 10
f(x) 168 120 72 63
eer
Sol: Lagrange polynomial f(x) = x3 – 21 x2 + 119 x – 27.
y(x = 8) or y(x = 8) or f(x = 8) = 93
HW.3. Use Lagrange’s formula to fit a polynomial to the data
gin

x –1 0 2 3
y = f(x) – 8 3 1 12
and hence find y(1).
En

Sol: Lagrange polynomial f(x) = 2 x3 – 6 x2 + 3 x + 3.


y(x = 1) = y(x = 1) = f(x = 1) = 2.
arn

Eg.4. Using Lagrange’s formula, prove that


y1  y3  0.3( y5  y3 )  0.2( y3  y5 ).
Sol: From the equation, the values of x are
Le

x0  5 x1  3 x2  3 x3  5
y0  y5 y1  y3 y2  y3 y3  y5
w.

The x values are not equally space, so use Lagrange’s


formula to find y = f(x). Lagrange’s formula for a set of 4 pair of
values is
ww

( x  x1 )( x  x2 )( x  x3 ) ( x  x0 )( x  x2 )( x  x3 )
y  yx  f  x   y0  y1
( x0  x1 )( x0  x2 )( x0  x3 ) ( x1  x0 )( x1  x2 )( x1  x3 )
( x  x0 )( x  x1 )( x  x3 ) ( x  x0 )( x  x1 )( x  x2 )
 y2  y3
( x2  x0 )( x2  x1 )( x2  x3 ) ( x3  x0 )( x3  x1 )( x3  x2 )
( x  3)( x  3)( x  5) ( x  5)( x  3)( x  5)
 y5  y3
(5  3)(5  3)(5  5) (3  5)(3  3)(3  5)
( x  5)( x  3)( x  5) ( x  5)( x  3)( x  3)
 y3  y5
(3  5)(3  3)(3  5) (5  5)(5  3)(5  3)

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
4 UNIT II: Interpolation And Approximation

Put x  1, we get
(1  3)(1  3)(1  5) (1  5)(1  3)(1  5)
y1  y5  y3
(5  3)(5  3)(5  5) (3  5)(3  3)(3  5)
(1  5)(1  3)(1  5) (1  5)(1  3)(1  3)
 y3  y5
(3  5)(3  3)(3  5) (5  5)(5  3)(5  3)
 0.2 y5  0.5 y3  y3  0.3 y5
 0.2 y5  0.2 y3  0.3 y3  y3  0.3 y5
y1  y3  0.3( y5  y3 )  0.2( y3  y5 )
CW.5. Find the age corresponding to the annuity value 13.6 from the
given table
Age (x) 30 35 40 45 50
Annuity value (y) 15.9 14.9 14.1 13.3 12.5

.in
Sol: x13.6 or (y = 13.6) = 43
HW.6. Find x for which y = 7, given

ing
x 1 3 4
y 4 12 19
Sol: x(y = 7) = 1.8572
eer
Anna University Questions:
AU1. Use Lagrange formula to calculate f(3) from the following table.
x 0 1 2 4 5 6
gin

f(x) 1 14 15 5 6 19
(Anna Univ. Nov./Dec., 2007(EEE)) Ans: f(3) = 10
AU2. Find the Lagrange’s polynomial of degree 3 to fit the data :
En

y(0) = −12, y(1) = 0, y(3) = 6 and y(4) = 12. Hence find y(2).
(M/J, 2007) Ans: f(x) = x3 − 7x2 + 18x − 12; y(2) = 4
arn

AU3. From the given table, the values of y are consecutive terms of a
series of which 23.6 is the 6th term. Find the first and tenth terms of
the series.
Le

x 3 4 5 6 4 5 6
y 4.8 8.4 14.5 23.6 36.2 52.8 73.9
w.

1
(N/D, 2007) Ans: y(x) = 12 [x3 + 3x2 − 14.8x + 48];
ww

y(1) = 3.1; y(10) = 100


AU4. Find the missing term in the following table using Lagrange’s
interpolation.
x 0 1 2 3 4
y 1 3 9 – 81
Ans: 31
AU5. Find the value of x corresponding to y = 100 from the table.
x 3 5 7 9 11
y 6 24 58 108 174
Ans: 8.656

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
5MA8491 Numerical Methods .

Topic 2 : Divided Difference (Equally and unequally spaced intervals)


First divided difference for arguments x0 , x1 :
f ( x1 )  f ( x0 )
 f ( x0 , x1 )   f ( x0 )  [ x0 , x1 ](or )[ x1 , x0 ]   f ( x1 )
x1  x0 x1 x0

First divided difference for arguments x1 , x2 :


f ( x2 )  f ( x1 )
 f ( x1 , x2 )   f ( x1 )  [ x1 , x2 ](or )[ x2 , x1 ]   f ( x2 )
x2  x1 x2 x1

Second divided difference for arguments x0 , x1 , x2 :


 f ( x1 )   f ( x0 )
x2 x1
 f ( x0 , x1 , x2 )   2 f ( x0 )  [ x0 , x1 , x2 ]

.in
x2  x0 x2 x1

Second divided difference for arguments x1 , x2 , x3 :

ing
 f ( x2 )   f ( x1 )
x3 x2
 f ( x1 , x2 , x3 )   2 f ( x1 )  [ x1 , x2 , x3 ]
x3  x1
eer
x3 x2

Third divided difference for arguments x0 , x1 , x2 , x3 :


 2 f ( x1 )   2 f ( x0 )
gin

x3 x2 x2 x1
 f ( x0 , x1 , x2 , x3 )  3 f ( x0 )  [ x0 , x1 , x2 , x3 ]
x3  x0 x3 x2 x1
En

Third divided difference for arguments x1 , x2 , x3 , x4 :


 2 f ( x2 )   2 f ( x1 )
x4 x3 x3 x2
 f ( x1 , x2 , x3 , x4 )  3 f ( x1 )  [ x1 , x2 , x3 , x4 ]
arn

x4  x1 x4 x3 x2
Properties of divided differences:
Le

1. The divided difference are symmetric functions of their arguments.


 f ( x)   f ( y )
For example, y x
w.

 2 f ( x)   2 f ( y )   2 f ( z )
yz xz xy
ww

2. The nth divided differences of a polynomial of degree n are


constants.
3. The divided difference operator(  ) is a linear operator.
[ f ( x)  g ( x)]  [ f ( x)]  [ g ( x)]
and [cf ( x)]  c[ f ( x)] , c is constant.
Part A:
 2 x3  x  y  z
7. Prove that yz .
3
Sol: Given the function f ( x)  x and the arguments are x,y,z.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
6 UNIT II: Interpolation And Approximation
f ( y )  f ( x) y  x3 ( y  x)( x 2  xy  y 2 )
3
 f ( x)     x 2  xy  y 2
y yx yx yx
 f ( y )  y 2  yz  z 2
Similarly, z
 f ( y )   f ( x)
2 z y y 2  yz  z 2  ( x 2  xy  y 2 )
Now  f ( x)  
yz zx zx
2 2
z  x  yz  xy ( z  x)( z  x)  y ( z  x)
   x yz
zx zx
1 1
 3    
8. Show that bcd a
  abcd .

.in
1 1
f ( x)  , f (a) 
Sol: If x a

ing
1 1

1 f (b)  f (a ) b a 1
f (a, b)     
b a ba ba ab
eer
1 1 1 1
f (b, c)     , f (c, d )    
Similarly, c b bc d c cd
gin

1 1 1 1
    
21 c b b b bc ab a  c 1
f (a, b, c)      
bc a ca ca abc(c  a ) abc
En

1 1
f (b, c, d )   2 
Similarly, cd b bcd
arn

1 1 1 1
 2   2 
1
f (a, b, c, d )   3  cd b bc a  bcd abc
 bcd a d a d a
Le

ad 1
 
abc(d  a ) abcd
w.

Part B:
Eg.7. Construct the divided difference table for the following data and find
ww

the value f(2).


x 4 5 7 10 11 12
y = f(x) 50 102 296 800 1010 1224
Sol: Newton’s divided difference formula is
f  x   f  x0    x  x0  f  x0 , x1    x  x0   x  x1  f  x0 , x1 , x2 
  x  x0   x  x1  x  x2  f  x0 , x1 , x2 , x3  

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
7MA8491 Numerical Methods .

Newton’s divided difference table is


f ( x)  2 f ( x) 3 f ( x)  4 f ( x) 5 f ( x)
x f(x)     
f  x0 , x1  f  x0 , x1 , x2  f  x0 ,x1 ,x2 ,x3  f  x0 ,x1 ,x2 ,x3 ,x4  f  x0 ,x1,x2 ,x3 ,x4 ,x5 
4 50
102  50
 52
54

9752
5 102  15
74

296102 14.215
 97  0.133
75 10  4

.in
16897 .617.133
7 296  14.2  .069
10  5 11  4

ing
800296 10.514.2 .158.069
 168  .617  .011
10  7 11  5 12  5

210168 1.7.617
eer
10 800  10.5  .158
11  7 12  5

1010800 210.5
 210  1.7
gin

11  10 12  7
214210
11 1010  2
12  10
En

12241010
 214
12  11
arn

12 1224
f  x   50   x  4   52    x  4   x  5  15    x  4   x  5  x  7   0.133
  x  4   x  5  x  7   x  10   0.069 
Le

  x  4   x  5  x  7   x  10   x  11  0.011
f  x  2   50   2  4   52    2  4   2  5 15    2  4   2  5  2  7  0.133
  2  4   2  5  2  7  2  10  0.069 
w.

  2  4   2  5  2  7  2  10  x  11 0.011
 49.19
ww

CW.8. If f(0) = 0, f(1) = 0, f(2) = –12, f(4) = 0, f(5) = 600, f(7) = 7308,
find a polynomial that satisfies this data using Newton’s devided difference
formula. Hence find f(6), f(–1).
3 2
Sol: f(x) = x( x  1)[ x  2 x  13x  20]
f(6) = 2580 , f(–1) = 60

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
8 UNIT II: Interpolation And Approximation

HW.9. Find the third divided difference with arguments 2,4,9,10 of the
function f(x) = x3 – 2x.
Sol: Form divided difference table.
AU6. If f(0) = f(1) = 0, f(2) = −12, f(4) = 0, f(5) = 600 and f(7) = 7308, find
a polynomial that satisfies this data using Newton’s divided
difference interpolation formula. Hence, find f(6)
(Anna Univ. May./June, 2007) Ans: f(6) = 2580
AU7. Given the values
x 5 7 11 13 17
f(x) 150 392 1452 2366 5202
Evaluate f(9) using Newton’s divided difference formula.
(N/D, 2007) Ans: f(x) = x3 − x2 + 24x − 70; f(9) = 794

.in
AU8. Using Newton’s divided difference interpolation, find the
polynomial of the given data

ing
x –1 0 1 3
f(x) 2 1 0 –1
1
eer
(Anna Univ. Nov./Dec., 2007) Ans: f(x) = 24 [x3 − 25x + 24]
gin
En
arn
Le
w.
ww

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
9MA8491 Numerical Methods .

Topic 3 : Interpolating with a cubic spline


The cubic spline interpolation formula is
1
S ( x)  y ( x)  y  [( xi  x)3 M i 1  ( x  xi 1 )3 M i ]
6h
1 h2 1 h2
 ( xi  x)[ yi 1  M i 1 ]  ( x  xi 1 )[ yi  M i ]
h 6 h 6
6
M i 1  4M i  M i 1  2 [ yi 1  2 yi  yi 1 ]
where h
n = number of data
i = number of intervals [ i.e., i = 1,2,3,…, (n – 1)]
h = length f interval = interval length.
''
Note: If M i and yi values are not given, then assume

.in
M 0  M n  0 [or y ''  y ''  0] M , M ,..., M n 1
0 n , and find 1 2

ing
in 1st interval,2nd interval,…, (n–1)th interval value.
Part A:
9. What is a cubic spline?
eer
Sol: A cubic spline which has continuous slope and curvature
is called a cubic spline.
10. What is a natural cubic spline?
gin

Sol: A cubic spline fitted to the given data such that the end
cubics approach linearity at their extremities is called a
natural cubic spline.
En

11. State the conditions required for a natural cubic spline.


Sol: A cubic spline g(x) fits to each of the points is continuous
arn

and is continuous in slope and curvature such that


M 0  S0  g0' ' ( x0 )  0 and M n  Sn  g n' ' 1 ( xn )  0 is
called a natural cubic spline. Let us assume that
Le

( xi , yi ), i  0,1, 2,..., n are data points.


12. What are the advantages of cubic spline fitting?
w.

Sol: Cubic spline provide better approximation to the behavior


of functions that have abrupt local changes. Further,
ww

spline perform better than higher order polynomial


approximation.
13. Write the end conditions on M i (x) in natural cubic spline.
Sol: M 0 ( x)  0, M n ( x)  0.
14. Write the relation between the second derivatives M i (x) in cubic
splines with equal mesh spacing.
6
M i 1  4M i  M i 1  2 [ yi 1  2 yi  yi 1 ]
Sol: h ,i = 1,2,…,n – 1.
Or
6
M i 1  4 M i  M i 1  [ fi 1  2 fi  fi 1 ]
h2 ,i = 1,2,…,n – 1.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
10 UNIT II: Interpolation And Approximation

Part B:
Eg.10. Find the cubic spline approximation for the function f(x) given by
the data:
x 0 1 2 3
y = f(x) 1 2 33 244
with M 0  0  M 3. Hence estimate the value f(1.5),f(2.5).
{AU2010}
Sol: We know that cubic spline interpolation formula for
xi 1  x  xi , i  1, 2,3. is
Si  x   y  x   y 
1 
  xi  x 3 M i1   x  xi1 3 M i 

.in
6h 
1  h2 
  xi  x   yi 1  M i 1 

ing
h  6 
1  h2 
  x  xi 1   yi  Mi   (1)
h  6 
eer
6
where Mi 1 +4Mi  Mi 1 = 2  yi 1  2 yi  yi 1   (2)
h
gin

h  number of data  4
i  number of intervals  3 i.e., i  1, 2,3.
h  length of inteval  1
En

Given M 0  M 2  0, so find M1 , M 2 .
Suppose M i or yi" values are not given, then assume M 0  M 3  0 
arn

 and find M1 , M 2 . 
 
To find M1 , M 2 :
Le

6
When i  1, (2)  M 0  4 M1  M 2   y0  2 y1  y2 
12
 0  4 M1  M 2  6 1  2  2   33
w.

 4 M1  M 2  180  (3)
6
When i  2, (2)  M1  4 M 2  M 3  2  y1  2 y2  y3 
ww

1
 M1  4 M 2  0  6  2  2  2   244
 4 M1  M 2  180  (4)
Solving  3 &  4  ,  3  4 M1  M 2  180
4   4   4 M1  16 M 2  4320
 15M 2  4140
 M 2  276
 3  4 M1  180  276  M1  24

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
11 .

To find Cubic spline:


When i  1,
Cubic spline in xi 1  x  xi
i.e., x0  x  x1
i.e., 0  x  1
i.e., Cubic spline in 0  x  1 is
1 
y1  x   S1  x    x1  x 3 M 0   x  x0 3 M1 
6 1 
1  1  1  1 
  x1  x   y0  M 0    x  x0   y1  M1 
1  6  1  6 
1 3 3 
   
  1  x 0  x  0 24    
6
 1  x  1  0   x  0   2   24 

.in
 4 x3  1  x   6 x
 4 x3  5 x  1

ing
When i  2,
Cubic spline in xi 1  x  xi
i.e., x1  x  x2
eer
i.e., 1  x  2
i.e., Cubic spline in 1  x  2 is
1 
y2  x   S 2  x     x2  x 3 M1   x  x1 3 M 2 
gin

61 
1  1  1  1 
  x2  x   y1  M1    x  x1   y2  M 2 
1  6  1  6 
En

1
  2  x   24    x  1  276  
3 3
6
 1   1 
  2  x   2   24     x  1 33   276  
arn

 6   6 
3 3
 4  2  x   46  x  1  6  2  x   13  x  1
 50 x3  162 x 2  162 x  53
Le

When i  3,
Cubic spline in xi 1  x  xi
w.

i.e., x2  x  x3
i.e., 2  x  3
i.e., Cubic spline in 2  x  3 is
ww

1 
y3  x   S3  x    x3  x 3 M 2   x  x2 3 M 3 
6 1 
1  1  1  1 
  x3  x   y2  M 2    x  x2   y3  M 3 
1  6  1  6 
1 3 
  3  x   276   0 
6
 1 
  3  x  33   276     x  2   244  0
 6 
 46  27  x3  9 x 2  27 x   13  3  x   244 x  488
 46 x3  414 x 2  985 x  715

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
12 UNIT II: Interpolation And Approximation

 Cubic spline is
 S1 ( x)  y1 ( x)  4 x3  5 x  1, 0  x 1

S ( x)   S2 ( x)  y2 ( x)  50 x3  162 x 2  167 x  53, 1  x  2
 S3 ( x)  y3 ( x)  46 x3  414 x 2  985 x  715, 2  x  3

When x  1.5,
3 2
y2 ( x  1.5)  S2 ( x  1.5)  50 1.5   162 1.5   167 1.5   53
 1.75,
When x  2.5,
3 2
y3 ( x  2.5)  S3 ( x  2.5)  46  2.5   414  2.5   985  2.5   715
 121.25
CW.11. From the following table .

.in
x 1 2 3
y = f(x) –8 –1 18

ing
' '
Find cubic spline and compute y(1.5), y (1), y (2.5) and y (3).
 S ( x)  y1 ( x)  3( x  1)3  4 x  12, 1  x  2
S ( x)   1
eer
3
Sol:  S2 ( x)  y2 ( x)  3(3  x)  22 x  48, 2  x  3
&
gin

45
y ( x  1.5)  S1 ( x  1.5)   , y ' ( x  1)  S1' ( x  1)  4
8
y ( x  2.5)  S2 ( x  2.5)  7.375, y ' ( x  3)  S2' ( x  3)  22.
En

HW.12. Fit a natural cubic spline for the following data: {AU2008}
x 0 1 2 3
arn

y = f(x) 1 4 0 –2
Sol: Assume M 0  0  M 3.
Le

 S1 ( x)  y1 ( x)  2 x3  5 x  1, [0,1]

S ( x)   S2 ( x)  y2 ( x)  3 x3  15 x 2  20 x  4, [1,2]
w.

 S3 ( x)  y3 ( x)   x3  9 x 2  28 x  28, [2,3]

Anna University Questions:
ww

AU9. Find the cubic Spline interpolation. (N/D, 2007)


X 1 2 3 4 5
f(x) 1 0 1 0 1
Sol: Assume M 0  0  M 4 .
 S1 ( x)  y1 ( x )  2  x, 1 x  2
 1 3 2
 S2 ( x)  y2 ( x )  [ 5 x  45 x  123 x  106], 2 x3
 7
f ( x)  S ( x)   1 3 2
S ( x)  y3 ( x )  [6 x  72 x  275 x  332], 3 x4
 3 7
 1
 S4 ( x)  y4 ( x )  [ 5 x3  75 x 2  363 x  772], 4 x5
 7

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
13 .

AU10.Given the following table, find f(2.5) using cubic spline functions :
x 1 2 3 4
(Anna Univ. f(x) 0.5 0.3333 0.25 0.2 May./June,
2007) Ans: S2(2.5) = 0.2829
AU11.Fit the st.line for the data. (Anna Univ. May/June, 2007)
x 0 1 2 3
f(x) 1 2 9 28

 4 3 4
 y1 ( x)  5 x  5 x  1, 0  x 1
 1
f ( x)   y2 ( x)  [10 x3  18 x 2  19 x  1, 1 x  2
5

.in
 102 2 333 159
 y3 ( x)  2 x3  x  x , 2 x3
 5 5 5

ing
Topic 4 : Newton’s forward and backward difference formulas
*[Uniform (or) equal intervals only] *
eer
Newton’s forward interpolation difference formula:
[if y(required x near to x0 ) = ? and use  ]
gin

y ( x)  f ( x)  f ( x0  uh)
u u (u  1) 2 u (u  1)(u  2) 3
= y0  y0   y0   y0  ...
1! 2! 3!
En

x  x0
u ,
where h h = length of interval
arn

Newton’s backward interpolation difference formula:


[if y(required x near to xn ) = ? and use  ]
y ( x)  f ( x)  f ( xn  vh)
Le

v v(v  1) 2 v(v  1)(v  2) 3


 yn  yn   yn   yn  ...
1! 2! 3!
x  xn
w.

v ,
where h h = length of interval
ww

Part A:
15. What advantage has Lagrange’s formula over Newton?
Sol: The forward and backward interpolation formulae of
Newton can be used only when the values of the independent
variable x are equally spaced can also be used when the
differences of the dependent variable y become smaller
ultimately. But Lagrange’s interpolation formula can be used
whether the values of x, the independent variable are equally
spaced or not and whether the difference of y become smaller
or not.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
14 UNIT II: Interpolation And Approximation
16. Derive Newton’s forward difference formula by using operator
method. [or] Derive Gregory – Newton forward difference
interpolation formula.

.in
ing
eer
gin
En
arn
Le
w.
ww

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
15 .

Sol: Pn  x   Pn  x0  uh   E u Pn  x0   E u y0
 1    y0
u

u u (u  1) 2 u (u  1)(u  2) 3
= y0  y0   y0   y0  ...
1! 2! 3!
x  x0
u
where h
17. Derive Newton’s backward difference formula by using
operator method.
Sol: Pn  x   Pn  x0  vh   E v Pn  xn   E v yn
v 1
 1    yn where E  1   

.in
 v(v  1) 2 v(v  1)(v  2) 3 
 1  v      ...  yn

ing
 2! 3! 
v v(v  1) 2 v(v  1)(v  2) 3
 yn  y n   yn   yn  ...
1! 2! 3!
eer
x  xn
v ,
where h
gin

18. When will we use Newton’s forward interpolation formula?


Sol: The formula is used to interpolate the values of y near
the beginning of the table values and also for
En

extrapolating the values of y short distance ahead (to


the left) of y0.
19. When Newton’s backward interpolation formula is used?
arn

Sol: The formula is used mainly to interpolate the values of


y near the end of a set of tabular values and also for
extrapolating the values of y short distance ahead (to
Le

the right) of yn.


Part B:
w.

Eg.13.Using New ton’s forward interpolation formula, find the cubic


polynomial which takes the following values
x 0 1 2 3
ww

y = f(x) 1 2 1 10
Evaluate f(4). {AU 2000, 2009}
Sol: WKT, Newton forward formula to find the polynomial in x.
There are only 4 data given.Hence the polynomial will be degree 3.
Newton’s forward formula is
y ( x)  f ( x)  f ( x0  uh)
u u (u  1) 2 u (u  1)(u  2) 3
= y0  y0   y0   y0  ...
1! 2! 3!
x  x0
u ,
where h h = length of interval

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
16 UNIT II: Interpolation And Approximation

Newton’s divided difference table


x y  f ( x) y 2 y 3 y
x0  0 y0  1
2 1  1
x1  1 y1  2 1  1  2
1 2  1 10   2   12
x2  2 y2  1 9   1  10
10  1  9
x3  3 y3  10
x   x  x  1   x  x  1 x  2   

.in
f  x  1 1  2  12
1! 2! 3!
 2 x3  7 x 2  6 x  1

ing
When x  2,
f (4)  41
CW.14. The population of a city in a census takes once in 10 years is
eer
given below. Estimate the population in the year 1955.
Year 1951 1961 1971 1981
gin

Population in lakhs 35 42 58 84
Sol: y ( x  1955)  f ( x  1955)  36.784
HW.15. From the table given below find sin 52 by using Newton’s
En

forward interpolation formula.


x 45  50  55  60 
arn

y = sin x 0.7071 0.7660 0.8192 0.8660


Sol: y ( x  52)  sin 52  0.788 approximately.
Eg.16.From the data given below find the number of students whose
Le

weight is between 60 and 70.


Weight in lbs 0–40 40–60 60–80 80–100 100–120
w.

Number of students 250 120 100 70 50


Sol: Let weight be denoted by x and
number of students be denoted by y, y = f(x).
ww

Use Newton's forward formula to find y where x lies


between 60 – 70.
Newton's forward formula is
y ( x)  f ( x)  f ( x0  uh)
u u (u  1) 2 u (u  1)(u  2) 3
= y0  y0   y0   y0  ...
1! 2! 3!
We rewrite the table as cumulative table showing the number of
students less than x lbs.
x Below 40 Below 60 Below 80 Below 100 Below 120
y 250 370 470 540 590
Newton's forward difference table:

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
17 .

x y  f ( x) y 2 y 3 y 4 y
Below 40 250
120
Below 60 370 –20
100 –10
Below 80 470 –30 20
70 10
Below 100 540 –20
50
Below 120 590
x  x0 x  40 70  40
u  x  70, u   1.5
20

.in
Here h 20 , When
1.5 1.5(1.5  1) 1.5(1.5  1)(1.5  2)
y ( x  70)  250  120    20    10 
1! 2! 3!

ing
1.5(1.5  1)(1.5  2)(1.5  3)
  20 
4!
 423.59  424
eer
 Number of students whose weight is 70  424
 Number of students whose weight is between 60  70  424  370  54.
CW17. Use Newton’s backward difference formula to construct as
gin

interpolating polynomial of degree 3 for the data.


f(– 0.75) = – 0.07181250, f(– 0.5) = –0.024750,
1
En

f ( ).
f(– 0.25) = 0.33493750, f(0) = 1.10100. Find 3
3 2
y ( x)  x  4.001x  4.002 x  1.101 f ( ) 1
arn

Sol: , 3 = 0.174518518
HW.21. From the following data, find  at x  43 and x = 84.
Le

x 40 50 60 70 80 90
 184 204 226 250 276 304
Also express  in terms of x.
w.

Sol:  ( x  43)  189.79 (by Newton;s forward formula)


 ( x  84)  286.96 (by Newton;s backward formula)
ww

 ( x)  0.01x 2  1.1x  124 (by Newton;s forward formula)


AU12. Find a polynomial of degree two for the data by Newton’s forward
difference method :
x 0 1 2 3 4 5 6 7
f(x) 1 2 4 7 11 16 22 29
1 2
[ x  x  2]
(Anna Univ. May./June, 2007) Ans: y(x) = 2

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
18 UNIT II: Interpolation And Approximation

Unit II Assignment problems:


1. Find the missing term in the following table using Lagrange’s
interpolation.
x 0 1 2 3 4
y 1 3 9 – 81
Ans: 31
 f ( )  0.3887 
d
f ( )  
0 sin 2 
1
2. Find the value of given where 2
 21 23 25
using the table f   0.3706 0.4068 0.4433

.in
Sol:  = 22.0020
3. Using Newton’s divided difference formula find f(x) and f(6) from the

ing
following data : (M/J, 2007(EEE))
x 1 2 7 8
eer
f(x) 1 5 5 4
1
Ans:f(x) = 42 [3x3 − 58x2 + 321x − 224]; f(6) = 6.2381
gin

4. Using Newton’s divided difference formula, find the value of f(8)


and from the following table:
x 4 5 7 10 11 13
En

f(x) 48 100 294 900 1210 2028


(Anna Univ. Nov./Dec., 2007(EEE)) Ans: f(8) = 448
arn


(0, 0), ( ,1) & ( , 0)
5. Given the points 2 satisfying the function
y  sin x(0  x   ) 
Le

y( )
, determine the value of 6 using the cubic
spline approximation. [ Assume M 0  0  M 2. ]
w.

2  2 3 3        
S ( x)   x  x  , 0,  y    S    0.4815
  2 2   2 &   6 6
ww

Sol:
6. Fit the cubic spline for the following data:
x 0 1 2 3
y = f(x) 1 2 9 28
Sol: Assume M 0  0  M 3.
 4 3 x
 S1 ( x)  y1 ( x)  5 x  5  1, [0,1]
 1
S ( x)   S2 ( x)  y2 ( x)  (10 x3  18 x 2  19 x  1, [1,2]
 5
1
 S3 ( x)  y3 ( x)  (14 x3  126 x 2  269 x  191, [2,3]
 5

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
19 .

7. From the following table, find the value of (tan45o15’) by Newton’s


forward interpolation formula.
xo 45 46 47 48 49 50
tan x o 1.00000 1.03553 1.07237 1.11061 1.15037 1.19175
(M/J, 2007(EEE)) Ans: f(45o15’) = 1.00876
8. Given:
x 1 2 3 4 5 6 7 8
f(x) 1 8 27 64 125 216 343 512
Estimate f(7.5). Use Newton’s formula.
(Anna Univ. Nov./Dec., 2007(EEE)) Ans: f(7.5) = 421.87

9. The hourly declination of the moon on a day is given below. Find the

.in
h m s h
declination at 3 35 15 and 5 .

ing
Hour 0 1 2 3 4
Declination 82953.7 81819.4 8643.5 7556.1 74327.2

Ans:    
y 3h35m15s  74815, y 5h  1.00876
eer
gin
En
arn
Le
w.
ww

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
20 UNIT II: Interpolation And Approximation

.in
ing
eer
gin
En
arn
Le
w.
ww

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
21 .

.in
ing
eer
gin
En
arn
Le
w.
ww

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
1MA2264 Numerical Methods .

Unit III NUMERICAL DIFFERENTIATION AND INTEGRATION


Differentiation using interpolation formulae –Numerical integration by
trapezoidal and Simpson’s 1/3 and 3/8 rules – Romberg’s method – Two
and Three point Gaussian quadrature formulae – Double integrals using
trapezoidal and Simpsons’s rules.

Numerical Differentiation Numerical Integration


1. Newton’s forward difference 6. Trapezoidal rule [n =1 in

.in
formula to compute derivatives Quadrature formula]
(Equal interval)

ing
2. Newton’s backward difference 7. Simpson’s one third rule
formula to compute derivatives [n = 2 in Quadrature formula]
(Equal interval)
eer
3. Lagrange’s Interpolation 8. Simpson’s three eighth rule
formula [n = 3 in Quadrature formula]
(Equal or unequal intervals)
gin

4. Newton’s divided difference 9. Romberg’s method


Interpolation formula
(Equal or unequal intervals)
En

5. Maxima and minima of a 10. Two point Gaussian’s


tabulated function quadrature formula
11. Three point Gaussian’s
arn

quadrature formula
12. Double integrals by
Trapezoidal rule
Le

13. Double integrals by Simpson’s


rule
w.

NUMERICAL DIFFERENTIATION:
ww

Given y  y  x   f  x  [in a table]


dy
 y  x   f   x 
dx is the first numerical derivative
d2y
 y   x   f   x 
dx 2 is the second numerical derivative
n
d y
n
 y1⋯n  x   f 1⋯n  x 
dx is the nth numerical derivative

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
2 Unit III – Numerical Differentiation and Integration

Topic 1: Newton’s forward difference formula to compute derivative


WKT, Newton’s forward difference interpolation formula is
u u  u  1 2 u  u  1 u  2  3
y  x   f  x0  uh   y0  y0   y0   y0
1! 2! 3!
u  u  1 u  2  u  3 4
  y0  ...
4!
u u2  u 2 u 3  3u 2  2u 3
 y0  y0   y0   y0
1! 2! 3!
u 4  6u 3  11u 2  6u 4
  y0  ...

.in
4!
x  x0
u

ing
where h
First derivative :
dy dy du dy  1  1 dy
eer
   
dx du dx du  h  h du
dy 1   2u  1  2  3u 2  6u  2  3
gin

i.e.,   y0     y0     y0
dx h   2   6 
 4u 3  18u 2  22u  6  4 
En

   y0  ...
 24  
 
arn

 dy  1 1 1 1 
 dx  at   y0   2 y0  3 y0   4 y0  ......
  x  x0  h 2 3 4 
u  0 
Le

Second derivative :
d 2 y d  dy  d  dy du  d  1 dy 
      
w.

dx 2 dx  dx  dx  du dx  dx  h du 
1 d  1 dy  1 d 2 y
ww

 
h du  h du  h 2 du 2
1   12u 2  36u  22  4 
 2   2 y0   u  1 3 y0     y0  ......
h   24  
 
d2y 1  2 22 
 2  2 
 y0  3 y0   4 y0  .....
 dx  atx  x0  h  24 
u  0 

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
3MA2264 Numerical Methods .

Third derivative :
d3y 1  3  24u  36  4 
3
 3 
 y0     y0  .....
dx h   24  
d3y  1  3 36 
 3  3 
 y0   4 y0  .....
 dx  at x  x0  h  24 
u  0 

Topic 2: Newton’s backward difference formula to compute derivatives


WKT, Newton’s forward difference interpolation formula is
v  v  1 2 v  v  1 v  2  3

.in
v
y  x   f  xn  vh   yn  yn   yn   yn
1! 2! 3!
v  v  1 v  2  v  3 4

ing
  yn  ...
4!
v  v2  v  2  v3  3v 2  2v  3
eer
 yn  yn     yn     yn
1!  2!   3!
   
 v  6v  11v  6v  4
4 3 2
gin

   yn  .....
 4!
 
First derivative :
En

dy dy dv dy  1  1 dy
    a
dx dv dx dv  h  h dv
arn

1  2v  1  2  3v 2  6v  2  3
   yn     yn     yn
h   2   3! 
Le

 4v3  18v 2  22v  6  4 


   yn  ...
 
w.

 4!  
 dy  1 1 2 6 
 yn   2 yn  3 yn   4 yn  ...
ww

 dx  at x  x0  h 2 3! 4! 
u 0 
Second derivative :
d2y 1  2  6v  6  3  12v 2  36v  22  4 
   y     y     y  ...
dx 2 h 2 
n
 3! 
n  4!  n

 
d2y 1  2 6 22 
 2  2 
 yn  3 yn   4 yn  ...
 dx  atx  x0  h  3! 4! 
u  0 

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
4 Unit III – Numerical Differentiation and Integration

Third derivative :
d3y 1 6 3  24v  36  4 
3
 3  3!
 yn     yn  .....
dx h   4!  
d y
3
1 6 3 36 
 3  3  3!
 yn   4 yn  .....
 dx  atx  x0  h  4! 
u  0 

Topic 3: Maxima and Minima of a tabulated function


(If the intervals are same)
WKT, Newton’s forward difference interpolation formula is

.in
u u  u  1 2 u  u  1 u  2  3
y  y0  y0   y0   y0  ...

ing
1! 2! 3!
First derivative :
dy 1  2u  1 2 3u 2  6u  2 3 
  y0   y0   y0  ...  1
eer
dx h  2! 3! 
substitute h, y0 , 3 y0 ,  4 y0 , ... gives the equation
gin

dy u   2

dx an equation in
En

For maxima or minima is obtained by the equation by


dy
 0 (or) y   x  =0
arn

dx
Put RHS of (1) =0, find u  u1 , u2 , ...
d2y
Le

2
Find dx from (2),

 d2y 
w.

 2  
 dx at u
Suppose 1 ve
ww

 u is maximum point with y  u   maximum value of y


1 1

 d2y 
Suppose  2   + ve  u2 is minimum point with
 dx 
 at u2
y  u2  = minimum value of y

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
5MA2264 Numerical Methods .

Examples on Numerical Differentiation


Eg (1) : The following data gives the velocity of a particle for 20 seconds at
an interval of 5 seconds.
Time
0 5 10 15 20
(sec)
Velocity
0 3 14 69 228
(m/sec)
Find (a) Initial acceleration using the entire data
(b) Final acceleration
Solution : The difference table is

.in
Time Velocity y  x  2 y  x  3 y  x  4 y  x 
t=x v =y(x)

ing
0  x0  0  y  0  
3  y  0  
eer
5 3 8  2 y  0 
 
36  3 y  0  
gin

11  
 4 y  0 
 
En

10 14 44 24   or  
 4 
  yn 
arn

55 
60 3 yn 
 
Le

15 69 104  2 yn

159  yn 
w.

20 228  yn 
ww

Here x0  0 , h = interval length = 5


dv
(a) WKT, acceleration = dt = rate of change of velocity
 dv 
 
To find initial acceleration, put  dt t 0
ie., initial acceleration exists at t  0  x0 [which is nearer to beginning of
the table], so we use Newton’s forward difference formula for first
derivative.
 Newton’s forward difference interpolation formula is

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
6 Unit III – Numerical Differentiation and Integration
u u  u  1 2
y  x   f  x0  uh   y0  y0   y0
1! 2!
u  u  1 u  2  3
  y0  ...
3!
Now, Newton’s forward difference formula for first derivative
at x  x0  0  u  0 ,
 dv  1 1 1 1 
y   x0       y0   2 y0  3 y0   4 y0  ...
ie., dt
 t  0 h  2 3 4 
[Here h = 5]
1 1 1 1 
 3   8    36    24    1

.in
5 2 3 4 
 y  0  1

ing
 2
Initial acceleration (acceleration when t = 0) is 1 m/sec .
(b) Final acceleration exists at t = 20 = x4 [Nearer to ending of table], so
eer
use Newton’s backward difference interpolation formula for first derivative.
WKT, Newton’s backward difference interpolation formula is
v  v  1 2 v  v  1 v  2  3
gin

v
y  x   f  xn  vh   yn  yn   yn   yn
1! 2! 3!
v  v  1 v  2  v  3 4
En

  yn  ...
4!
1 1 2 6 
y   xn   yn   2 yn  3 yn   4 yn  ...
arn

h 2 3! 4! 
1 1 2 6 
 159  104    60    24  
Le

5 2 6 24 
1
  237   47.2 m / sec 2
w.

5
Eg (2) : Consider the following table of data :
ww

x 0.2 0.4 0.6 0.8 1.0


f(x) 0.9798652 0.9177710 0.8080348 0.636093 0.3843735
Find (1) f   0.25  using Newton’s forward difference approximation
(2) f   0.95  using Newton’s backward difference approximation
Solution : Here h = 0.2
x  x0 x  0.2 0.25  0.2
u    0.25
(1) h 0.2 0.2
 f   0.25   0.25828

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
7MA2264 Numerical Methods .

x  xn 0.95  1
u   0.25
(2) h 0.2
f   0.95   1.367948

Eg (3) : Find the value of f   8  , f   9  , maximum and minimum value


from the following data, using an approximate interpolation formula.
x 4 5 7 10 11
f (x) 48 100 294 900 1210
Solution : The values of x are unequally spaced. To find f (x), we use
Newton’s divided difference formula (or) Lagrange formula.
WKT, Newton’s Divided difference formula is
f  x   f  x0    x  x0  f  x0 , x1    x  x0   x  x1  f  x0 , x1 , x2 

.in
  x  x0   x  x1  x  x2  f  x0 , x1 , x2 , x3   ...

ing
x f(x) f  x   2 f  x  3 f  x   4 f  x 
4 48
eer
52
5 100 15
97 1
gin

7 294 21 0
202 1
10 900 27
En

310
11 1210
arn

 f  x   x3  x 2
f   x   3x 2  2 x , f   8   176
f   x   6 x  2 f   9   52
Le

,
To find maximum and minimum
w.

Put f   x   0  3x 2  2 x  0  x  0, x2
3
Now, f   x  0   6  0   2  2  0
ww

 x = 0 is a maximum pt. & maximum value is f (x= 0) =0


f   x  2 3  6  2 3  2  2  0
 x  2 3 is a minimum point & minimum value is f  x  2 3  4 / 27

HW 4 : Evaluate y  and y  at x = 2 given


x 0 1 3 6
y 18 10 – 18 40

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
8 Unit III – Numerical Differentiation and Integration
 70 2 15 187 22 
Solution :y  x   x  9 x  9 x  18, y   x  2    9 , y   x  2    9 
3
 
HW 5 : Find the value of cos (1.747) using the values given in the
table below :
x 1.70 1.74 1.78 1.82 1.86
sin x 0.9916 0.9857 0.9781 0.9691 0.9584
[Solution : 0.175]
HW 6 : Find sec 31˚ from the following data :
θ 31 32 33 34
tan θ 0.6008 0.6249 0.6494 0.6745
Solution : sec 2 31  1.3835  sec 31  1.174 
 

.in
NUMERICAL INTEGRATION

Newton-Cote’s quadrature formula is


a  nh  n n  2 n  3  ing
2 n  n  2
2 
eer
 f  x  dx  nh  1      3
 ... f a
a  2 12 24 
gin

Topic 6: Trapezoidal rule(n = 1 in quadrature formula)


h
 2  y0  yn   2  y1  y2  y3  ...  yn 1  
En

x0  nh 
x0 f  x  dx   or 
arn

h
  first term  last term   2  remaining terms  
 2  
Le

Topic 7: Simpson’s one third rule (Simpson’s 1/3 rule)


(n = 2 in quad. form.)

w.

 h  y  y   4  y  y  y  ...  2  y  y  y  ... 
3  0 n 1 3 5 2 4 6 
ww

x0  nh 
x0 f  x  dx   or 

 h  first term  last term  
 3  4  odd suffices   2  even suffices  
  

Topic 8: Simpson’s three eighth rule (Simpson’s 3/8 rule) (n=3 in q.f.)

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
9MA2264 Numerical Methods .

  y0  yn  
 3h  
  2  y3  y6  ... 
8 
   1 3 y  y 2  y 4  y5  y7  ...  
x0  nh 
x0 f  x  dx   or 

  first term  last term  
 3h  2  suffices with a multiple of 3 
8  
  3  remaining terms  
  
 b 
 I =  f  x  dx 

.in
 
Topic 9: Romberg’s method for a given interval  a 
ba

ing
when h  , by trapezoidal rule, we get I1
2
ba
when h  , by trapezoidal rule, we get I 2
eer
4
ba
when h  , by trapezoidal rule, we get I 3
gin

8
I  I 
Romberg's formula for I1 & I 2  I RM1,2  I 2  2 1
3
En

 I3  I 2 
Romberg's formula for I 2 & I 3  I RM 2,3  I 3 
3
arn

If I RM1,2  I RM 2,3 , then we can equal I  I RM1,2  I RM 2,3


Check, use actual integration, we get I AI  I  I RM1,2  I RM 2,3
Le

Topic 10: Two point Gaussian quadrature formula :


(Guass two point formula)
w.

b
Given I   f  x  dx
a
ww

Case (i) If a  1, b  1, then


1  1   1 
I  f  x  dx  f    f  
1
 3   3
Case (ii) If a  0, b  1, then
1 1 1
I   f  x  dx  f  x  dx, if f  x  is an even function
0 2 1
Case (iii) If  a  1& b  1 , then

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
10 Unit III – Numerical Differentiation and Integration
ba ba
x z  mz  c  dx  m dz
2 2
b 1 1
 I   f  x  dx   f  z  m dz  m 1 f  z  dz
a 1
  1   1 
 m f   f 
  3  3 

Topic 11: Three point Gaussian quadrature formula

1 5  3   3  8
(i) 1 f  x  dx  9 f     f     f  0 

.in
 5   5   9
1 1 1
0 f  x  dx  2 1 f  x  dx for even function f  x  

ing
(ii)

1  5   3  3  8 
  f     f     f  0  
eer
2  9   5  5   9 
(iii)  a  1 & b  1 , then
gin

ba ba
x z  mz  c  dx  m dz
2 2
 5   3  
En

b 1  3  8
 I   f  x  dx   f  z  m dz  m   f     f     f  0  
1
 9   5   5   9
a

arn

Topic 12: Double integration by trapezoidal rule


d b
c a f  x  dx dy
Le

Given

sum of values of f at the four corners   D  a, d  C  b, d 


w.

 
hk  sum of values of f at the nodes   k↕
I 2   
4  on the boundary except the corners  
ww

4 sum of the values at the interior nodes  A  a, c  B  b, c 


 

h
ba d c
where h  ,k
n m
where n is number of equal intervals in  a, b  .
where m is number of equal intervals in  c, d  .

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
11 .

Topic 13: Double integration by Simpson’s 1/3 rule


d b
Given c a f  x, y  dx dy
 
 
sum of values of f at the four corners  
 sum of values of f at the odd positions  
2   
 on the boundary except the corners  
 
4 sum of the values of f at the even positions  
 on the boudary except the corners 
 
 

.in
hk  sum of the values of f at odd positions  
I 4 
9  on the odd rows of the matrix except boundary rows  

ing
 sum of the values of f at even positions  
8   
 on the odd rows of the matrix except boundary rows  
 
eer
8 sum of the values of f at odd positions  
 on the even rows of the matrix except boundary rows  
 
gin

 sum of the values of f at even positions 


16  
 on the even rows of the matrix except boundary rows  
En

Examples on Numerical Integration


arn

2 dx

EG 7 : Compute the value of 1 x using
Le

(a) Trapezoidal rule (b) Simpson’s 1/3 rule


(c) Simpson’s 3/8 rule
w.

Solution :
Here h  0.25,
ww

1
y  f  x 
x
The tabulated values of  f  x  are
y
x0 x1 x2 x3 x4
x 1 1.25 1.50 1.75 2
1 1 1 1 1
f(x) 1  0.8  0.66667  0.57143  0.5
1 1.25 1.5 1.75 2
y0 y1 y2 y3 y4

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
12 Unit III – Numerical Differentiation and Integration
(a) WKT, Trapezoidal rule is
b x0  nh h
a f  x  dx x0 f  x  dx  2  y0  y4   2  y1  y2  y3 
2 1  0.25
    dx  1  0.5   2  0.8  0.66667  0.57143 
1 x 2 
0.25 0.25
 1.5  4.0762  5.5762
2 2
 0.697025
(b) WKT, Simpson’s 1/3 rule is
b h
a f  x  dx  3  y0  yn   4  y1  y3   2  y2 

.in
2 1  0.25
    dx  1  0.5   4  0.8  0.57143  2  0.66667  
3 

ing
1 x

 0.693255
(c) WKT, Simpson’s 3/8 rule is
eer
b 3h
a f  x  dx  8  y0  y4   3  y1  y2   2  y3 
2 1  3  0.25 
gin

i.e.,    dx  1  0.5   3  0.8  0.66667   2  0.57143 


1 x 8
 0.66024
En

By actual integration,
21
1 x dx   loge x 1   ln 2  ln1  0.69315
2
arn

dx
10

Le

CW 8 : Evaluate 0 1  x by dividing the range into 8 equal parts by


(a) Trapezoidal rule (b) Simpson’s 1/3 rule
w.

(c) Simpson’s 3/8 rule


1
Here h  1.25, y  f  x  
ww

Solution : 1 x
(a) I = 2.51368 (b) I = 2.42200 (c) I = 2.41838
Actual integration, AI = 2.39790
1
HW 9 : Evaluate 0
x e x dx
taking 4 equal intervals by
(a) Trapezoidal rule (b) Simpson’s 1/3 rule
(c) Simpson’s 3/8 rule
Solution : (a) 1.02307 (b) 1.00017 (c) 0.87468, AI = 1

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
13 .


HW 10 : Calculate 0
3
sin x dx
taking 7 ordinates (6 intervals) using
a) Trapezoidal rule (b) Simpson’s 1/3 rule
(c) Simpson’s 3/8 rule
Solution : (a) 1.33467 (b) 1.32612 (c)1.30516,AI=1.3333
2 dx
2
Eg 11 : Evaluate 0 x  4 using Romberg’s method. Hence obtain an
approximate value for π.
Solution :
To find I1
20 1
When h   1, y  f  x   2

.in
2 x 4
2 dx
Let I = 0 x 2  4
The tabulated values of y are
x 0 1 ing 2
eer
1 1
f  x  2 2
 0.25 0.2 0.125
x 4 0 4
gin

y0 y1 y2
Using Trapezoidal rule,
2 dx h
En

I1   2   y0  y2   2  y1  
0 x 4 2
1
arn

  0.25  0.125   2  0.2  


2
 0.3875
Le

To find I 2
20 1
h   0.5
w.

4 2
The tabulated values of y are
ww

x 0 0.5 1 1.5 2
1
f  x  2 0.25 0.23529 0.2 0.160 0.125
x 4
y0 y1 y2 y3 y4
Using Trapezoidal rule,
2 dx h
I2   2   y0  y4   2  y1  y2  y3  
0 x 4 2
 0.25  0.25  0.125   2  0.23529  0.2  0.160  
 0.39136

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
14 Unit III – Numerical Differentiation and Integration
To find I3
20 1
h  0.25
8 4
The tabulated values of y are
x 0 0.25 0.50 0.75 1 1.25 1.5 1.75 2

f  x 0.24 0.23 0.21 0.17 0.14


6 5 9 9 1 0.12
1 0.25 0.2 0.16
 1 2 1 1 5 5
x2  4 5 9 8 8 9
y0 y1 y2 y3 y4 y5 y6 y7 y8

.in
Using Trapezoidal rule,
dx
2 h
I3     y0  y  

ing
x2  4 2
0

 0.25  0.125  
 0.125  
 2  0.24615  0.23529  0.21918  0.2  0.17918  0.16  0.14159  
eer
 0.39237
Romberg's formula for I1 & I 2 is
gin

 I2  I1   0.39136  0.39136 
I RM1,2  I 2   0.39136 
3 3
En

= 0.39265
Romberg's formula for I 2 & I3 is
 I3  I 2   0.39237  0.39237 
arn

I RM 2,3  I3   0.39237 
3 3
= 0.39271
Le

 I RM1,2  0.3927 & I RM 2,3  0.3927


Here I RM1,2 & I RM 2,3 are almost equal and I = 0.3927  1
w.

By actual integration,
ww

x2
2 dx 1 1
0 x 2  4  2  tan x 2  x 0  2  tan 1  tan  0 
1 1 1

1  
=   0     2
24  8

From 1 &  2  ,  0.3927
8
  = 8  0.3927   3.1416

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
15 .

1 1

CW 12: Using Romberg’s method, evaluate


0 1 x
dx
correct to 3
places
of decimals.
Solution :
I1  0.7083, I 2  0.6970, I3  0.6932
I RM1,2  0.6932, I RM 2,3  0.6931
 I = 0.693

Extras 13 : A curve passes through the points (1, 2), (1.5, 2.4), (2, 2.7),
(2.5, 2.8), (3, 3), (3.5, 2.6) & (4, 2.1). Obtain Area bounded by

.in
the curve, x axis between x = 1 and x = 4. Also find the volume
of solids of revolution by revolving this area about x – axis.

ing
Solution:
b 4
WKT, Area = a y dx  1 y dx
eer
4 h
Simpson's 1 rule, Area = 1 y dx   y0  y6   4  y1  y3  y5   2  y2  y4  
3 3
= 7.783
gin

b 4
Volume =   y 2 dx    y 2 dx
En

a 1
2
To find y :
x 1 1.5 2 2.5 3 3.5 4
arn

y 2 2.4 2.7 2.8 3 2.6 2.1


y2 4 5.76 7.29 7.84 9 6.76 4.41
Le

4 2 h 
 Volume =  y dx     y0  y6   4  y1  y3  y5   2  y2  y4   
1 3 
w.

= 64.07 cubic units.


Two points Guassian quadrature formula :
ww

 1  1   1 
 1 f  x  dx  f   
  3  3 
2 dx

Eg 14 : Evaluate
1 x
by using Guassian two point formula.
b  a  z  b  a 
Solution : Here a  1, b  2  1, so use x  ,
2
x   z  3 / 2  dx  dz / 2

 The above integral becomes

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
16 Unit III – Numerical Differentiation and Integration
dx 21 dz 1 1 1
I =   dz   f  z  dz
1 x 1 z 3  1 z 3  1

 By Guassian two point formula


1  1   1 
1 f  z  dz  f  3
 f 
 3

 1   1 
  1  
 z  3 z  z  3  z  1
3 3
 0.693

.in
 2
0 log 1  x  dx
CW 15 : Using Guassian two point formula evaluate
Solution :

ing
1
I = log 1   1  z    dz
1  4  4
  1   1 
eer
   f   f  
4
  3  3 
 0.858
gin

2 dx

HW 16 : Evaluate 1 1  x
 3
by using Guassian two point formula.
En

Solution : I = 0.2544

Three points Guassian quadrature :


arn

 5  
 9  f  3 5  f

   8
3 5   f  0  
 9 
Le

2
1
 1  x3 dx
w.

Eg 17 : Evaluate 1 by using Guassian three point formula.


Solution :
b  a  z  b  a 
ww

Using the substitution x  , a  1, b  2


2
z 3
x
2
1 1 1
1  dz  1 1 8 1
I= 3  2  2 
 dz   dz
1  z 3   1  z 3
3 2 1 8   z  33
1   1  
 2   2 

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
17 .

1
4 4
  dz , f  z  
1 8   z  33 8+  z+3
3

5
  
   f  3 5  f 3 5   f  0
9  
8
9
 

5 8
  0.27505   0.11429 
9 9
 0.25439 ∵ 5  0.5555, 8  0.8888
 9 9 
I = 0.02544
11

.in
dt
CW 18 : Find t 0 by using Guassian three point formula.
Solution : I = 1.6027

ing
1 dx

Eg 19 : Evaluate
 0 1  x2
by two and three point Guassian quadrature
formula & hence find the value of  .
eer
Solution :
b  a  z  b  a  z 1 dz
x x  dx 
gin

2 2 2
1 dx 1 1 1
Now, I   
0 1  x2 1 2 2
 z 1
En

1  
 2 
1 1
arn

1
  f  z  dz , f  z   2
1 2  z 1
1  
 2 
Le

By Guassian two point formula


1  1   1 
w.

I= 1 f  z  dz  f 
  f 
3 
  0.7868
3
 1
ww

By Guassain three point formula


1 5
 8
  
I =  f  z  dz   f  3 5  f 3 5   f  0   0.7853   2 
1 9  9
1
1 dx
By actual integration, I = 0   tan 1  x  
1  x2  
0

 tan 1 1  tan 1  0    4   3


From  2  &  3 ,
0.7853   4
   3.147

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
18 Unit III – Numerical Differentiation and Integration

 2
HW 20 : Find 0
sin x dx
by two & three point Guassian quadrature
formula.
Solution :
x    z  1 4
I = 0.9985  by two point formula 
I = 1.0000  by three point formula 

Double integrals using Trapezoidal rule & Simpson’s rule :


1.4 2.4 dx dy

.in
Eg 21 : Evaluate the integral
1 2 xy using Trapezoidal rule and
Simpson’s rule. Verify your results by actual integration.

ing
1
Solution : f  x, y   , x varies from 1, 1.4 
xy
eer
y varies from  2, 2.4 
Divide the range of x and y into 4 equal parts
gin

2.4  2 1.4  1
h  0.1, k  0.1
4 4
f  x, y  at the nodal points are given in the table :
En

The values of
x
2 2.1 2.2 2.3 2.4
y
arn

1 0.5 0.4762 0.4545 0.4348 0.4167


1.1 0.4545 0.4329 0.4132 0.3953 0.3788
1.2 0.4167 0.3698 0.3788 0.3623 0.3472
Le

1.3 0.3846 0.3663 0.3497 0.3344 0.3205


1.4 0.3571 0.3401 0.3247 0.3106 0.2976
w.

By Trapezoidal rule for double integration :


ww

Sum of values of f at the four corners 


 
hk   Sum of values of f at the nodes  
I +2  
4   on the boundary except the corners  
 
 4  Sum of the values at the interior nodes  

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
19 .

 
 
 0.5  0.4167  0.2976  0.3571  
 0.1 0.1   0.4762  0.4545  0.4348  0.3788  0.3472  0.3205  

 2  
4   0.3106  0.3247  0.3401  0.3846  0.4167  0.4545  
 
 4  0.4329  0.4132  0.3953  0.3623  0.3344  
  0.3497  0.3663  0.3698  0.3788 
 
 
 0.0614
By Extended Simpson’s rule :
hk
I   Sum of the values of f at the four corners  

.in
9  
 +2 Sum of the values of f at the odd positions on the boundary except the corners  
 
 +4 Sum of the values of f at the even positions on the boundary except the corners  

ing
  Sum of the values of f at the odd positions  
 +4  
  on the odd rows of the matrix except boundary rows  
 
  Sum of the values of f at the even positions  
 +8 on the odd rows of the matrix except boundary rows 
eer

   
  Sum of the values of f at the odd positions  
 8  
  on the even rows of the matrix except boundary rows  
gin

 
 16  Sum of the values of f at the even positions  
 
  on the even rows of the matrix except boundary rows  
 0.5  0.4167  0.2976  0.3571 
En

 
 2  0.4545  0.3472  0.3247  0.4167  
 
arn

 4  0.4762  0.4348  0.3788  0.3205  0.3106  


  0.3401  0.3846  0.4545 

 0.1 0.1  
   
Le

4 0.3788 
9  
 8  0.3968  0.3623 
w.

 8  0.3497  0.4132  
 
 16  0.3663  0.3344  0.4329  0.3953 
ww

 
 
0.01
  55.2116   0.0613
9
By actual integration :
1.4 2.4 1 1.4  2.4 1  1 1.4 2.4 1
1 2 xy dx dy  1  2 x dx  y dy  1  log x 2 y dy
  log 2.4  log 2  log y 1
1.4

 0.0613

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
20 Unit III – Numerical Differentiation and Integration
 2  2
sin  x  y  dx dy
CW 22 : Evaluate 0 0 by using trapezoidal rule,
Simpson’s rule and also by actual integration.

Solution : Divide into 2 intervals (3 ordinates) on x & y


By Trapezoidal rule, I = 1.7975
Simpson’s rule, I = 2.0080
Actual integration, I = 2
0.5 0.5 sin xy
I=  0 1  xy dx dy by using Simpson’s rule with
0
HW 23 : Evaluate
step size 0.25.
Solution : I = 0.01406

.in
PART – A

ing
1. State the Romberg’s integration formula with h1 and h2 . Further, obtain
h
h1  h and h2  .
eer
the formula when 2
I1h22  I 2 h12
Solution : I  , where I1 the value of the integral with h1
h22  h12
gin

I 2 the value of the integral with h2


En

If h1  h & h2  h 2 we get
4 I 2  I1 1
I  I 2   I 2  I1 
arn

3 3
1
dx
 1  x2 .
Le

2. Use two-point Guassian quadrature formula to solve 1


Solution : Given interval is – 1 to 1 so we apply formula
w.

1
 1   1 
 f  x  dx  f  3   f  
3
ww

1
1
Here f  x  
1  x2
 1  1 1 3
f  1
 
 3  1  4  4
3  3 
 1  1 1 3
f  1
 
 3  1  4  4
3  3 

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
21 .

1
1 3 3 3
 2
dx     1.5
1 1  x
4 4 2
But actual integration
1
1 1
 1  x 2 dx   tan
1
x   tan 1 1  tan 1  1
 1
1

 tan 1 1  tan 1 1


 2 tan 1 1
 
 2
4 2

.in
 1.5708
Here the error due to two – point formula is 0.0708.

3.
ing
Write down the formulae for finding the first derivative using Newton’s
forward difference at x  x0 Newton’s backward difference at x  xn .
eer
Solution :
v v  v  1 2 v  v  1 v  2  3
y  x   yn  yn   yn   yn
gin

1! 2! 3!
v  v  1 v  2  v  3 4 x  xn
  yn , where v 
En

4! h
Here x  xn  v  0
y  x   yn
arn

y  x  h  y  x
y   x   yn  lim
h 0 h
Le

y   x   yn
w.

2
 x2
e dx
4. Evaluate 0 by two point Guassian quadrature formula.
ww

 x2
Solution : Here f (x) = e [Given range is not in exact form]
ba ba
Let x  z  Here a  0, b  2
2 2
20 20
 z
2 2
x  z 1 x  0  z  1
dx  dz x  2  z 1

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
22 Unit III – Numerical Differentiation and Integration
2 1
x 2  z 12
 e dx  e dz
0 1
 1   1 
 f   f    1
 3  3
 z 1 2
Here f  z   e  
2
 1 
  1
 1 
f   e  3   e 0.1786  0.8364
 3
2

.in
 1 
  1
 1 
f   e  3   e 2.488  0.0831
 3

ing
2
 x2
 1  e dx  0.8364  0.0831
0
eer
 0.9195

5. Write down the Newton-Cote’s formula for the equidistant ordinates.


gin

Solution : The general Newton-Cote’s quadrature formula is


En

 n n  2 n  3  
2 n  n  2
a  nh 2

 f  x  dx  nh  1     3  ... f  a 
arn

a  2 12 24 
This is known as the general Gauss-Lagendre integration formula.
Putting n = 1 and omitting second and hyper differences in the above,
Le

we get
ah
h h
 f  x  dx  2  f  a   f  a  h   2  y1  y2 
w.

a
ww

which is the trapezoidal rule.

1
6. When do you apply Simpson’s 3 rule, and what is the order of the
1
error in Simpson’s 3 rule.
Solution : Let n = interval

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
23 .

1
Rule : Simpsons’ 3 rule → The number of ordinates is odd (or) the
intervals number is even.
2
The error in the trapezoidal formula is of the order h .
7. State Simpson’s one third rule.
Solution : Let DC be the curve y = f (x) and DA, CB be the terminal
ordinates. Let OA = a and OB = b. Divide AB into even number(say
2n) of equal parts, equal to h. Let x1 , x2 ,...x2 n 1 be the abscissae of the
points, A, A1 , B and y1 , y2 ,... y2 n 1 be the corresponding ordinates.
Then A 2n-1

.in
b
h
 y dx is approximately  3  A + 4B + 2C   1
a

ing
where A = y1  y2 n 1  sum of the first and last ordinates.
B = y2  y1  ... y2 n  sum of the even ordinates and
eer
C = y3  y5  ...  y2 n 1  sum of the remaining ordinates 1 is
known as Simpson's rule or Simpson's one-third rule.
gin

8. Write down two point Guassian quadrature formula to evaluate


1

 f  x  dx.
En

1
Solution : Two points Guassian quadrature formula is
1
arn


1   1 
 f  x  dx  f  f  
3  3
1
This formula is exact for polynomials upto degree 3.
Le

Unit III Assignment problems:


w.

Numerical Differentiation
1. Find f '(10) from the following data: (May 2011)
ww

x 3 5 11 27 34
f(x) –13 23 899 17315 35606
2. Find the first and second derivatives of y w.r.t x at x = 10 from the
data given below:
x 3 5 7 9 11
y 31 43 57 41 27
dy
3. Find dx at x = 1 from the following table:
x 1 2 3 4
y 1 8 27 64

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
24 Unit III – Numerical Differentiation and Integration
4. Find the values of f '(4) and f ''(4) from the following data:
x 0 1 2 5
f(x) 2 3 12 147
5. Find cos 1.747  using the values given in the table below:
x 1.70 1.74 1.78 1.82 1.86
sin x 0.9916 0.9857 0.9781 0.9691 0.9584
6. Find sec(31  ) from the following data:
 31 32 33 34
tan  0.6008 0.6249 0.6494 0.6745
Numerical Integration
1
1

.in
 1  x2 dx
7. Evaluate 0 using Romberg’s method.

ing
2
1
 1  x3 dx
8. Evaluate 1 using Gaussian three point formula.
eer
1 1 1
0 0  x  y  1dx dy
9. Evaluate by using Trapezoidal rule taking
gin

h = 0.5 and k = 0.25.


2
x2  2 x  1
 1   x  14 dx
En

10. Evaluate 0 by Gaussian three point formula.


1 2 2 xy
0 1 dx dy
1  x 1  y 
2 2
arn

11. Evaluate by using Trapezoidal rule with


h = k = 0.25.
2.4 4.4
Le

Evaluate 2 4
xy dx dy
12. using Simpson’s rule given h = k = 0.1.
13. The velocity v of a particle at a distance S from a point on its path is
w.

given by the table below:


S(meter) 0 10 20 30 40 50 60
ww

v(m/sec) 47 58 64 65 61 52 38
Estimate the time taken to travel 60 meters by using Simpson’s three –
eighth rule.

14. By dividing the range into ten equal parts, evaluate by0 sin x dx
Trapezoidal and Simpson’s rule. Verify your answer with actual
integration.
10 dx

15.

Calculate 2 1  x by dividing the interval into eight equal parts and
11
log e .
hence find an approximate value of 3

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
1MA8491 Numerical Methods .

UNIT IV
INITIAL VALUE PROBLEMS FOR ORDINARY
DIFFERENTIAL EQUATIONS
Single step methods: Taylor series method – Euler method for first order
equation – Fourth order Runge – Kutta method for
solving first and second order equations.
Multi step methods: Milne’s and Adam’s predictor and corrector methods.

Topic 1.1 : Taylor’s series method


dy
Given  y   f  x, y  with y  x0   y0
dx

.in
d2y f f dy
  
dx 2 x y dx

ing
ie., y   f x  f y  y  
llly find y , y ,...
eer
Taylor’s series expansion of y(x) above x  x0 is given by
 x  x0   x  x0 2  x  x0 3
y  x   y  x0   y   x0   y   x0   y   x0   ...
gin

1! 2! 3!
 x  x0   x  x0 2  x  x0 3
 y0  y0  y0  y0  ...
En

1! 2! 3!
 or 
arn

h h2 h3
y  x1   y1  y0  y0  y0  y0  ..., where x1  x0  h, h  x  x0
1! 2! 3!
h2 h3
Le

h
y  x2   y2  y1  y1  y1  y1 ..., where x2  x1  h, h  x  x0
1! 2! 3!
w.

Eg 1 : Using Taylor’s series method, find y at x = 0.1, if


dy
 x 2 y  1, y  0   1
ww

dx
2
Solution : Given y   x y  1, x0  0, y0  1, h  0.1
 Taylor’s series formula is
h h2 h3
y1  y0  y   y   y0  ...  1
1! 2! 3!
y  x2 y  1 y0  x0 2 y0  1  1
y   2 xy  x 2 y  y0  2 x0 y0  x02 y0  0
y   2  xy   y   x 2 y   y 2 x

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
2 Unit IV – Initial Value Problems For Ordinary Differential Equations
y0  2  x0 y0  y0   x 2 y0  y0 2 x0
2
y iv  2 y   2 xy   2 y   2 xy  iv
y0  2 y0  2 x0 y0  2 y0
 x y   y   2 x   2 y 
2
 2 xy0  x 2 y0  y   2 x0 
 2 y0
 6
0.1  0.1 2
 0.13  0.14
 1  y1  1   1   0   0   6 
1! 2! 3! 4!
 0.13  0.14

.in
ie., y  0.1  1   0.1    ...
3 4

ing
 0.900305

CW 2 : Using Taylor’s method, compute y (0.2) and y (0.4) correct to 4


eer
dy
  y   1  2 xy & y  0   0.
decimal places given dx
Solution : y (0.2) = 0.194752003, y (0.4) = 0.359883723
gin

HW 3 : Using Taylor’s series method, with the first five terms in the
expansion; find y (0.1) correct to 3 decimal places, given that
En

dy
 e x  y 2 , y  0   1.
dx
arn

Solution : y (0.1) = 1.0049891 ≃ 1.005 (correct to 3 decimal places)

Topic 1.2 : Taylor’s series method for simultaneous first order


Le

differential equations
dy dz
 f1  x, y, z  ,  f 2  x, y, z  with initial
w.

Given
dx dx
conditions y  x0   y0 , z  x0   z0
ww

EG 4 : Solve the system of equations


dy dz
 z  x2 ,  y  x with y  0   1, z  0   1
dx dx
by taking h  0.1 to get y  0.1 and z  0.1 .
Solution : Given x0  0, y0  1, z0  1
WKT, Taylor's series for y1 is y1  y  0.1
h h2 h3 h 4 iv
= y0  y0  y0  y0  y0  ...  1
1! 2! 3! 4!

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
3MA8491 Numerical Methods .

& Taylor's series for z1 is z1  z  0.1


h h2 h3 h 4 iv
= z0  z0  z0  z0  z0  ...   2
1! 2! 3! 4!
dy y0  z0  x0 2  1  0 dz z0  x0  y0
y   z  x2 z   x y
dx 1 dx  0 1  1
y   z   2 x y0  1 z   1  y  z0  1  y0  2

y   z   2 y0  0 z   y  z0  1
y  z 
iv
y0iv  1 z iv  y  z0iv  0

.in
 0.1  0.12  0.13  0.14
 1  y  0.1  1  1  1   0  1

ing
1! 2! 3! 4!
= 1.1050  correct to 4 decimal places 

 0.1  0.12  0.13  0.14


eer
Now  2   z  0.1  1  1   2  1   0
1! 2! 3! 4!
= 1.110167
gin

≃ 1.1102  correct to 4 decimal places 


En

Topic 1.3 : Taylor’s series for II order differential equations


Eg 5 : By Taylor’s series, find y (0.1) and y (0.2) given that
y   y  xy , y  0   1, y   0   0.
arn

Solution : Given x0  0, y0  1, y0  0 & y   y  xy 


WKT, Taylor's series formula is
Le

x2 x3
y  x   y0  xy0  y0  y0  ...  1
2! 3!
w.

y   y  xy  y0  y0  x0 y0  1  0  0   1
ww

y   y   xy   y   2 y   xy  y0  0
y  2 y   xy   y   3 y   xy 
iv
y0iv  3
x2 x4
 1  y  x   1  0  1  0   3  ...
2! 4!
x2 x4
 1   ...
2 8

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
4 Unit IV – Initial Value Problems For Ordinary Differential Equations

 0.12  0.14
y  0.1  1    ...
2 8
 1.0050125 ≃ 1.0050  correct to 4 decimal places 

 0.2 2  0.2 4
y  0.2   1    ...
2 8
 1.0202

Topic 2.1 : Euler method


Given y   f  x, y  , x0 , y0 , h

.in
Euler algorithm is

ing
y1  y0  hf  x0 , y0 
y 2  y1  hf  x1 , y1 
y3  y2  hf  x2 , y2 
eer

y n  yn 1  hf  xn 1 , yn 1 
gin

Eg 6 : Using Euler’s method, find y (0.2), y (0.4) and y (0.6) from


En

dy
 x  y, y  0   1 with h  0.2.
dx
arn

Solution : Given y  0   or  y0   1  x0  0


& x1  0.2, x2  0.4, x3  0.4, h  0.2
Le

y  x  y
We have to find y  0.2   y1
w.

Now, by Euler algorithm,


y1  y0  hf  x0 , y0 
ww

ie., y  0.2   1   0.2  x  y    x  x0   1  0.2  x0  y0   1   0.2  0  1


 y y 
 0
 y  0.2   1.2  y1
y2  y1  hf  x1 , y1   1.2   0.2   x1  y1 
 1.2  0.2  0.2  1.2  1.48  y  0.4   1.48
y3  y2  hf  x2 , y2   1.48   0.2   x2  y2 
 1.856  y  0.6   1.856

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
5MA8491 Numerical Methods .

 The result of the problem:


x y
x0  0 y0  1
x1  0.2 y1  y0  hf  x0 , y0   1.2
x2  0.4 y2  y1  hf  x1 , y1   1.48
x3  0.4 y3  y2  hf  x2 , y2   1.856
dy
 y  ex , y  0  0
CW 7 : Solve dx for x = 0.2, 0.4 by using Euler’s
method.

.in
Solution : y1  0.2, y2  0.484281

ing
HW 8 : Using Euler’s method, find the solution of the initial value problem
dy
 log  x  y  , y  0   2
eer
dx at x = 0.2 by assuming h = 0.2.
Solution : y (0.2) = 2.0602
gin

Topic 2.2 : Modified Euler method


 h 1 
yn 1  yn  hf  xn  , yn  hf  xn , yn  
 2 2 
En

 h h 
n  0, y1  y0  hf  x0  , y0  f  x0 , y0  
 2 2 
arn

 h h 
n  1, y2  y1  hf  x1  , y1  f  x, y  
 2 2 
Le

 h h 
y3  y2  hf  x2  , y2  f  x2 , y2  
 2 2 
w.

Eg 9 : Solve y   1  y, y  0   0 by modified Euler method.


Solution : Given y   f  x, y   1  y, x0  0, y0  0
ww

Let h  0.1,  x1  0.1, x2  0.2, x3  0.3


We have to find y1 , y2 , y3 .
By Modified Euler’s method:
 h 1 
yn 1  yn  hf  xn  , yn  hf  xn , yn  
 2 2 
 h h 
y1  y0  hf  x0  , y0  f  x0 , y0  
 2 2 
 Here f  x0 , y0   f  x  x0 , y  y0   1  y0  1  0  1

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
6 Unit IV – Initial Value Problems For Ordinary Differential Equations

 0.1 0.1 
Therefore y1  0   0.1 f 0  , 0 1
 2 2 
 0.1 f  0.05,0.05   0.1 1  y 
 xy0.05
0.05 
 1  0.05

y1  0.095
 h h 
Now y2  y1  hf  x1  , y1  f  x1 , y1  
 2 2 
 Here f  x1 , y1   1  y1  0.905
 0.1 0.1 

.in
i.e., y2  0.905   0.1 f 0.1  , 0.095  f  0.1, 0.095  
 2 2 
y2  0.18098
 h h
Now y3  y2  hf  x2  , y2  f  x2 , y2  
 2 2

 ing
eer
 Here f  x2 , y2   1  y2  1  0.18098  0.81902 
 0.1 0.1 
gin

i.e., y3  0.18098   0.1 f 0.2  , 0.18098  f  0.2, 0.18098  


 2 2 
y3  0.258787
En

 y0  0, y1  0.095, y2  0.18098, y3  0.258787


arn

CW 10 : By using modified Euler method, find


dy x  y
y 1.8  if  , y  2  1  Hint h  0.2
dx x  y
Le

Solution : y (1.8) = 0.9349


w.

dy
HW 11 : Given  y  x 2  0, y  0   1, y  0.1  0.9052,
dx
ww

y  0.2   0.8213, find correct to four decimal places y  0.3 ,


using modified Euler's method.
 Hint y   x 2  y 
Solution :  
 h h 
y  0.3  y3  y2  hf  x2  , y2  f  x2 , y2    0.7493
 2 2 

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
7MA8491 Numerical Methods .

Topic 3.1 : Fourth order Runge – Kutta method for solving I order
Differential Equations[Single step method]
dy
Given  y   f  x, y 
dx
& y  x0   c0 ,
Now y  x1   ?  c1 , y  x2   ?  c2 , y  x3   ?  c3 ,...

General
h(  Interval length)
xn  known xn 1  known

.in
yn  known yn 1  yn  yn 1  to find 

ing
To find f  xn 1   y  xn 1   yn 1 :
Fourth order Runge – Kutta Algorithm :
yn 1  y  xn  h   y  xn   yn 1  yn  yn 1
eer
1
where yn 1   k1  2k2  2k3  k4 
6
gin

where k1  hf  xn , yn 
 h k 
k2  hf  xn  , yn  1 
En

 2 2
 h k 
arn

k3  hf  xn  , yn  2 
 2 2 
k4  hf  xn  h, yn  k3 
Le

To find f  x1   y  x1   y1 :
k1  hf  x0 , y0 
w.

 h k 
k2  hf  x0  , y0  1 
ww

 2 2
 h k 
k3  hf  x0  , y0  2 
 2 2 
k4  hf  x0  h, y0  k3 
1
y1   k1  2k2  2k3  k4 
6
 y1  y  x0  h   y  x0   y1  y0  y1

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
8 Unit IV – Initial Value Problems For Ordinary Differential Equations

dy
 x  y 2 , y  0   1,
Eg 12 : Given dx find y (0.1) & y (0.2) by Runge –
Kutta method for IV order.
Solution : Given y   f  x, y   x  y , h  0.1
2

& x0  0, y  x0  0   1.
To find y (0.1) :
k1  hf  x0 , y0    0.1 f  0.1   0.1 0  12   0.1
 
 h k 
k2  hf  x0  , y0  1    0.1 f 0  0.05, 1  0.05  

.in
 2 2
  0.1 0.05  1.05    0.11525
2

ing
 
 h k   0.11525 
k3  hf  x0  , y0  2    0.1 f 0.05,1 
 2 2  2 
eer
  0.1 0.05  1.057625    0.116857
2
 
gin

k4  hf  x0  h, y0  k3    0.1 f  0.05,1  0.116857 


2
  0.1 0.05  1.116857    0.134737
 
En

1 1
y   k1  2k2  2k3  k4    0.1  2  0.1  2  0.11525    0.116857  
6 6
arn

 0.11649
 y  0.1  y1  y0  y  1  0.11649  1.11649  y1  1.11649
Le

To find y  0.2   y2 : (Second interval)


k1  hf  x1 , y1    0.1 f  0.1,1.11649   0.1 0.1  1.116492  
w.

 0.1347
ww

 h k   0.1347 
k2  hf  x1  , y1  1    0.1 f 0.1  0.05,1.11649 
 2 2  2 
  0.1 f  0.15,1.18385  0.1552
 h k   0.1552 
k3  hf  x1  , y1  2    0.1 f 0.1  0.05,1.11649 
 2 2   2 
  0.1 f  0.15,1.1941  0.1576
k4  hf  x1  h, y1  k3    0.1 f  0.1  0.1,1.11649  0.1576
  0.1 f  0.2,1.2741  0.1823

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
9MA8491 Numerical Methods .

1
y   k1  2k2  2k3  k4   0.1571
6
y2  y1  y  1.11649  0.1571  1.27359
i.e.,
x 0 0.1 0.2
y 1 1.11649 1.27359

CW 13 : Using R. K. method of fourth order solve for


dy 2 xy  e x
for x  1.4, from  with y  0 at x  1.
dx x 2  xe x

.in
Solution : y1  0.140  Here y2  y 1.4   0.27  , h  0.2

HW 14 : Solve y for x = 0.2, 0.4 from the given O.D.E. ing


dy
dx
 x2  y
and
eer
y = 0.8 at x = 0.
Solution : y1  y  0.2   0.99029, y2  y  0.4   0.120828
gin

Topic 3.2 : Fourth Order Runge – Kutta method for solving II order
differential equation
En

Eg 15 : Consider the II order initial value problem


arn

y   2 y   2 y  e 2t sin t with y  0    0.4 and y   0    0.6 using fourth


order Runge – Kutta method, find y (0.2), z (0.2).
Solution : Let t  x
Le

 y   2 y   2 y  e 2 x sin x, y  x  0   0.4
y   x  0   0.6
w.

 y   2 y   2 y  e 2 x sin x  1
ww

Here h  0.2
Setting y   z , y   z 
 1  z   2 z  2 y  e 2 x sin x
dy
Let f1  x, y, z    z,
dx
d2y dz
& f 2  x, y , z   2
  2 z  2 x  e 2 x sin x
dx dx

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
10 Unit IV – Initial Value Problems For Ordinary Differential Equations
k1  hf1  x0 , y0 , z0  ℓ 1  hf 2  x0 , y0 , z0 
  0.2   z0    0.2   2 z0  2 y0  e 2 x0 sin x0 
 
  0.2  0.6   0.12 2 0 

  0.2   2  0.6   2  0.4   e sin  0  
 
 0.136
 h k ℓ   h k ℓ 
k2  hf1  x0  , y0  1 , z0  1  ℓ 2  hf 2  x0  , y0  1 , z0  1 
 2 2 2  2 2 2
 0.2   0.2 0.2 
0  2 ,  0  2 , 0.4  2 , 
    0.2  f 2  
  0.2   0.4  
0.12 
,  0.6  0.136 

.in
 2   2 
 
 0.6   0.136    0.2  f 2  0.1,  0.46,  0.532
 2 

ing
 2  0.532   2  0.46  
 0.1064   0.2   2 0.1 
  e   sin  0.1 
eer
  0.2   1.064  0.92  0.1294
 0.00292
ℓ   ℓ 
gin

 h k h k
k3  hf1  x0  , y0  2 , z0  2  ℓ 3  hf 2  x0  , y0  2 , z0  2 
 2 2 2  2 2 2
 0.2   0.2 0.1064 
0  2 , 0  2 , 0.4  2 , 
En


    0.2  f 2  
 0.1064   0.00292 
  0.2  f1 0.4  ,  0.6 
   2 
arn

2
 
 0.6  0.00292    0.2  f 2  0.1, 0.4532, 0.60146
 2   2  0.60146   2  0.4532  
Le

  0.2  f1  0.1, 0.4532, 0.60142   0.2   2 0.1 


  e   sin  0.1 
  0.2   0.60146  0.1203
  0.2   1.20292  0.9064  0.12194
w.

 0.0105
k4  hf1  x0  h, y0  k3 , z0  ℓ 3  ℓ 4  hf 2  x0  h, y0  k3 , z0  ℓ 3 
ww

0  0.2,  0  0.2, 0.4  0.1203, 


  0.2  f 2 
  0.2  f1  0.4  0.1203,    0.6  0.0105 
 0.6  0.0105   2  0.6105   2  0.5203 
  0.2  f1  0.2, 0.5203, 0.6105   0.2   2 0.2 
  e   sin  0.1 
  0.2   0.6105
  0.2   1.221  1.0406  0.29638
 0.1221
 0.0825

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
11 .

1 1
y   k1  2k1  2k2  2k3  z   ℓ 1  2ℓ 2  2ℓ 3  ℓ 4 
6 6
 0.1159  0.03194
y1  y  0.2   y0  y z1  z  0.2   z0  z
 0.5159  0.2806

CW 16 : Given y   xy   y  0, y  0   1, y   0   0, find the value of y(0.1)


by using R. K. method of fourth order.
Solution : y (0.1) = 0.9950

HW 17 : Given y   x  y    y  0, y  0   1, y   0   0, find the value of


22

.in
y(0.2) by using R. K. method of fourth order.

ing
Solution : y (0.2) = 0.9801

Topic 3.3 : R. K. Method for simultaneous first order differential


eer
equations
dy dz
 f1  x, y, z  &  f 2  x, y , z 
Solving the equation dx dx with
gin

the initial conditions y  x0   y0 , z  x0   z 0 .

Now starting from  x0 , y0 , z0  with increments,


y & z
in y & z
En

respectively. Use formula


k1  hf1  x0 , y0 , z0  ℓ 1  hf 2  x0 , y0 , z0 
arn

 h k ℓ   h k ℓ 
k2  hf1  x0  , y0  1 , z0  1  ℓ 2  hf 2  x0  , y0  1 , z0  1 
 2 2 2  2 2 2
Le

 h k ℓ   h k ℓ 
k3  hf1  x0  , y0  2 , z0  2  ℓ 3  hf 2  x0  , y0  2 , z0  2 
 2 2 2   2 2 2 
w.

k4  hf1  x0  h, y0  k3 , z0  ℓ 3  ℓ 4  hf 2  x0  h, y0  k3 , z0  ℓ 3 
1 1
ww

y   k1  2k2  2k3  k4  z   ℓ 1  2ℓ 2  2ℓ 3  ℓ 4 
6 6
y1  y0  y z1  z0  z

dy dz
 xz  1,   xy
Eg 18 : Solving the system of differential equation dx dx
for x = 0.3 using fourth order R. K. method, the initial values are
x = 0, y = 0, z = 1.
Solution : Given x0  0, y0  0, z0  1, h  0.3.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
12 Unit IV – Initial Value Problems For Ordinary Differential Equations

f1  x, y, z   xz  1 f 2  x, y, z    xy
k1  hf1  x0 , y0 , z0    0.3  x0 z0  1 ℓ 1  hf 2  x0 , y0 , z0    0.3  0  0  
  0.3 0  1  0.3 0
 h k ℓ   h k ℓ 
k2  hf1  x0  , y0  1 , z0  1  ℓ 2  hf 2  x0  , y0  1 , z0  1 
 2 2 2  2 2 2
 0.345  0.007
 h k ℓ   h k ℓ 
k3  hf1  x0  , y0  2 , z0  2  ℓ 3  hf 2  x0  , y0  2 , z0  2 
 2 2 2   2 2 2 

.in
 0.3448  0.0078
k4  hf1  x0  h, y0  k3 , z0  ℓ 3  ℓ 4  hf 2  x0  h, y0  k3 , z0  ℓ 3 

ing
 0.3893  0.031032
1 1
y   k1  2k2  2k3  k4   0.34482 z   ℓ 1  2ℓ 2  2ℓ 3  ℓ 4   0.01011
eer
6 6
y1  y0  y  0  0.34482 z1  z0  z  1   0.01011
gin

 y  0.3  0.34482  z  0.3  0.98989


CW 19 : Solve the simultaneous differential equation
dy dz
En

 2 y  z,  y  3 z , y  0   0, z  0   0.5
dx dx
for y (0.1) and z (0.1) using R. K. method of fourth method.
arn

Solution : Given x0  0, y0  0, z0  0.5, h  0.1


 y  0.1  0.04814, z  0.1  0.37263.
Le

HW 20 : Using the R. K. method, tabulate the solution of the system


dy dz
 x  z,  x  y, y  0, z  0,
w.

dx dx
when x = 0 at intervals of h = 0.1 from x = 0.0 to x = 0.2.
ww

Solution : Given x0  0, y0  0, z0  1, h  0.1


 y  0.1  0.1050, z  0.1  0.9998
y  0.2   0.2199, z  0.2   0.9986
Topic 4 : Milne’s predictor and corrector methods (multistep method)
Milne’s predictor formula
4h
yn 1, p  yn 3   2 yn  2  yn 1  2 yn 
3
Milne’s corrector formula
h
yn 1, c  yn 1   yn 1  4 yn  yn 1 
3

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
13 .

dy 1
  x  y  , y  0   2, y  0.5   2.636,
Eg 21 : Given dx 2
y 1  3.595, y 1.5   4.968 by Milne’s method to find y (2).
Solution : Given
x0  0 x1  0.5 x2  1 x3  1.5 x4  2
y0  2 y1  2.636 y2  3.595 y3  4.968 y4  ?
Here h = 0.5
1
y    x  y   f  x, y 
Given 2

.in
By Milne's predictor formula,
4h
 2yn 2  yn 1  2 yn 
ing
yn 1, p = yn 3 +
3
4h
n  3, y31, p = y0 + 2y1  y2  2 y3   1
eer
3
1 1
Now, y1 =  x1  y1  = 0.5+2.636 =1.568
2 2
gin

1 1
y2 =  x2  y2  = 1+3.595 =2.2975
2 2
En

1 1
y3 =  x3  y3  = 1.5+4.968 =3.234
2 2
4  0.5 
arn

1  y4, p = 2+  2 1.568   2.2975  2  3.234  


3 
= 6. 871  = y4 , say 
Le

By Milne’ corrector formula,


h
yn 1, c  yn 1   yn 1  4 yn  yn 1 
w.

3
h
n  3, y4, c  y2   y2  4 y3  y4    2
ww

3
1 1
Now y4   x4  y4    2  6.871  4.4355
2 2
0.5
 2   y4, c  3.595   2.2975  4  3.234   4.4355
3
0.5
 3.595  19.669   6.8732
3
 Corrected value of y at 2 is y  2  = 6.8732.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
14 Unit IV – Initial Value Problems For Ordinary Differential Equations

dy 3
 x  y, y  0   2, y  0.2   2.073,
CW 22 : Given dx the values of
y  0.4   2.452, y  0.6   3.023 are got by R.K. Method. Find
y  0.8  by Milne’s method.

Solution : y4, p  4.1659, y4, c  3.7953


HW 23:Solve y   x  y , 0  x  1, y  0   0, y  0.2   0.02,
2

y  0.4   0.0795, y  0.6   0.1762 by Milne’s method to find y (0.8) and y (1).
Solution : y (0.8) = 0.3046, y (1) = 0.4515.

.in
Topic 5 : Adam’s predictor and corrector methods
(efficient multistep method) [Adam’s-Bashforth method]

ing
Adam’s predictor formula :
h
yn 1, p  yn  55 yn  59 yn 1  37 yn  2  9 yn  3 
24
eer
Adam’s corrector formula :
h
yn 1, c  yn  9 yn 1  19 yn  5 yn 1  yn  2 
24
gin

 x 2 1  y  , y 1  1, y 1.1  1.233, y 1.2   1.548,


dy
Eg 24 : Given dx
En

y 1.3  1.979, evaluate y (1.4) by Adam’s-Basforth method.


Solution : Given
arn

x0  0 x1  1.1 x2  1.2 x3  1.3 x4  1.4


y0  1 y1  1.233 y2  1.548 y3  1.979 y4  ?
Here h = 0.1
Le

By Adam’s predictor formula,


h
yn 1, p  yn  55 yn  59 yn 1  37 yn  2  9 yn  3 
w.

24
h
n  3, y4, p  y3  55 y3  59 y2  37 y1  9 y0   1
ww

24
Here y0  x0 2 1  y0   12 1  1  2
y1  x12 1  y1   1.1 1  1.233  2.70193
2

y2  x2 1  y2   1.2  1  1.548  3.60912


2

y3  x3 1  y3   1.3 1  1.979  5.0345


2

0.1
 1  y4, p 1.979  55  5.0345   59  3.60912   37  2.70193  9  2  
4 
 2.5870451

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
15 .

By Adam’s corrector method,


h
yn 1, c  yn  9 yn 1  19 yn  5 yn 1  yn  2 
24
h
 n  3 , y4, c  y3  9 y4  19 y3  5 y2  y1    2
24
y4   x4  1  y4   1.4  1  2.5871  7.030716
2 2

0.1
  2   y4, c 1.979  9  7.030716   19  5.0345   5  3.60912    2.70193 
24 
 2.5772844.

.in
2
CW 25 : Using Adam’s Bashforth method, find y (4.4) given 5 xy   y  2,
y (4) =1, y (4.1) =1.0049, y (4.2) =1.0097 & y (4.3) =1.0143.

ing
2  y2
y  ,  y4, p  1.0186 & y4, c  1.0187.
Solution : Here 2x
CW 26 : Evaluate y (0.9), using Adam Bashforth’s predictor-corrector
eer
1
dy
 xy 3 ,
method, given that dx y (1)=1, y (1.1)=1.10681, y (1.2)=1.22787
gin

and y (1.3)=1.36412.
Solution : Here h = – 0.1,  y4, p  0.906518 & y4, c  0.906520.
En
arn
Le
w.
ww

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
16 Unit IV – Initial Value Problems For Ordinary Differential Equations

PART – A
dy
 x  y,
1. Use Euler’s method to find y (0.2) and y (0.4) given dx
y (0) = 1 with h = 0.2.
Solution : f  x, y   x  y, x0  0, y0  1, x1  0.2, x2  0.4
By Euler algorithm,
y1  y0  hf  x0 , y0   1   0.2   x0  y0   1   0.2   0  1
i.e., y1  y  0.2   1.2
y2  y1  hf  x1 , y1   1.2   0.2   x1  y1   1.2   0.2   0.2  1.2

.in
 1.2  0.28
i.e., y2  y  0.4   1.48

ing
y3  y2  hf  x2 , y2   1.48   0.2   x2  y2   1.48   0.2   0.4  1.48
 1.48  0.376
eer
i.e., y3  y  0.6   1.856
2. Write the Adam-Bashforth predictor and corrector formulae.
gin

Solution : Adam’s predictor and corrector formulas are


h
yk 1, p  yk  55 yk  59 yk 1  37 yk  2  9 yk  3 
En

24
h
yk 1, c  yk  9 yk 1  19 yk  5 yk 1  yk  2 
24
arn

dy
 x  y,
Le

3. Find y (0.1) by using Euler’s method given that dx


y (0) = 1.
Solution : Given,
w.

f  x, y   x  y, x0  0, y0  1, x1  0.1, h  0.1
By Euler algorithm,
ww

y1  y0  hf  x0 , y0 
 1   0.1  x0 +y0 
 1   0.1  0  1
 1  0.1
 1.01
i.e., y  0.1  1.01

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
17 .

4. What are multistep methods? How are they better than single step
methods?
Solution : 1. Milne’s predictor – correction method.
2. Adams-Bashforth predictor – correction method.
In the single step methods, it is not possible to get any information
about truncation error.
In the multi step methods, it is possible to get easily a good estimate of
the truncation error.
5. Using Taylor series method, find y (1.1) given that y   x  y, y 1  0.
Solution : Given y   x  y, x0  1, y0  0, h  0.1
y  x  y y0  x0  y0  1  0  1

.in
y   1  y  y0  1  y0  1  1  2
y   y  y0  y0  2
y iv  y 
h h2 h3
y0iv  y0  2
h 4 iv ing
eer
y1  y0  y0  y0  y0  y0  ...
1! 2! 3! 4!
 0.1  0.1  0.1
2 3 4
0.1
 y 1.1  0  1   2   2   2   ...
gin

1! 2! 3! 4!

 0.1  0.1
3 4
En

 0.1   0.1 
2

3 1.2
 0.1  0.01  0.0003  0.0000083
arn

 0.1103083
 0.1103  correct to four decimals 
Le

Find y (0.2) for the equation y   y  e , given that y (0) = 0, by using


x
6.
Euler’s method.
w.

Solution : Given, f  x, y   y  e , x0  0, y0  0, h  0.2


x
ww

By Euler algorithm,
y1  y0  hf  x0 , y0 
 0  0.2 f  0, 0 
 0.2 0  e0   0.2
i.e., y  0.2   0.2

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
18 Unit IV – Initial Value Problems For Ordinary Differential Equations
dy
 f  x, y  with y  x0   y0 .
7. State Euler method to solve dx
Solution : yn 1  yn  hf  xn , yn  when n  0, 1, 2, ...
This is Euler algorithm. It can also be written as
y  x  h   y  x   hf  x, y 

.in
ing
eer
gin
En
arn
Le
w.
ww

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA8491 Numerical Methods
19 .

Unit IV Assignment problems


dy
 x 2 y  1, y (0)  1
1. Using Taylor series method find y at x = 0.1 if dx

2. Using modified Euler’s method find y at x = 0.1 if


dy
 x 2  y 2 , y (0)  1
dx

3. Using Runge – Kutta method of fourth order, solve


dy y 2  x 2
 with y (0)  1
dx y 2  x 2

.in
at x = 0.2

Given y   xy   y  0, y (0)  1, y (0)  0 ,find the value of y(0.1) by

ing
4.
using R.K.method of fourth order.
eer
5. Using R. K method of order 4,find y for x =0.1, 0.2, 0.3 given that
dy
 xy  y 2 , y (0)  1
dx also find the solution at x = 0.4 using Milne’s
gin

method.

2
Using Milne’s method to find y(4.4) given that 5 xy   y  2,
En

6.
y (4)  1, y (4.1)  1.0049, y (4.2)  1.0097, y (4.3)  1.0143 .
arn

2
7. Given y   xy  y , y (0)  1 ,find y(0.1) by Taylor’s method, y(0.2) by
Euler’s method, y(0.3) by Runge – Kutta method and y(0.4) by Milne’s
Le

method.
w.

dy
 y  x 2  1, y (0)  0.5
8. Consider dx
ww

(i) Using the modified Euler’s method, find y(0.2)


(ii) Using R.K. method of order 4, find y(0.4) and y(0.6)
(iii) Using Adam’s – Bashforth predictor corrector method, find y(0.8).

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
1MA2264 Numerical Methods .

UNIT V BOUNDARY VALUE PROBLEMS IN ORDINARY AND


PARTIAL DIFFERENTIAL EQUATIONS
Finite difference solution of second order ordinary differential equation –
Finite difference solution of one dimensional heat equation by explicit and
implicit methods – One dimensional wave equation and two dimensional
Laplace and Poisson equations.

Topic 1: Finite difference solution of second order ordinary

.in
differential equation
Consider the problem
y ''  x   f  x  g '  x   g  x  y  x   r  x 

ing
with the boundary conditions y  x0   a and y  xn   b.
eer
Foe solving the equation, replace y '' and y ' by the formulae
y  2 yi  yi 1
y ''  i 1
gin

h2
y  yi 1
y '  i 1
En

2h
d2y
yx
arn

Eg (1) : Solve the differential equation dx 2 with


1
y  0   0, y 1  0 with h 
4 by finite difference method.
Le

Solution : Given differential equation


d2y
yx
w.

dx 2
d 2 y  x
ww

i.e.,  y  x  x  1
dx 2
Using the central difference approximation, we have
y  2 yi  yi 1
y ''  i 1   2
h2
Substitute (2) in (1), we get
yi 1  2 yi  yi 1
 yi  xi
h2
yi 1  2 yi  yi 1
 yi  xi
h2

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
2 Unit V – B.V.P. in ordinary and Partial differential equations

yi 1  2 yi  yi 1  h 2 yi  h 2 xi
1 1  1
yi 1  2 yi  yi 1  yi  xi ∵ h  
16 16  4
16 yi 1  33 yi  16 yi 1  xi   3

Put k  1, 2,3 in  3 , we get


1
16 y0  33 y1  16 y2  
4

1
16 y1  33 y2  16 y3     4

.in
2
3
16 y2  33 y3  16 y4  
4
Given y 0  0 i.e., y  x0  0   0 i.e., y0  0 
 
ing

y 1  0 i.e., y  x4  1  0 i.e., y4  0 
  5
eer
1 1 1 3
Since h  , we have x1  x0  h  , x2  x1  h  , x3  x2  h 
4 4 2 4
gin

Substitute (5) in (4), we get


1
0  33 y1  16 y2    6
4
En

1
16 y1  33 y2  16 y3   7
2
arn

3
16 y2  33 y3  0   8
4
Le

Solving (6) & (8), we get


1
y1  y3   9
66
w.

Solving (7) & (8), we get


131
ww

256 y1  833 y3   10 


4
Solving (9) & (10), we get
y3  0.05004
Substitute y3 in (9), we get
y1  0.03488
Substitute y1 & y3 in (6), we get
y2  0.05632
 Solution of the given differential equation is
y1  0.03488, y2  0.05632, y3  0.05004

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
3MA2264 Numerical Methods .

CW (2) : Solve by finite difference method, the boundary value problem


y ''  x   y  x   2, 1
y  0   0, y 1  1, taking h  .
when 4
1 2 3
y1  y    0.0451, y2  y    0.2183, y3  y    0.5301
Solution : 4 4 4
CW (3) : Solve by finite difference method, the boundary value problem
y ''  x   3 y '  x   2 y  x   0 when y  0   2, y 1  10.1.
Solution : y  0.5   0.4367
HW (4) : Using the finite difference method, find y(0.25), y(0.5) and
y(0.75) satisfying the differential equation y ''  x   y  x   x

.in
subject to the boundary conditions y  0   0, y 1  2.

ing
1 2 3
y1  y    0.5443, y2  y    1.0701, y3  y    1.5604
Solution : 4 4 4
eer
Classification of PDE of second order:
 2u  2u  2u  u u 
A  x, y  2  B  x, y   C  x, y  2  f  x, y , ,   0
gin

x x y y  x y 
If B 2  4 AC  0  Elliptic form 
En

B 2  4 AC  0  Parabola form 
B 2  4 AC  0  Hyperbola form 
arn

Eg: (1): Classify f xx  2 f xy  0, x  0, y  0.


Solution: Here A  1, B  2, C  0.
Le

B 2  4 AC  4  0
 Given equation is Hyperbic form
w.

Eg: (2): Classify xf xx  yf xy  0, x  0, y  0.


Solution: Here A  x, B  0, C  y.
ww

B 2  4 AC  4 xy  0 when x  0, y  0
 Given equation is Elliptic form
Eg: (3): Classify u xx  2u xy  u yy  0.
Solution: Here A  1, B  2, C  1.
B 2  4 AC  0
 Given equation is Parabolic form
2
 2
Eg: (4): Classify x f xx  1  y f yy  0, 1  y  1,   x  .

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
4 Unit V – B.V.P. in ordinary and Partial differential equations

Solution: Here A  x , B  0, C  1  y  .
2 2

B 2  4 AC  4 x 2 1  y 2   4 x 2  y 2  1 .
  x  
x 2 is always ‘+’ in
2
In 1  y  1, y  1 is ‘–’.
B 2  4 AC  ve  x  0 
 Given equation is Elliptic form
If x  0, B  4 AC  0  Given equation is Parabolic form
2

If y  1, B  4 AC  0  Given equation is Hyperbic form


2

.in
Eg: (5):
Hyperbolic

ing
Parabolic Type Elliptic Type
Type
 2u  2u  2u  2u
2 2  0
eer
u  u t 2
x 2
x 2
y 2
2 2
t x (One (Laplace equation in
(One dimensional Heat equation) dimensional Two dimensional
gin

Wave equation) Heat equation)


↙ ↘  2u  2u
  f  x, y 
En

Explicit form Implicit form 2


x y 2
 Bender  Schmidt's   Crank  Nicolson's  (Poisson equationin
   
arn

 method   method  Two dimensional


Heat equation)
Le

Topic 2: Finite difference solution of one dimensional heat equation by


explicit method(Bender–Schmidt’s method)
w.

u  2u
2 2
One dimensional heat equation is t x
ww

1
2 
Put a
u 1  2u

t a x 2
u  2u
i.e., a 
t x 2

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
5MA2264 Numerical Methods .

(i) Bender–Schmidt’s difference equation is


ui , j 1    ui 1, j  ui 1, j   1  2  ui , j  1
k  1
 2
Here   
where ah  2
1
0 
Equation (1) is called explicit formula. This is valid if 2
(i) Bender–Schmidt’s difference equation is
1
ui , j 1   ui 1, j  ui 1, j    2
2
1 k a
   2 i.e., k  h 2

.in
where 2 ah 2
Equation (2) is called Bender–Schmidt’s recurrence equation.

Eg (5) : Solve x
 2u
2
u
2
t ing
 0 given u  0, t   0, u  4, t   0,
eer
u  x, 0   x  4  x  . Assume h = 1. Find the values of u upto t = 5.
 2u u  2u u
gin

2 is of the form 2  a a2


Solution : Given x
2 t x t
a 2 2
k  h 2  k  1  1
En

By Bender–Schmidt’s relation, 2 2
Step size in time(t) = k = 1 = t
Step size in x = h = 1 = x
arn

ui , j 1
ui , j 1   ui 1, j  ui 1, j 
The values of are calculated by 2 as follows:
Le

 x direction 
h
0 1 2 3 4
t
w.

u 1, 0  u  2, 0  u  3, 0 
u (0, t ) u  4, t 
ww

0 
 1 4 1  
 2 42   3  4  3
0 0
 3 4 3
t 04 33 40
1 0 2 3 2 0
dir. 2 2 2
 2 0 1.5 2 1.5 0
3 0 1 1.5 1 0
4 0 0.75 1 7.5 0
5 0 0.5 0.75 0.5 0

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
6 Unit V – B.V.P. in ordinary and Partial differential equations
 2 f f
  0, f  0, t   f  5, t   0, f  x,0   x 2  25  x 2  ,
2 t
Eg (6) : Given x
find f in the range takingn h = 1 and upto 5 seconds.
 2 f f 2 f f
 is of the form a  a  1, h  1
Solution : Given  x 2  t x 2 t
a 1 2 1
k  h 2  k  1  k 
By Bender–Schmidt’s relation, 2 2 2
1  t
Step size in time(t) = k = 2 =
Step size in x = h = 1 = x

.in
Given f  0, 0   0, f 1, 0   12  25  12   24, f  2, 0   22  25  22   84,
f  3, 0   32  25  32   144, f  4, 0   42  25  42   144, f  5, 0   0

The values of
ui , j
are calculated by
1
2 ing
ui , j 1   ui 1, j  ui 1, j 
as follows:
eer
 x direction 
i
0 1 2 3 4 5
t=jk
gin

 0 0 24 84 144 144 0
t 0.5 0 42 84 114 72 0
1 0 42 78 78 57 0
En

d 1.5 0 39 60 67.5 39 0
i 2 0 30 53.25 49.5 33.75 0
arn

r
e 2.5 0 26.625 39.75 43.5 24.75 0
c 3 0 19.875 35.0625 32.25 21.75 0
t 3.5 0 17.5312 26.0625 28.4062 16.125 0
Le

i
o 4 0 13.0312 22.9687 21.0938 14.2031 0
n 4.5 0 11.4843 17.0625 18.5859 10.5469 0
w.

 5 0 8.5312 15.0351 13.8047 9.2929 0


CW (7) : Solve ut  u xx subject to u  0, t   0, u 1, t   0 and
ww

u  x,0   sin  x,0  x  1.


Solution : Given Here 0  x  1, a  1, take h  0.2
a 1 2
k  h 2  k   0.2   k  0.02
2 2 . Form table.
HW (8) : Solve t u  u xx , given u  0, t   0, u  4, t   0 and u  x, 0   x  4  x 
assuming h = k = 1. Find the values of u upto t = 5.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
7MA2264 Numerical Methods

 
.

1
Here   [Otherwise, the values of h & k are given]
Eg(9): 2
Solve ut  u xx ,0  x  1, t  0, u  x, 0   100  x  x  ,
2

u  0, t   u 1, t   0, 1 1
h  ,k 
4 16 .
1 1
Given ut  u xx , a  1, h  , k  .
Solution: 4 16
k 1/16  1
 2   1    1  
Let ah 1 1/16   2
We need to use formula ui , j 1    ui 1, j  ui 1, j   1  2 ui , j  1
   

.in
When   1, 1  ui , j 1   ui 1, j  ui 1, j  ui , j 

ing
The values of ui , j are calculated as follows:
 x direction 
eer
x
0 0.25 0.5 0.75 1
t
0 0 18.75 25 18.75 0
gin

 1
t 0 6.25 12.5 6.25 0
16
dir.
2
En

 0 6.25 0 6.25 0
16
3
arn

0 -6.25 12.5 -6.25 0


16
4
0 18.75 – 25 18.75 0
Le

16
w.

Topic 3: Finite difference solution of one dimensional heat equation by


implicit method(Crank–Nicolson’s method)
ww

Crank–Nicolson’s formula is
1
ui , j 1   ui 1, j 1  ui 1, j 1  ui 1, j  ui 1, j 
4
u
Eg (10) : Solve t  u xx  x  5, t  0, given that u  x, 0   20, u  0, t   0,
,0
u  5, t  =100. Compute u for the time–step with h = 1 by
Crank–Nicolson’s method.
Solution : Given ut  u xx , a  1, h  1,

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
8 Unit V – B.V.P. in ordinary and Partial differential equations
k 2
  2  1  k  ah 2  11  k  1
By Crank–Nicolson’s formula, ah
Crank–Nicolson’s formula is
1
ui , j 1   ui 1, j 1  ui 1, j 1  ui 1, j  ui 1, j 
4
u
The values of i , j are calculated as follows:
 x direction 
x
0 1 2 3 4 5
t
 0 0 20 20 20 20 0
t

.in
1 0 u1 u2 u3 u4 0

1

ing
ui , j 1   ui 1, j 1  ui 1, j 1  ui 1, j  ui 1, j 
Use Crank–Nicolson’s formula 4 ,
we get
eer
1
u1   0  0  20  u2   4u1  20  u2  4u1  u2  20  1
4
1
u2   u1  20  20  u3   4u2  40  u1  u3  u1  4u2  u3  40   2 
gin

4
1
u3   u2  20  20  u4   4u3  40  u2  u4  u2  4u3  u4  40   3
En

4
1
u4   u3  20  100  100   4u4  220  u3  u3  4u4  220   4
arn

4
Solving (1) and (2), we get
15u2  4u3  180   5
Le

Solving (3) and (4), we get


4u2  15u3  380   6
w.

Solving (5) and (6), we get


209u3  6420  u3  30.72
ww

  4   30.72  4u4  220  u4  62.68

  3  u2  4  30.72   62.68  40  u2  20.2


 1  4u1  u2  20  u1  10.05
 The values of u are 10.05, 20.2,30.72,62.68.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
9MA2264 Numerical Methods .

Eg (11) : Solve by Crank–Nicolson’s method, the equation u xx  ut


subject to u  x,0   0, u  0, t   0 & u 1, t   t for two time steps.
1 1
Given ut  u xx , a  1, x  0 to x  1, take h  .  k  ah 2 
Solution : 4 16
Crank–Nicolson’s formula is
1
ui , j 1   ui 1, j 1  ui 1, j 1  ui 1, j  ui 1, j 
4
The values of ui , j are calculated as follows:
 x direction 
h
0 1 2 3 4

.in
t
0 0 0 0 0 0

ing
1 1
t 0 u1 u2 u3
16 16
dir.
2 2
eer
 0 u4 u5 u5
16 16
1
ui , j 1   ui 1, j 1  ui 1, j 1  ui 1, j  ui 1, j 
gin

Use Crank–Nicolson’s formula 4 ,


1
we get u1   0  0  0  u2   4u1  u2  1
4
En

1
u2   u1  0  0  u3   4u2  u1  u3   2 
4
arn

1 1 1
u3   u2  0  0    4u3  u2    3
4 16  16
Le

u u 1  1
  2   u2   1  2    u 2 = =0.0045
 4 4 64  224
w.

1
 1  u1  =0.0011
896
ww

  3  u3  0.0168
1 1
u4   0  0  u2  u5   u4   0.0045  u5    4
4 4
1 1
u5   u4  u1  u3  u6   u5   u4  0.0011  0.0168  u6    5 
4 4
1 1 2 1 3
u6   u5  u2     u6   u5  0.0045     6
4 16 16  4 16 
 u4  0.005899, u5  0.01913, u6  0.05277
 The values of u are 0.0011,0.0045,0.0168,0.005899, 0.01913, 0.05277 .

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
10 Unit V – B.V.P. in ordinary and Partial differential equations
CW(12):Solve
ut  u xx ,0  x  2, t  0, given that u  0, t   u  2, t   0, t  0
x
and u  x, 0   sin
, 0  x  2. Using x  h  0.5, t  0.25
2 for
2 steps by Crank–Nicolson’s implicit finite difference method.
Solution: The u values are 0.3864,0.5469,0.3867,0.2115, 0.2991, 0.2115 .

Topic 3: One dimensional wave equation


 2u  2u
One dimensional wave equation is  a2
t 2 x 2

.in
h
valid for k 
a
After filling given boundary conditions

ing
(i.e., after filling first column, first row, last column by given conditions)

To find unknown 2nd row values alone by


eer
sum of just previous extreme columns
2
gin

To find unknown 3 onwards by


rd

sum of just previous extreme columns  previous 2nd value in same column
En

Eg (13) : Solve ytt  y xx upto t = 0.5 with a spacing of 0.1 subject to


y  0, t   0, y 1, t   0, yt  x,0   0 & y  x,0   10  x 1  x  .
arn

Solution :
Given differential equation ytt  y xx is of one dim. wave equation form.
Le

 2u  2u
i.e., One dimensional wave equation is  a2
t 2 x 2
w.

h
valid for k 
a
ww

2 2
Here coefficient of y xx in ytt  a y xx is 1  a  1  a  1
Given k  t difference  0.1  k
h h
WKT, k   0.1   h  0.1
a 1

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
11 .

Now draw table as follows:


x
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t
0
10. 10. 10. 10. 10. 10. 10. 10.
(I 0 10+0.1(0.9)=10.09 0
16 21 24 25 24 21 16 09
row)
0.1 1 10.16 10. 10. 10. 10. 10. 10. 10. 5.0
(II 0  5.08 0
2 15 20 23 24 23 20 15 8
row)
0.2
0+10.15 – 10.09 5.1 10. 10. 10. 10. 10. 5.1 0.0
(III 0 0
= 0.06 2 17 20 21 20 17 2 6
row)

.in
0+5.12 – 5.08 0.0 5.1 10. 10. 10. 5.1 0.0 0.0
0.3 0 0
= 0.04 8 2 15 16 15 2 8 4

0.4 0
0+0.08 – 0.06
= 0.02
0.0
4
0.0
6
5.0
8 ing
10.
09
5.0
8
0.0
6
0.0
4
0.0
2
0
eer
0+0.04 – 0.04 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.5 0 0
gin

=0 0 0 0 0 0 0 0 0
y y
( (
En

0 1
, ,
arn

t t
) )
= =
Le

0 0
← ←
w.

CW (14) : Solve numerically, 4u xx  utt with the boundary conditions


u  0, t   0, u  4, t   0 and initial conditions ut  x, 0   0 and
ww

u  x, 0   x  4  x  , taking h = 1(for 4 time steps).


 2u  2u
2
 ,
HW (15) : Approximate the solution to the wave equation x t 2
0  x  1, t  0, u  0, t   u 1, t   0, t  0, u  x, 0   sin 2 x, 0  x  1
u  x, 0 
and  0, 0  x  1 with x  0.25 and t  0.25.
t

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
12 Unit V – B.V.P. in ordinary and Partial differential equations

Topic 4: Two dimensional Laplace equation


Two dimensional Laplace equation is
 2u  2u
 2u  0  u xx  u yy  0   0
x 2 y 2
Standard five – point formula(SFPF):
1
ui , j  ui 1, j  ui 1, j  ui , j 1  ui , j 1 
4
ui , j 1

.in
ing
ui , j
ui 1, j ui 1, j
eer
ui , j 1
gin

Diagonal five – point formula(DFPF):


1
En

ui , j  ui 1, j 1  ui 1, j 1  ui 1, j 1  ui 1, j 1 


4
ui 1, j 1 ui 1, j 1
arn
Le

ui , j
w.

ui 1, j 1 ui 1, j 1
ww

For 3  3 matrix form:


B1 B12 B11 B10
B2 u1 u2 B9
u3 u4
B3 B8
B4 B7
B5 B6

To find u1, u2 , u3 , u4 :

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
13 .

Assume ui  0, for any one i


Initially take u4  0  or  take u4  some finite value

Find Rough Values [Initial values (or) Starting values] :


u1   B1  B3  u4  B11  4  by DFPF 
u2  u1  u4  B9  B11  4  by SFPF 
u3  u1  B3  B5  u4  4  by SFPF 
u4  u2  u3  B6  B8  4  by SFPF 
First Iteration onwards (apply only SFPF)
The Liebmann's iterative   n 1 1   n   n 1  n  n 1
 ui , j  ui 1, j  ui 1, j  ui , j 1  ui , j 1 

.in
formula is  4
Stop procedure until two consecutive iteration values are same.

ing
n  
n 1 
i.e., stop if ui  ui , i with error < 0.1
For 4  4 matrix form:
eer
B1 B16 B15 B14 B13
u1 u2 u3
gin

B2 B12
u4 u5 u6
B3 B11
u7 u8 u9
En

B4 B10
arn

B5 B9
B6 B7 B8
To find ui , i  1, 2,...,9 :
Le

Assume ui  0, for any one i


Initially take u4  0  or  take u4  some finite value
w.

Find Rough Values [Initial values (or) Starting values] :


 by SFPF, 
u5   B3  B7  B11  B15  4 
ww


 extreme boundary values only 
u1   B1  B3  u5  B15  4  by DFPF 
u3   B15  u5  B11  B13  4  by DFPF 
u7   B3  B5  B7  u5  4  by DFPF 
u9  u5  B7  B9  B11  4  by DFPF 

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
14 Unit V – B.V.P. in ordinary and Partial differential equations
u2  u1  u5  u3  B15  4  by SFPF 
u4  u1  B3  u7  u5  4  by SFPF 
u6  u5  u9  B11  u3  4  by SFPF 
u8  u7  B7  u9  u5  4  by SFPF 

First Iteration onwards (apply only SFPF)


The Liebmann's iterative   n 1 1   n   n 1  n  n 1
 ui , j  ui 1, j  ui 1, j  ui , j 1  ui , j 1 
formula is  4
Stop procedure until two consecutive iteration values are same.

.in
n  
n 1  
i.e., stop if ui  ui , i with error < 0.1
2
Eg (16) : Solve  u  0, the boundary conditions

ing
are given below (give
only 3 iterations)
10 20
0 30
eer
u3 u4
20 40
u1 u2
40 50
gin

60 60 60 60

Solution :
En

Assume u4  0
Find Rough Values [Initial values (or) Starting values] :
arn

u1   20  0  60  60 4  35  by DFPF 
 
u2  35  0  50  60 4  36.25  by SFPF 
   by SFPF 
Le

u3  10  20  35  0 4  16.25
u4  16.25  20  40  36.25 4  28.125  by SFPF 
w.

First Iteration onwards (apply only SFPF)


The Liebmann's iterative   n 1 1   n   n 1  n  n 1
 ui , j  ui 1, j  ui 1, j  ui , j 1  ui , j 1 
ww

formula is  4
I iteration :
 
u 1   40  60  16.25  36.25 4  38.125
1
 by SFPF 
1
u
2
  60  50  38.125  28.125 4  44.0625  by SFPF 
1
u
3
  20  10  38.125  28.125 4  24.0625  by SFPF 
1
u4   20  40  24.0625  44.0625 4  32.0313  by SFPF 
II iteration :

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
15 .

 2
u
1
  60  40  24.0625  44.0625 4  42.0313  by SFPF 
 2
u
2
  60  50  42.0313  32.0313 4  46.0157  by SFPF 
 2
u
3
  20  10  42.0313  32.0313 4  26.0157  by SFPF 
 2
u4   20  40  26.0157  46.0157  4  33.0079  by SFPF 

III iteration
 3
u
1
  60  40  46.0157  26.0157  4  43.0079  by SFPF 
 3
u   60  50  43.0079  33.0079 4  46.5040  by SFPF 

.in
2
 3
u
3
  20  10  43.0079  33.0079 4  26.5040  by SFPF 

ing
 3
u4  20  40  46.5040  26.5040 4  33.252  by SFPF 
CW (17) : Obtain a finite difference scheme to solve the Laplace equation
eer
2
solve  u  0 at the pivotal points in the square mesh. Use
Liebmann’s iterative procedure.
1000 1000
gin

1000 1000
u1 u2
2000 500
u3 u4
En

2000 0
1000 500 0 0
arn

Solution : u1  1208.3, u2  791.7, u3  1041.7, u4  458.4


Le

2
HW (18) : By iteration method, solve the Laplace equation  u  0 over
the square region, satisfying the boundary conditions
u  0, y   0, 0  y  3, u  3, y   9  y, 0  y  3,
w.

u  x, 0   3 x, 0  x  3, u  x, 3  4 x, 0  x  3.
ww

Solution : u1  3.67, u2  7.34, u3  3.34, u4  6.67

Eg (19) : Find by Liebmann’s method the values at the interior lattice


points of a square region of the harmonic function u whose
boundary values are as shown.
11.1 17.0 19.7
0 18.6
u1 u2 u3
0 21.9
u4 u5 u6

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
16 Unit V – B.V.P. in ordinary and Partial differential equations
0 u7 u8 u9 21.0

0 17.0

0 8.7 12.1 12.8 9.0

Solution :
Find Rough Values [Initial values (or) Starting values] :
u5   0  17.0  21.0  12.1 4  12.5  by SFPF, ext. bound. vals. only 

.in
u1   0  0  12.5  17.0 4  7.4  by DFPF 
u3  12.5  18.6  17.0  1.0 4  17.3  by DFPF 
 

ing
u7  12.5  0  0  12.1 4  6.2  by DFPF 
u9  12.5  9.0  12.1  21.0 4  13.7  by DFPF 
eer
u2  17.0  12.5  7.5  17.3 4  13.6  by SFPF 
u4   7.4  6.2  0  12.5 4  6.5  by SFPF 
gin

u6  12.5  21.0  17.3  13.7  4  16.1  by SFPF 


u8  12.5  12.1  6.2  13.7  4  11.1  by SFPF 
En

First Iteration onwards (apply only SFPF)


The Liebmann's iterative   n 1 1   n   n 1  n  n 1
 ui , j  ui 1, j  ui 1, j  ui , j 1  ui , j 1 
formula is  4
arn

I iteration :
  1
u 1  7.8  by SFPF  u41  6.6  by SFPF  u 7  6.6  by SFPF 
Le

1
1
u
2
 13.7  by SFPF  u 51  11.9  by SFPF  u81  11  by SFPF 
w.

1
u
1
 17.9  by SFPF  u 61  16.1  by SFPF  u9  14.3  by SFPF 
3
ww

II iteration :
 2  2
u
1
 7.9  by SFPF  u4 2  6.6  by SFPF  u 7  6.6  by SFPF 
 2
u
2
 13.7  by SFPF  u 52  11.9  by SFPF  u8 2  11.2  by SFPF 
 2
u
 2
3
 17.9  by SFPF  u 62  16.3  by SFPF  u9  14.3  by SFPF 
III iteration : Same as II iteration values. So stop the procedure.
Therefore, the solution of the given Laplace equation is
u1  7.9, u2  13.7, u3  17.9, u4  6.6, u5  11.9,
u6  16.3, u7  6.6, u8  11.2, u9  14.3

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
17 .

CW (20) : Solve
2 2
 u  u 1
2
 2  0, x  1, y  1 with h  and u  x, 1  x 2 ,
x y 2
u  1, y   y 2 .
Solution : u1  0.9, u2  0.13, u3  0.19, u4  0.13, u5  0.13,
u6  0.13, u7  0.19, u8  0.13, u9  0.19

 2u  2u
2
  0, 0  x, y  1 with u  0, y   10  u 1, y  and
HW (21) : Solve x y 2

.in
u  x, 0   20  u  x,1 . Take h  0.25 and apply Liebmann’s

ing
method to 3 decimal places.
Solution : u1  14.999, u2  16.249, u3  14.999, u4  13.749, u5  14.999,
u6  13.749, u7  14.999, u8  16.249, u9  14.999
eer
HW (22) : Solve the Laplace equation at the interior poins of the square
region given below.
1000 1000 1000
gin

500 500
u1 u2 u3
0 0
u4 u5 u6
En

0 0
u7 u8 u9
arn

0 0

0 0
0 0 0
Le

Solution : u1  71.5, u2  98.3, u3  71.5, u4  187.6, u5  250.1,


u6  187.6, u7  428.6, u8  526.8, u9  428.6
w.

Topic 5: Two dimensional Poisson equation


ww

Two dimensional Poisson equation is


 2u  2u
 2u  f  x, y   u xx  u yy  f  x, y    f  x, y 
x 2 y 2
x  ih, y  jk  jh  here 
Standard five – point formula(SFPF) for Poisson equation :
ui 1, j  ui 1, j  ui , j 1  ui , j 1  4ui , j  h 2  f  ih, jk 

Eg (23) : Solve the Poisson equation  u  10  x  y  10  , over the


2 2 2

square with sides x  0, y  0, x  3, y  3 with u  0 on the


boundary, taking h  1.

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
18 Unit V – B.V.P. in ordinary and Partial differential equations
Y(X=0) Y=3
j=3 u=0
u3 (A) u4 (B) X=3
u=0 j=2
u1 (C) u2 (D) u=0
j=1
X(Y=0)
(0,0) i=1 i=2 i=3
i=0, j=0

Solution :
Standard five – point formula(SFPF) for Poisson equation :
ui 1, j  ui 1, j  ui , j 1  ui , j 1  4ui , j  h 2  f  ih, jh 

.in
 10  ih    jh   10 
2 2
 

ing  
 2
 10 i  j  102  ∵ h  1

At A  i  1, j  2  :
eer
u0,2  u2,2  u1,1  u1,3  4u1,2  10 12  22  10   150
 
gin

0+u 2  u3  0  4u1  150


u1  150  u2  u3  / 4
En

At B  i  2, j  2  :

u1,2  u3,2  u2,1  u2,3  4u2,2  10  22  22  10   180


arn

 
u1  0  u4  0  4u2  180
u2  180  u1  u4  / 4
Le

At C  i  1, j  1 : 0  u1  0  u4  4u3  10 12  120


u3  120  u1  u4  / 4
w.

At D  i  2, j  1 : u3  0  u2  0  4u4  10 15  150


ww

u4  150  u2  u3  / 4
Here u1  u4 , u2 , u3 .
Use any method to find u1 , u2 , u3 , u4 .
Now we are going to use Gauss – Seidel method:
Initially find u1 by putting u2  u3  0
Iterations becomes

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
19 .

1 1 1


u1  37.5 u2  63.75 u3  48.5
u1   65  2
u    60
2 2
u2  80 3
 3  3
u3   65
3
u1  70 u2  80
u1   75  4  4
4
u2  82.5 u3  67.5
u1   75  5  5
5
u2  82.5 u3  67.5

 u1  u4  75, u2  82.5, u3  67.5

.in
2
CW (24) : Solve the Poisson equation  u  81xy, 0  x  1, 0  y  1,
given that

ing
1
u  0, y   0, u  x, 0   0, u 1, y   100, u  x,1  100 & h  .
3
eer
Solution :  u1  u 4  51.0, u 2  76.5, u 3  25.8

2 2 2 u0
HW (25) : Solve  u  8 x y in the square mesh given
gin

on the four
boundaries dividing the square into 16 sub squares of length 1
unit.
En

Solution :  u1  u3  u7  u9  3, u2  u4  u6  u8  2

PART – A
arn

1. Write down the explicit finite difference method for solving one
dimensional wave equation.
Solution : The formula to solve numerically the wave equation
Le

a 2u xx  utt  0 is

   
w.

ui , j 1  2 1   2 a 2 ui , j   2 a 2 ui 1, j  ui 1, j  ui , j 1
2. Write down the standard five point formula to find the numerical
ww

solution of Laplace equation.


2
Solution : Standard five – point formula(SFPF) for    0 is
1
ui , j  ui 1, j  ui 1, j  ui , j 1  ui , j 1 
4
3. What is the error for solving Laplace and Poisson’s equations by finite
difference method?
Solution : For SFPF
h 4   4u  4u 
T.E.      ...
12  x 4 y 4 
i, j

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
20 Unit V – B.V.P. in ordinary and Partial differential equations
For DFPF
h 4   4u  4u  4u 
T.E.   4  6 2 2  4   ...
6  x x y y  i , j
4. Write down the Crank – Nicolson’s formula to solve parabolic equation.
Solution :
1 1 1 1
 ui 1, j 1   ui 1, j 1     1 ui , j 1    ui 1, j   ui 1, j     1 ui , j
2 2 2 2
  
i.e.,  ui 1, j 1  ui 1, j 1  2    1 ui , j 1  2    1 ui , j   ui 1, j  ui 1, j 
Classify the partial differential equation u xx  2u xy  4u yy  0, x, y  0.

.in
5.
Solution : Given u xx  2u xy  4u yy  0, x, y  0.

ing
Here A  1, B  2, C  4
B 2  4 AC  12  0
 The given equation is elliptic.
eer
6. In one dimensional wave equation, write down the equation of explicit
scheme.
gin

Solution : The general form of the difference equation to solve the equation
utt  a 2u xx is

   
ui , j 1  2 1   2 a 2 ui , j   2 a 2 ui 1, j  ui 1, j  ui , j 1  1
En

If  a  1, the coefficient of ui , j in (1) is = 0


2 2
arn

The recurrence equation (1) takes the simplified form


ui , j 1  ui 1, j  ui 1, j  ui , j 1
Le

7. Classify the PDE y xx  xu yy  0.


Solution : Given y xx  xu yy  0.
w.

Here A  1, B  0, C   x
B 2  4 AC  4 x
ww

 The given equation is elliptic if x  0


parabolic x  0
hyperbolic x  0

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
MA2264 Numerical Methods
21 .

Unit V Assignment problems:

.in
1. Compute for 4 time steps : ut  u xx :

ing
0  x  1, t  0 u ( x, 0)  100sin  x, u (0, t )  u (1, t ) choose h 1/ 4
u  2u
Solve the initial boundary value problem :  ,
t x 2
eer
2.
x
u ( x, 0)  cos ,  1  x  1, t  0 , u (1, t )  u (1, t )  0 for t  0
2
gin

3. UsingCrank-Nicolson's implicit scheme, Solve 16ut  u xx ,


0  x  1, t  0, given that u ( x, 0)  0, u (0, t )  0, u (1, t )  100t
En

u  2u
arn

Solve by Crank-Nicolson's scheme : 32  ,


4. t x 2
 t 
0  x  1, t  0 u ( x, 0)  0 , u (0, t )  100 sin   , u (1, t )  0
Le

 6 
 u  u 0  x  1, t  0 ;
2 2
w.

Solve 2  2 :
5. t x
ww

u ( x, 0)  100( x  x 2 ) ut ( x, 0)  0, u (0, t )  0, u (1, t )  0

6. Solve the Laplace equation over the square mesh of side 4 units,
satisfying the boundary conditions:
u(0, y) = 0, 0 ≤ y ≤ 4 ; u(4, y) = 12 + y , 0 ≤ y ≤ 4 ;
u(x, 0) = 3x, 0 ≤ x ≤ 4 ; u(x, 4) = x2 , 0 ≤ x ≤ 4.

7. Obtain the values at the interior points for the harmonic function
satisfying the following boundary conditions (4 iterations) after
deriving a suitable numerical scheme.
10 20 30

For More Visit : www.LearnEngineering.in


For More Visit : www.LearnEngineering.in
22 Unit V – B.V.P. in ordinary and Partial differential equations
0 u1 u2 u3 40

0 u4 u5 u6 50

0 u7 u8 u9 60

0 70
50 60 70
0 80

Solve the partial differential equation xx 


u  u yy  10 x 2  y 2  10 

.in
8.
over a square with sides x = 0, y = 0, x = 3, y = 3, with the boundary
conditions u = 0 on all the boundary sides taking the mesh size h = 1.

ing
eer
gin
En
arn
Le
w.
ww

For More Visit : www.LearnEngineering.in

You might also like