Advanced Numerical Analysis: Dr. Hisam Uddin Shaikh Professor and Chairman
Advanced Numerical Analysis: Dr. Hisam Uddin Shaikh Professor and Chairman
and
2 y10 (y10 ) ( y11 y10 ) y11 y10 ( y12 y11) ( y11 y10 )
2 y10 y12 y11 y10 y9
2 y10 y12 2 y11 y10
NUMERICAL ANALYSIS 6
Nth term of 2nd forward difference
2 yn y yn
n1
2 yn y 2y y
n 2 n1 n
3 y0 (2 y10 )
3 y0 ( y11 2 y1 y0 ) y2 2y1 y0 ( y3 y2 ) 2( y2 y1) y1 y0
3 y0 y3 y2 2 y2 2 y1 y1 y0 y3 3 y2 3 y2 y0
3 y1 y4 3 y3 3 y2 y1
similarly
3 y2 y5 3 y4 3 y3 y2 and 3 y3 y6 3 y5 3 y4 y3
3 y9 y10 3 y9 3 y8 y7
3 yn yn 3 3 yn 2 3 yn 1 yn
n y0 yn nyn 1 n(n 1) yn 2 n(n 1)(n 2) yn 2
2! 3!
NUMERICAL ANALYSIS 7
BACK WARD –DIFFERENCE:
That is called back ward operator and also called “ nebla operator”
now the 1st difference is:
y0 y0 y1 y1 y1 y0 y2 y2 y1
yn yn yn 1
2 y2 y2 2 y1 y2
NUMERICAL ANALYSIS 8
SHIFT OPERATOR “E”:
IF “h” is the interval of differentiating in the argument ‘x” then the operator “E”
Is defined as:
E f(x)=f ( x+h )
It is also called “translation operator” due to the reason that it result the next
value of the function
E 2 f ( x) E E f ( x) E ( f ( x h)) E ( f ( x h) h)
E 2 f ( x) f ( x 2h)
E 3 f ( x) E E 2 f ( x) E E 2 ( x 2h) f (( x 2h) h)
f ( x 3h)
E4 f ( x) f ( x 4h)
E n f ( x) f ( x nh)
NUMERICAL ANALYSIS 9
Forward Differences
p p 1 2 y0 p p 1 p 2 3 y0
y p y0 p y0
2! 3!
p p 1 p 2 p 3 4 y0
4!
p p 1 p 2 p 3 ................... p (n 1) n y0
...............
n!
Where
x x0
p , x is an int erpolated value and x0 is an initail value
h
where h is a differences of arg uments ( x ' s ) such as
h x1 x0 x2 x1 x3 x2 ..................xn xn 1
y0 First difference, 2 y0 Second difference, 3 y 0 Third difference
Hisam
4 yuddin Fourth
0 Shaikh difference,....................... n
y0 nth Difference
Forward Difference Table
First Second Third Fourth Fifth Differences
Differ Differen Differen Differen
x y ences ces ces ces
x0 y0
y0
x1 y1
2 y0
x2 y2
y1
3 y0
x3 y3 2 y1 4 y0
y2
3 y1
2 y 5 y0
x4 y4 2
4 y1
y3
3 y2
x5 y5 2 y3
y4
Hisam uddin Shaikh
NEWTON –FORWARD INTERPOLATION METHOD
The formula is used for equally spaced data and only to find the first entry
That is defined as:
PROOF:
Let f(x) be a polynomial function “h” is a small increament then:
As we know that:
Using difference operator E and .
For any real p
f ( x) f ( x)
f ( x) f ( x0 ph) E p f ( x0 )
f ( xp) E p f ( x0 ) (1 ) p f ( x0 )
NUMERICAL ANALYSIS 12
By using binomial theorem:
So therefore:
p(1) 1 y0 p( p 1) p 2 2
y0
(1) y0
f ( x0 ph)
1! 2!
p
( p 1)( p 2) (1) y0 .......
p 3 3 p( p 1)....( p (n 1)) n
y
3! n! 0
HENCE PROVED
NUMERICAL ANALYSIS 13
Backward Differences
p p 1 2 yn p p 1 p 2 3 yn
y p y n p y n
2! 3!
p p 1 p 2 p 3 4 yn
4!
p p 1 p 2 p 3 ................... p ( n 1) n yn
...............
n!
Where
x xn
p , x is an int erpolated value and x0 is an initail value
h
where h is a differences of arg uments ( x ' s ) such as
h x1 x0 x2 x1 x3 x2 ..................xn xn 1
yn First difference, 2 yn Second difference, 3 yn Third difference
Hisam
4 yuddin Fourth
n Shaikh difference ,....................... n
yn nth Difference
Backward Difference Table
First Second Third Fourth Fifth Differences
Differ Differen Differen Differen
x y ences ces ces ces
x0 y0
y0
x1 y1
2 y0
x2 y2
y1
3 y0
x3 y3 2 y1 4 y0
y2
3 y1 5 y0
x4 y4 2 y2 4 y1
y3 3 y2
2 y3
x5 y5 y4
p 1 yn p( p 1) 2 p ( p 1)( p 2)
yp
y0 yn yn ........
3
1! 2! 3!
As we know that:
using the difference operator and for any real numder”p”
y p y( xn ph) E p y( xn ) (1) p yn E (1)1
By using binomial theorem:
p 1 yn p( p 1) 2 p( p 1)( p 2)
yp
y0 yn yn ........
3
1! 2! 3!
HENCE PROVED
NUMERICAL ANALYSIS 16
Central Differences
Gauss Forward Interpolation Formula
p p 1 2 y 1 p 1 p p 1 3 y1
y p y0 p y0
2! 3!
p 1 p p 1 p 2 4 y 2 p 2 p 1 p p 1 p 2 5 y 2
.
4! 5!
..............
Where
x x0
p , x is an int erpolated value and x0 is central value
h
where h is a differences of arg uments ( x ' s ) such as
h x1 x0 x2 x1 x3 x2 ..................xn xn 1
y0 First difference, 2 y 1 Second difference, 3 y 1 Third difference
4 y 2 Fourth difference and 5 y 2 Fifth differnces
Hisam uddin Shaikh
Forward Difference Table
First Second Fourth Fifth Sixth
Differe Differen Third Differenc Differenc
nces ces Differen es es Difference
x y ces s
X-3 Y-3
y3
X-2 Y-2
2 y3
X-3 Y-3
y3
X-2 Y-2
2 y3
y2
X-1 Y-1 3 y3
2 y2 4 y3
y1
x0 y0 3 y 2
5 y3
y0 2 y 1 4 y2 6 y3
x1 y1
2 y0 3 y1 5 y2
y1
x2 y2 4 y1
3 y0
2 y1
y2
x3 y3
p p 1 2 y 1 p 1 p p 1 3 y 2
y p y0 p y1
2! 3!
p 2 p 1 p p 1 4 y 2 p 2 p 1 p p 1 p 2 5 y 3
.
4! 5!
Hisam uddin Shaikh
Add both Formiula then divide by 2, we get Stirrilin ' s Formula
3 y1 3 y 2
y0 y1 p 2 2 y 1
p p 1 2
2
y p y0 p
2 2! 3!
5
y 5
y 3
p 2 p 2 1 4 y 2
p p 1 p 2
2 2 2
2
2 p 2
p 2
1
p 2
22
6
y 3
.
4! 5! 6!
Note : 1. Odd factorial terms start from p ' s and even factorial terms start from p 2 ' s
2. In Even factorial terms use one difference and on Odd factorial use two differences
X-3 Y-3
y3
X-2 Y-2
2 y3
Similarly
5 y 2 4 y1 4 y 2 or 4 y 2 4 y1 5 y 2
p 1 p p 1 p 2
1 4 1
y2 4 y 2
2 2 p 2 p 1 p p 1 p 2 5 y 2
4! 5!
1 1 2
p p 1 2 y1 p p 1 2 y1
2 p 1 p p 1 3 y1
y p y0 p y0 .
2! 2! 3!
p 1 p p 1 p 2
p 1 p p 1 p 2
1 4 1 4
y 2 y 2
2 2
4! 4!
p 2 p 1 p p 1 p 2 5 y 2
5!
Hisam uddin Shaikh
1 1 2
p p 1 2 y1
2 p p 1 2 y 0 3
y 1 p 1 p p 1 3 y1
y p y0 p y0 .
2! 2! 3!
p 1 p p 1 p 2
p 1 p p 1 p 2
1 4 1 4
2
y 2
2
y1 5 y 2
4! 4!
p 2 p 1 p p 1 p 2 5 y 2
5!
p 1 p p 1 p 2
1 4
y 2
p 1 p p 1 3 y1 2
3! 4!
p 1 p p 1 p 2
p 1 p p 1 p 2
1 4 1
2
y 1
2
5 y 2
4! 4!
p 2 p 1 p p 1 p 2 5 y 2
5!
p 1 p p 1 p 2 4 y2 4 y1
4! 2
1 p 2 5
p 1 p p 1 p 2 y 2
48 120
p p 1 2 y1 2 y0 6 4 p 4 3
y p y0 p y0 p p 1 y 1
2! 2 24
5
p 1 p p 1 p 2 4 y2 4 y1 2 p 2 5
p 1 p p 1 p 2 y 2
4! 2
120
p p 2 1 p 2 4 y 4 y
2
p p 1 p 2 p 2 5
1
y 2
2 1
4! 2
5!
2 y0 y 1
4 6 y 2
X-3 Y-3
y3
X-2 Y-2
2 y3
The following data give “I” the indicated HP and V the speed is knots
developed by a ship.
v 8 10 12 14 16
I 1000 1900 3250 5400 8950
NUMERICAL ANALYSIS 33
SOLUTION:
v I I I 2 I 3 I 4
8 1000
900
10 1900 450
1350 350
12 3250 800 250
2150 600
14 5400 1400
3550
16 8950
AS
NUMERICAL ANALYSIS 34
Now using Newton’s forward - difference formula.
NUMERICAL ANALYSIS 36
so
t 9, tn 11, An 75.1 , An 6.200 ,2 An 0.400 ,3 An 0.100
t tn 9 11
P 0.667
h 3
h 11 8
h 3
A
0.667 (0.667 1)(0.667 2)
0.100
(3)(2)(1)
A 75.1 4.135 0.044 0.0049346
A 79.1860
ANS
NUMERICAL ANALYSIS 37
EXAMPLE
Using the Guass’s forward interpolation formulae find the value of log 337.5
From the following table:
SOLUTION:
NUMERICAL ANALYSIS 38
yp y p 2 y p 3 y p 4 y p 5 y p
x p
310 -2 2.4914
0.0138
320 -1 2.5051 -0.0005
0.0002
0.0133
330 0 2.5185
y0 -0.0003 3 y
-0.0003
5 y2
2y 1 y2
4
0.0130 1 -0.0001 0.0004
340 1 2.5315 - 0.0001
0.0004 0.000
0.0126
350 2 2.5441 -
0.0004
0.0122
360 3 2.5563
NUMERICAL ANALYSIS 39
suppose
x x0 x 330
x0 330, p
h 10
h 330 320
h 10
By Guass’s interpolation formulae:
NUMERICAL ANALYSIS 40
y0.75 2.5185 (0.75)(0.0130) p( p 1) (0.0003)
(2)(1)
(0.75)(0.75 1)(0.75 2) (0.0001)
(3)(2)(1)
(0.751)(0.75)(0.751)(0.752)
(0.0003)
(4)(3)(2)(1)
(0.75 2)(0.751)(0.75)(0.751)(0.752)
(0.0004)
(5)(4)(3)(2)(1)
ANS
NUMERICAL ANALYSIS 41
EXAMPLE:
SOLUTION:
NUMERICAL ANALYSIS 42
yp y p 2 y p 3 y p 4 y p 5 y p
x p
1940 -2 17
3
1950 -1 20 4
6
7 7
1960 0 27 y1 -2
3 y2 5 y3
5 1 9
1970 1 32 -1 -2
4 y12 -1 4 y2
1980 2 36 -2
2
1990 3 38
NUMERICAL ANALYSIS 43
Now using Guass’s backward formula:
ANS
NUMERICAL ANALYSIS 44
EXAMPLE:
y10 600, y20 512, y30 439 , y40 346 y50 243
SOLUTION:
NUMERICAL ANALYSIS 45
x p yp y p 2 y p 3 y p 4 y p
10 -2 600
-88
20 -1 512 15 3 y2
-35
y0 -73
-20 y1 145 y2
2 4
30 0 439
y1
-93 10
40 1 346 -10
y0 3 y1
-103
50 2 243
NUMERICAL ANALYSIS 46
x0 30
x 35
x x0
p
h
h 40 30
h 10
p 35 30
10
p 0.5
p y0 y p2 p 3
y2 y2
p( x) y0 y1
2
1! 2
2! 3! 2
p 2 ( p 2 1)
4 y2 ........
4!
NUMERICAL ANALYSIS 47
Putting all the values in formula:
NUMERICAL ANALYSIS 48
EXAMPLE:
Apply Bessel’s formula to obtain
y .given that
25
y10 600, y20 2854, y24 3162 , y28 3544 y32 3992
SOLUTION:
First we draw the centrel difference table:
x p yp y p 2 y p 3 y p
20 -1 2854
308
74
24 -0 3162 y -8
0 y0
382 2 y1 3 y1
66
28 1 3549
448
2 y0
32 2 3992
NUMERICAL ANALYSIS 49
x x0
p
h
h x1 x0
h 28 24
h4
p 25 24 0.25
4
1
p p p 1
py0 p ( p1) 2 y1 y0 2
p( x) y0 3 y1......
1! 2! 2
3!
NUMERICAL ANALYSIS 50
Putting all the values in the formula:
1
0.25 0.25 0.251
ANS
NUMERICAL ANALYSIS 51
LAPLACE EVERETT’S FORMULA
As we Know that Gauss forward int erpolation formula is
p p 1 2 y1 p 1 p p 1 3 y1
y p y0 p y0
2! 3!
p 1 p p 1 p 2 4 y 2 p 2 p 1 p p 1 p 2 5 y 2
.
4! 5!
and 5 y 2 4 y 1 4 y 2
NUMERICAL ANALYSIS 52
As we Know that Gauss forward int erpolation formula is
p p 1 2 y 1 p 1 p p 1 2 y0 2 y 1
y p y0 p y1 y0
2! 3!
p 1 p p 1 p 2 4 y 2
p
2 p 1 p p 1 p 2 4 y 1 4 y 2 .
4! 5!
p p 1 2 y1 p 1 p p 1 2 y0
y p y0 p y1 p y0
2! 3!
p 1 p p 1 2 y 1 p 1 p p 1 p 2 4 y 2
3! 4!
p 2 p 1 p p 1 p 2 4 y1 p
2 p 1 p p 1 p 2 4 y 2
5! 5!
p 1 p p 1 p 2 4 y
2 p 2 p 1 p p 1 p 2 4 y 2
4! 5!
p 2 p 1 p p 1 p 2 4 y1
5!
2 p p 1 p 1 p p 1 2 p 1 p p 1 2 y0
y p 1 p y0 p y1 y 1
3! 3!
5 p 1 p p 1 p 2 p 2 p 1 p p 1 p 2 4
y 2
5!
p 2 p 1 p p 1 p 2 4 y1
5!
Hisam uddin Shaikh
2 p 1 2 p 1 p p 1 2 y0
y p 1 p y0 p y1 p p 1 y 1
3! 3!
5 p 2 4 p 2 p 1 p p 1 p 2 4 y1
p 1 p p 1 p 2 y 2
5! 5!
p p 1 1 p p 1 p p 1 2 y0
y p 1 p y0 p y1 2 y 1
3! 3!
p 1 p p 1 p 2 p 3 p 2 p 1 p p 1 p 2 4 y1
y 2
4
5! 5!
p 1 p p 1 2 y0 p 2 p 1 p p 1 p 2 4 y 1
p y1
3! 5!
1 q 1 q 1 q 1 q 1 1 q 1 q 1 1 q 2 1 q 3 4 y 2
y p qy0 y 1
2
....
3! 5!
p p 2 1 2 y0 p 2 p p2 1 p 2 2 2 4 y 1
p y1 ..........
3! 5!
p p 2 1 2 y0 p p 2 1 p 2 2 2 4 y1
p y1 ..........
3! 5!
q 2 q 1 q 2 q 2 1 q 2
y p qy0 2 y 1 4 y 2 .........
3! 5!
p p 2 1 2 y0 p p 2 1 p 2 2 2 4 y 1
p y1 ..........
3! 5!
3! 5!
p ( p 2 12 ) p ( p 2 12 ))( p2 2)
py1 y0
3 4 y1 ....
3! 5!
P I q or q p I
Use Laplace Everett’s formula to obtain f(1.15) .given that f(1) ==1.000
F(1.10) =1.049 ,f(1.20)= 1.096 ,f(1.30) =1.140
SOLUTION:
First we draw the centrel difference table
x p y p f ( x) y p 2 y p 3 y p
1 -1 1.000
0.49
-0.002
1.01 -0 1.049 -0.00
0.047
-0.003
1.20 1 1.090
0.044
1.140 2 1.30
NUMERICAL ANALYSIS 59
Using Laplace Everret’s formula:
3! 5!
p ( p 2 12 ) p( p 2 12 ))( p2 2)
py1 y0
3 4 y1 ....
3! 5!
3.2.1
y0.5 0.5245 1.25104 0.548 1.875104
NUMERICAL ANALYSIS 60
*LANGRANG'S INTERPOLATION FORMULA*
Let y = f(x) be a function which takes the values y0 , y1 ,y2 ,....,yn
corresponding to x0, x1 ,x2 ,.....,xn. since there are (n + 1) values of 'y'
corresponding to (n + 1) values of 'x' ,we can represent the function f(x)
by a polynomial of degree 'n'.suppose we write this polynomial in the form
f(x) = A0 x n + A1 x n 1 + ..........+An
or ,more conveniently,in the form
y = f(x) = a0 (x - x1) (x - x2).....(x - xn) + a1 (x - x0) (x - x2) ......(x - xn)
+ a2 (x - x0) (x - x1).....(x - xn) +....+an (x - x0) (x - x1).....(x - xn-1).....(1)
Here the coefficients 'ak' are chosen as to satisfy eq: (1) by the (n +1) pairs
(xi , yi). Find the interpolated valuw of y at x = x 0 put in (1)
y0 = f(x0) = a0 (x0 - x1) (x0 - x2).......(x0 - xn)
therefor,
y0
a0 =
(x0 - x1) (x0 - x2).......(x0 - xn)
Similarly, if you find y at x = x1
y1
a1 =
(x1 - x0) (x1 - x2).......(x1 - xn)
Similarly find y at x xi
yi
ai =
(xi - x0) (xi - x1).......(xi - xi-1) (xi - xi+1)......(xi - xn)
and
yn
an =
(xn - x0) (xn - x1).......(xn - xn -1)
Now,substitution the values of a0, a1 ,.....,an. into eq:(1) we get
y L0 Y0 L1 Y1 L2 Y2 ................Ln Yn ..............................................................(3)
x x1 x x2 x x3 .................. x xn
L0
x0 x1 x0 x2 x0 x3 .................. x0 xn
Lagrange Polynomials
P x L0 x y0 L1 x y1 L2 x y2
........... Ln x yn
OR
P x L0 x f x0 L1 x f x1
L2 x f x2 ........... Ln x f xn
Where
L0 x
x x1 x x2 ....( x xn )
x0 x1 x0 x2 ....( x0 xn )
L1 x
x x0 x x2 ....( x xn )
x1 x0 x1 x2 ....( x1 xn )
.
.
.
Ln x
x x0 x x1 ...( x xn 1 )
xn x0 xn x1 ...( xn xn1 )
ADVANTAGES
y y0
x, x0 so that y y0 x x0 x , x0 (1)
x x0
y y0 x x0 x0 , x1 x x1 x , x0 , x1
y0 x x0 x0 , x1 x x0 x x1 x , x0 , x1 (2)
Hisam uddin Shaikh
y y0 x x0 x0 , x1 x x0 x x1 x , x0 , x1 (2)
From 3rd differences , we get
x , x0 , x1 x0 , x1 , x2
x , x0 , x1 , x2 or
x x2
x , x0 , x1 x0 , x1 , x2 x x2 x , x0 , x1 , x2 put in (2)
y y0 x x0 x0 , x1 x x0 x x1 x0 , x1 , x2 x x2 x , x0 , x1 , x2
y y0 x x0 x0 , x1 x x0 x x1 x0 , x1 , x2
x x0 x x1 x x2 x0 , x1 , x2 , x3
x x0 x x1 x x2 x x3 x0 , x1 , x2 , x3 , x4 ......................
x x0 x x1 x x2 x x3 ..................... x xn 1 x0 , x1 , x2 , x3 , x4 , xn
Department of Mathematics ,
Shah Abdul Latif University, Khairpur
NUMERICAL DIFFERECIATION
Calculus is the mathematics of change. Because engineers
and scientists must continuously deal with systems and
processes that change. calculus is an essential tool of our
profession Standing at the heart of calculus is the
mathematical concept of differentiation.
p p 1 2 y0 p p 1 p 2 3 y0
y p y0 p y0
2! 3!
p p 1 p 2 p 3 4 y0
4!
p p 1 p 2 p 3 ................... p ( n 1) n y0
...............
n!
After rearrange
y0 p y0
p 2
p 2 y0
p 3
3 p 2 2 p 3 y0
p 4
6 p 3 11 p 2 6 p 4 y0
2! 3! 4!
dy0 0 1 2 0 0 2 3 0 0 0 6 4
0 y0 y0 y0 y0
dp 2! 3.2.1 4.3.2.1
dy0 1 1 1
y0 2 y0 3 y0 4 y0 (3)
dp 2 3 4
As according to Chain rule
dy dy dp 1 1 1 1
y0 2 y0 3 y0 4 y0
dx dp dx 2 3 4 h
dy 1 1 2 1 3 1 4
y 0 y0 y0 y0 THIS IS CALLED NEWTONIAN FORWARD
dx h 2 3 4
Hisam uddin Shaikh
INTERPOLATION FORMULA
Again differntiate y with respect to p
d 2 y0
00
2 2
y0
6 p 6 3
y0
12 p 2 36 p 22 4
y 0 (4)
dp 2 2! 3.2.1 4.3.2.1
x x0 dp 1
As p so that (2)
h dx h
find the 2nd derivative of y at x x0 so p 0 put in (4)
dy0
2 y0
6 3 y 22 4 y 2 y 3 y 11 4 y (3)
0 0 0 0 0
dp 3.2.1 4.3.2.1 12
d2y d dy
As 2
and As according to Chain rule
dx dx dx
d 2 y dy dp 2 11 4 1 1
2
y0 3
y 0 y0
dx dp dx 12 h h
d2y 1 2 11 4
2
2
y0 3
y 0 y0 THIS IS CALLED NEWTONIAN FORWARD
dx h 12
d3y d4 y
Similarly find , and more INTERPOLATION FORMULA
dx 3 dx 4
Hisam uddin Shaikh
NEWTONIAN BACKWARD INTERPOLATION FORMULA
y p y n p yn
p 2
p 2 yn
p 3
3 p 2 2 p 3 yn
2! 3!
p 4
6 p 3 11 p 2 6 P 4 yn
4!
Now differentiate y with respect to p
dy
0 yn
2 p 1 2 yn
3p 2
6 p 2 3 yn
4p 3
18 p 2 22 p 6 4 yn
dp 2.1 3.2.1 4.3.2.1
y p y0 p y0
p 2
p 2 y 1
p 3
p 3 y 1
2! 3!
p 4
2 p 3 p 2 2 p 4 y 2
4!
p 5
2 p 4 p 3 2 p 2 2 p 4 4 p 3 2 p 2 4 p 5 y 2 . ..............
Hisam uddin Shaikh 5!
Now differentiate y with respect to p
dy
0 y0
2 p 1 2 y1
3p 2
1 3 y 1
dp 2! 3!
4 p 3 6 p 2 2 p 2 4 y 2
5 p 4 15 p2 4 5 y 2
. ..............
4! 5!
The derivative of y at x x0 so that p 0
dy 1 1 1 4 1 5
y0 2 y1 _ 3 y1 y 2 y 2
dp 2 6 12 30
x xn dp 1
and p then (2)
h dx h
dy
Now we have to find so by chain rule, we can write as
dx
dy dy dp 1 1 1 4 1 5 1
y0 2 y1 _ 3 y1 y 2 y 2
dx dp dx 2 6 12 30 h
dy 1 1 1 1 4 1 5
y0 2 y1 _ 3 y1 y 2 y 2 Hisam uddin Shaikh
dx h 2 6 12 30
Similarly find yourself 2nd derivative, 3rd derivative and so on
y p y0 p y1
p 2
p 2 y 1
p 3
p 3 y 2
2! 3!
p 4
2 p 3 p 2 2 p 4 y 2
p 5
2 p 3 4 p 5 y 3
.
4! 5!
Differentiate y with respect to p
dy
y1
2 p 1 2 y1
3p 2
1 3 y 2
dp 2! 3!
4p 3
6 p 2 2 p 2 4 y 2
5p 4
6 p 2 4 5 y 3
x xn dp 1
Now p then
h dx h
dy
As we have required , so by chain rule, we can write as
dx
dy dy dp 1 2 1 3 1 4 1 5 1
y1 y1 y 2 _ y 2 y 3
dx dp dx 2 6 12 30 h
dy 1 1 2 1 3 1 4 1 5
y1 y1 y 2 _ y 2 y 3
dx h 2 6 12 30
You find 2nd derivative , 3rd derivative and so on
Hisam uddin Shaikh
Stirriling’s Interpolation Formula
As we know that the Stirrilings formula is
y p y0 p
0y y 1
p 2
2
y 1
p p 2
1
3
y 1 3
y 2
2 2! 3!
p 2 p 2 1 4 y 2
p p 2 1 p 2 2 5 y 2 5 y 3
4! 5!
p 2 p 2 1 p 2 2 6 y 3 .
6!
After rearrnaging we get
y0 y1
y p y0 p
p 2 2 y1
p 3 p 3 y1 3 y 2
p 4
p 2 4 y 2
2 2! 3! 4!
p 5
2 p 3 p 3 2 p 5 y 2 5 y 3
5!
p 6
2 p 4 p 4 2 p 2 6 y 3
.
Hisam uddin Shaikh
6!
Differentiate y with respect to p
dy
0
0y y 1
2 p 2
y 1
1 3 p 2
1
3
y 1 3
y 2
dp 2 2! 2 3!
4 p 3 2 p 4 y 2
1 5 p
4
6 p 2
3 p 2
2
5
y 2 5
y 3
4! 2 5!
6p 5
8 p 3 4 p3 4 p 6 y 3
6!
dy
As we have required at x x0 so that p 0
dx
dy y0 y1 0 2
y 1 0 1
3
y 1 3
y 2
0 0 4
y 2
dp 2 2! 3! 4!
0 0 0 2 5 y 2 5 y 3 0 0 0 0 6 y 3
Hisam uddin Shaikh
5! 6!
dy y y1 1 1
0
3
y 1 3
y 2 5 y 2 5 y 3
dp 2 6 60
x x0 dp 1 dy
Now we know that p so that , As required ,
h dx h dx
so by chain rule , we can write as
y0 y1 1
3
y 1 3
y 2 1
dy dy dp 2 6
dx dp dx 1 h
5
y 2 5
y 3
60
dy 1 y0 y1 1 1
3
y 3
y 5
y 5
y
h 3
6
2
60
1 2
dx 2
Now you find yourself 2nd derivative, 3rd derivat ive and so on
Hisam uddin Shaikh
Bessels Interpolation Formula
As we Know that Bessels formula is
p p 1 2 y0 2 y1 p 1/ 2 p p 1 3 y1
y p y0 p y0
2! 3!
p 1 p p 1 p 2 4 y1 4 y 2
.
4!
After rearranging , we get
y p y0 p y0
p 2
p
2
y0 2
y1
2!
p 3
3 / 2 p 2 1/ 2 p 3 y1
3!
p 4 2 p 3 p 2 2 p 4 y1 4 y 2
4p 3
6 p 2 2 p 2 4 y1 4 y 2
dy 4!
We have required at x x0 so that p 0
dx
dy 0 1 2 y0 2 y1 0 0 1/ 2 3 y1
y0
dp 2! 3!
0 0 0 2 4 y1 4 y 2
4!
dy 1 2 1 3 1
y0 y0 y1
2
y 1 4 y1 4 y 2
dp 2 12 12
Hisam uddin Shaikh
x x0 dp 1
Now p so that
h dx h
dy
We have required
so by chain rule we can write as
dx
1 2 1 3
y y 2
y y
dy dy dp 0 2 0 1
12
1
1
dx dp dx 1 h
y1 y 2
4 4
12
1 2 1 3
y y 2
y y
dy 1 0 2 0 1
12
1
dx h 1
4 y1 4 y 2
12
Hisam uddin Shaikh Now find 2nd deri var ive, 3rd derivative and so on
Advanced Numerical Analysis
Department of Mathematics ,
Shah Abdul Latif University, Khairpur
NUMERICAL INTEGRATION
INTRODUCTION
According to the dictionary definition, to integrate means
“ to bring together, as parts, into a whole; to unite; to indicate the
total amount ” b
y
i 1
i
y
i 1
i f x dx
Hisam uddin Shaikh Mean a
.
n ba
This formula has hundreds of engineering and scientific
applications.
Y = f(x)
y0 y1 y2 Yn-1 yn
x
O x0 X0 + nh
x1 x2
Hisam uddin Shaikh
Develop Newton-Cote’s Quadrature formula
Let
b
I f x d x, where f x takes the values y0 , y1 , y2 ,...... yn for x0 , x1 , x2 ,......xn
a
Let us divide the int erval a, b int o n sub int ervals of width h so that
x0 a, x1 x0 h, x2 x0 2h,.......... xn x0 nh b, then
b x0 nh
p p 1 2 y0 p p 1 p 2 3 y0
y p y0 p y0
2! 3!
p p 1 p 2 p 3 4 y0
4!
...............
p p 1 p 2 p 3 ................... p (n 1) n y0
...
n!
p p 1 2 y0
y0 p y0
2!
n
p p 1 p 2 3 y0
h dp
0
3!
p p 1 p 2 p 3 0
4
y
4!
n
p2 p3 p 2 2 y0 p 4 p3 p 2 3 y0
py0 y0 3 2
2 3 2 2! 4 3 2 3!
h
p5 p 4
p 3
p 2
4 y0
6 11 6
5 4 3 2 4! 0
Hisam uddin Shaikh
n2 n3 n 2 2 y0
ny0 y0
2 3 2 2!
n n4 3
y
I f x0 ph h dp h n3 n 2 0
0 4 3!
n 5
n 4
n 3
2 y0
4
3 11 3n
5 2 3 4!
I f x dx
x0
x0 h
f x dx
x0 2 h
f x dx ........
x0 n 1 h
f x dx
h h h h
y0 y1 y1 y2 y2 y3 ........ yn 1 yn
2 2 2 2
Hisam uddin Shaikh
In Left hand side apply the property of int egrals that is a int egral
is subdivided int o n sub int ergals so that
h y0 y1 y1 y2 y2
x0 nh
I f x dx
x0
2 y
3 ............... y n 1 y n
where n 1, 2, 3, ......
THIS IS CALLED TREPEZOIDAL INTEGRAL FORMULA.
NOTE : This formula is suitable for the polynomial
function of first order only
Hisam uddin Shaikh
SIMPSON’S 1/3 RULE
Put n 2 , in Quadrature and taking the curve through x0 , y0 , x1 , y1 and
x2 , y2 as a straight lineso that higher differences
of sec ond become zero, we get
x0 2 h
4 8 4 y0
2
I f x dx h 2 y0 y0
x0 2 3 2 2!
2 1
h 2 y0 2 y0 2 y0 2h y0 y0 2 y0
6 6
2h h
6 y0 6y0 2 y0 6 y0 6 y1 y0 y2 2 y1 y0
6 3
h h
6 y0 6 y1 6 y0 y2 2 y1 y0 y0 4 y1 y2
3 3
x0 2 h
h
I f x dx y0 4 y1 y2
x0
3
Hisam uddin Shaikh
Similarly we take
x0 4 h
2h
I f x dx 6 y2 6y2 2 y2
x0 2 h
6
2h
6 y2 6 y3 y2 y4 2 y3 y2
6
2h 2h
6 y2 6 y3 6 y2 y4 2 y3 y2 y2 4 y3 y4
6 6
x0 4 h
2h
I f x dx y 2 4 y3 y 4
x0 2 h
6
Similary
x0 6 h
2h
I f x dx y4 4 y5 y6
x0 4 h
6
Hisam uddin Shaikh
upto nth term
x0 nh
2h
I f x dx yn 2 4 yn 1 yn
x0 n 1 h
6
Adding all above int egrals, we get
x0 2 h x0 4 h x0 6 h x0 nh
I f x dx f x dx f x dx ........ f x dx
x0 x0 2 h x0 4 h x0 n 1 h
2h 2h 2h
0
y 4 y1 y 2 2
y 4 y3 y 4 y4 4 y5 y6 .
6 6 6
2h
....... yn 2 4 yn 1 yn
6
h y0 4 y1 y2 y2 4 y3 y4 y4 4 y5
x0 nh
I f x dx
x0
3 6 y .......... y n2 4 y n 1 y n
In right hand side, we see that the except the first and
last entry , even entries are twiced and odd entries are t times so
generally we can write as
3h 8 y3 12 y4 y3 6 y5 2 y4 y3
8 y6 3 y5 3y4 y3
3h 8 y3 12 y4 12 y3 6 y5 12 y4 6 y3
8 6
y 3 y5 3 y 4 y3
3h
y3 3 y4 3 y5 y6
8
x0 6 h
3h
I f x dx y3 3 y4 3 y5 y6
x0 3 h
8
Hisam uddin Shaikh
Similarly
x0 9 h
3h
I f x dx y6 3 y7 3 y8 y9
x0 6 h
8
.
Adding all above int egrals, from x0 to x0 nh ,
where n is multiple of 3, we get
x0 3 h x0 6 h x0 9 h
I f x dx f x dx f x dx .
x0 x0 3 h x0 6 h
3h 3h
y0 3 y1 3 y2 y3 y3 3 y4 3 y5 y6
8 8
3h
y6 3 y7 3 y8 y9 .
8
Hisam uddin Shaikh
In Left hand side apply the property of int egrals that is a
int egrla is subdivided int o n sub int ergals so that
x0 nh
I f x dx
x0
3h y0 3 y1 3 y2 y3 y3 3 y4 3 y5 y6
8 y6 3 y7 3 y8 y9 ......
x0 nh
3h y0 yn 3 y1 y2 y4 y5 y7 ............... yn 1
I f x dx
x0
8 2 y3 y6 y9 ............... yn 3
where n 3, 4, 5 ......
NOTE : This int egral is suitable for those int erval which is
subdivided int o multiple of 6 sub int ervals.
Hisam uddin Shaikh
GIVE EXAMPLES OF EACH
METHOD
Department of Mathematics ,
Shah Abdul Latif University, Khairpur
NUMERICAL SOLUTION OF
DIFFERENTIAL EQUATIONS
dy f x, y dx
y0 x0
x x
y y0
f x, y dx
x0
or y y0
f x, y dx
x0
(2)
This is called int egral eqution equivalent to (1), for it contains the unknown y
under the int egral sign
Hisam uddin Shaikh
As a First approximation or First iteration y1 , put y y0 in f x, y and int egrate (2),
x
we get y1 y0
f x, y dx
x0
0
y2 y0
x0
f x, y1 dx, Note : Picard ' s method can be applied only a lim ited class of equations
in whichthe successive int egrations can be performed easily.
This method can extended to higher order differential equations and system
Similarly 3rd iteration
x
of equations.
y3 y0
f x, y dx
x0
2
yn y0
f x, y
x0
n 1 dx. Hence this method gives a sequence of approximations
x x0 x x0
2 3
y1 y0 x x0 y ' 0
2!
y
''
0
3!
y
'''
0
.... (2)
y ' , y '' , y ''' ,..... then Taylor series will be
1 1 1
x x1
2
x x1
3
y2 y1 x x1 y ' 1
2!
y ''
1
3!
y '''
1
...
x x2 2
x x2
3
y3 y2 x x2 y
'
2
2!
y ''
2
3!
y '''
2
...
x xn
n
.........
n!
y
n
n