0% found this document useful (0 votes)
90 views132 pages

Advanced Numerical Analysis: Dr. Hisam Uddin Shaikh Professor and Chairman

The document discusses interpolation and numerical analysis techniques. It contains: 1) A definition of interpolation as estimating the value of a function for intermediate values of the independent variable based on known data points. 2) A discussion of different interpolation methods including Newton's forward interpolation method, which uses forward differences to interpolate values using a polynomial formula. 3) Explanations and formulas for calculating forward differences up to the nth order. 4) An example proof of Newton's forward interpolation method using differences, binomial expansions, and the shift operator.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views132 pages

Advanced Numerical Analysis: Dr. Hisam Uddin Shaikh Professor and Chairman

The document discusses interpolation and numerical analysis techniques. It contains: 1) A definition of interpolation as estimating the value of a function for intermediate values of the independent variable based on known data points. 2) A discussion of different interpolation methods including Newton's forward interpolation method, which uses forward differences to interpolate values using a polynomial formula. 3) Explanations and formulas for calculating forward differences up to the nth order. 4) An example proof of Newton's forward interpolation method using differences, binomial expansions, and the shift operator.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 132

Advanced Numerical Analysis

Dr. Hisam Uddin Shaikh


Professor
and
Chairman
Department of Mathematics ,
Shah Abdul Latif University, Khairpur
INTERPOLATION
Suppose the function y = f(x) that takes the some values
x: x0 x1 x2 ........................ xn
y: y0 y1 y2 ....................... yn

Then the process of finding the value of y corresponding


to any value of x = xi between xo and xn is called
interpolation.
Thus interpolation is the technique of estimating the value
of value of a function for any intermediate value of the
independent variable while the process of computing the
value of the function outside the given range is called
extrapolation
Hisam uddin Shaikh
The study of interpolation is based upon calculus of finite
differences and differences may be equally spaced
(difference between independent variable is same) and
unequally spaced data ( difference is not same in between
values of independent variable).
The methods that are valid for only equally spaced data
1. Newton’s Forward interpolation method
2. Newton’s Backward interpolation method
3. Newton’s Central interpolation method
 Gauss Forward interpolation method
Gauss Backward interpolation method
Stir riling method
Bessel’s method
Laplace Everett's method
Hisam uddin Shaikh
The methods that are valid for only equally spaced data or
unequally spaced data

1. Lagrange's interpolation method

2. Newton’s Newton Divided difference method

Hisam uddin Shaikh


FORWARD DIFFERENCES:
If we subtract from each value of “y” we get y1  y0 , y2  y1, y3  y2 ,..........yn  yn1

respectively. Known as the first difference of “y”.


these
y results
 y , y which
,.............may
 y be denoted by:
0 1 2 n
  y0  y1  y0 ,  y1  y2  y1,  y2  y3  y2
 y3  y4  y3,  y4  y5  y4 ,  yn  yn  yn 1
Where “  “ is a symbol representing an operation of forward – difference
and called first forward- difference the first forward differences are given by:
 y  y  y i  0,1,2,3........
i i1 i
y y y
1 2 3
y y y
2 3 2
y y y
3 4 3
NUMERICAL ANALYSIS 5
F(x) =f( x+ h)-f(x).This is called first difference where” h” is a
small increment (h…0)
Hence the 2nd forward difference is:
2 y0   (y0 ) y0  y1  y0
2 y0   ( y1  y0 )  y1  y0  ( y2  y1)  ( y1  y0 )  y2  y1  y1  y0
2 y0  y2  2 y1  y0

and

2 y1   (y1)   ( y2  y1)  y2 y1  ( y3  y2 )  ( y2  y1)


 2 y1  y1  y2  y2  y1  y3  2 y2  y1

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
n1
2 yn  y  2y y
n 2 n1 n

3 y0   (2 y10 )
3 y0   ( y11  2 y1  y0 )  y2  2y1  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  y1 y1  y1  y0 y2  y2  y1

yn  yn  yn 1

2 y2  ( y2  y1)  y2 y1  ( y2  y1 )  ( y1  y2 )

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:

p( x)  y0  py0  p( p 1) 2 y0  p( p 1)( p  2) 3 y0  ..........


2! 3!

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:

1 p(1)   p( p 1) (1) p 2 2


 1 
 
f ( xp)  

1! 2! 
 f ( x0 )
 p(p 1)( p  2) (1) p 3 3  p( p 1)( p  2)( p  3) (1) p  4 4 ........

 3! 4! 

 p(1) 1 y0 p( p 1) p  2 2 p( p 1)( p  2) 


 

y0   (1)  y0  (1)  y0  ........
p 3 3
 1! 2! 3! 

If f(x) is a polynomial of nth degree then:


 n  k y0  0 , k  0,1,2,3........

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

Hisam uddin Shaikh


NEWTON – BACKWARD INTERPOLATION FORMULA:

 p 1 yn p( p 1) 2 p ( p 1)( p  2) 
yp  

y0    yn   yn  ........
3
 1! 2! 3! 

Where y p  y( xn  ph) Is known as NEWTON –BACKWARD DIFFERENCE


PROOF:

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 y1
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
y3
X-2 Y-2
 2 y3

X-1 Y-1 y2 3 y3


 2 y2  4 y3
x0 y0 y1 3 y 2
5 y3
2 y 1  4 y2 6 y3
x1 y1 y0 3 y1
 2 y0 5 y2
x2 y2 y1  4 y1
3 y0
 2 y1
y2
x3 y3

Hisam uddin Shaikh


Central Differences
Gauss Backward Interpolation Formula
p  p  1  2 y1  p  1 p  p  1 3 y 2
y p  y0  p y1  
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!
 ..............
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
y1  First difference,  2 y 1  Second difference,  3 y  2  Third difference
 4 y 2  Fourth difference and  5 y 3  Fifth differnces
Hisam uddin Shaikh
Backward 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
y3
X-2 Y-2
 2 y3
y2
X-1 Y-1 3 y3
 2 y2  4 y3
y1
x0 y0 3 y 2
5 y3
y0 2 y 1  4 y2 6 y3
x1 y1
 2 y0 3 y1 5 y2
y1
x2 y2  4 y1
3 y0
 2 y1
y2
x3 y3

Hisam uddin Shaikh


Central Differences
Stirling’s Interpolation Formula
As we Know that Gauss forward int erpolation formula is
p  p  1  2 y 1  p  1 p  p  1  3 y1
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!

Also Know that the Gauss Backward formula is

p  p  1  2 y 1  p  1 p  p  1 3 y 2
y p  y0  p y1  
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 y1  3 y 2 
 y0  y1  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

Hisam uddin Shaikh


Stirling’s 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
y3
X-2 Y-2
 2 y3

X-1 Y-1 y2 3 y3


 2 y2  4 y3
y1 3 y
x0 y0 2
2 y 5 y3
1  4 y2
y0 6 y3
x1 y1 3 y 1
 2 y0 5 y2
x2 y2 y1  4 y1
3 y0
 2 y1
y2
x3 y3

Hisam uddin Shaikh


Central Differences
Bessel's Interpolation Formula
As we Know that Gauss forward int erpolation formula is
p  p  1  2 y 1  p  1 p  p  1  3 y1
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!
Now change the differences as
 3 y 1   2 y0   2 y1 or  2 y1   2 y0   3 y1

Similarly

 5 y 2   4 y1   4 y 2 or  4 y 2   4 y1   5 y 2

Hisam uddin Shaikh


Put in above the formula , we get Bessels formula as
1 1 
p  p  1   2 y1   2 y1 
 2 2   p  1 p  p  1  3 y1
y p  y0  p y0  
2! 3!

 p  1 p  p  1  p  2   
1 4 1
 y2   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 y1 p  p  1  2  y1 
2   p  1 p  p  1  3 y1
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 y1
2  p  p  1  2   y 0   3
y  1    p  1 p  p  1 3 y1
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
  y1   5 y 2  


4! 4!

p  2   p  1 p  p  1  p  2   5 y 2

5!

Hisam uddin Shaikh


1  1 2  1 
p  p  1   2 y1
2  p  p  1  2   y 
0 

p  p  1  2    3
y 
1 

y p  y0  p y0  .  
2! 2! 2!

 p  1 p  p  1  p  2   
1 4
 y 2 
 p  1 p  p  1  3 y1 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!

Hisam uddin Shaikh


  p  p  1    2 y1   2 y0     1  p  1   3 
y p  y0  p y0         p  p  1      y 1 
  2!   2     4 6   

   p  1 p  p  1  p  2     4 y2   4 y1 
   

  4!   2 

  1  p  2   5
   p  1 p  p  1  p  2         y 2
  48 120  

  p  p  1    2 y1   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 y2   4 y1     2   p  2  5
       p  1 p  p  1  p  2       y 2
  4!   2 
   120 
  

Hisam uddin Shaikh


  p  p  1
y p  y0  p y0   
   2 y1   2 y0  
 
 
  p  p  1 p  1 
2   
 3 y 1 
    
  2!   2   3!
   

  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!
  

The Diagram of differences are


y0  2 y 1  4 y 2  6 y 3
y0  3 y 1
 5 y 2

 2 y0  y 1
4  6 y 2

Hisam uddin Shaikh


Bessels 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
y3
X-2 Y-2
 2 y3

X-1 Y-1 y2 3 y3


 2 y2  4 y3
y1 3 y
x0 y0 2
2 y 5 y3
1  4 y2
y0 6 y3
x1 y1 3 y 1
 2 y0 5 y2
x2 y2 y1  4 y1
3 y0
 2 y1
y2
x3 y3

Hisam uddin Shaikh


Choice of Interpolation formula
The coefficients in the central difference formulae are
smaller and converge faster than those in Newtonian’s
formulae. After a few terms, the coefficients in the Stir-
-riling's formula decrease more rapidly than those of
Bessel's formula and the coefficients of Bessel's formula
decrease more rapidly than those of Newtonian formulae.
As much, whenever possible central difference formulae
should be used in preference to Newtonian formulae.

The right choice of an interpolated formulae however,


depends on the position of the interpolated value in the
given data.

Hisam uddin Shaikh


The following rules will be found useful:

1. To find a tabulated near the beginning of the table,


use Newtonian Forward formula
2. To find a value near the end of the table, use
Newtonian backward formula
3. To find an interpolated value near the center of the
table, use either Stirrilings or Bessels formula.
• If interpolation is reqiured for p lying between
---1/4 and ¼, prefer Stirrilings formula
• If interpolation is required for p lying between ¼
and ¾, use Bessels formula

Hisam uddin Shaikh


The first term in the table is called “the leading term ” and the differences
are called” leading differences” .The above differences table is known as
forward differences table or “ diagonal Differences table”
EXAMPLE:

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

Find I and v =9 , using Newton’s forward interpolation formula?

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

V0  8,V  P , I0 1000 , I0  900 , 2 I0  450, 3 I0  350 4 I0  250

NUMERICAL ANALYSIS 34
Now using Newton’s forward - difference formula.

I  I0  pI0  p( p 1) 2 y0  p( p 1)( p  2) 3I0  p( p 1)( p  2)( p 3) 4 I0


2! 3! 4!
AS we know that:
x  x0 v  v0 9  8 1
p     0.5
h h 2 2
now
h  x1  x0
h  v1  v0
h 10  8  2

I p  (1000)  (0.5)(900)  (0.5)(0.5 1) (450)  


0.5  (0.5 1)(0.5  2)
(2)(1) (3)(2)(1)  350 
 
0.5 (0.51)(0.5 2)(0.53)
(4)(3)(2)(1)
 250 
1000  450  56.25  21.875  9.766
 1405.5859
ANS
NUMERICAL ANALYSIS 35
EXAMPLE

The amount A of a substance remaning in reacting system after an interval


Of “t” in a certain chemical experiment is tabulated below:
t(min) 2 5 8 11
A(gm) 94.8 87.9 81.3 75.1

Obtain the value of A where t=9 , using Newton’s backward formula?


SOLUTION:
t A
A 2 A 3 A
2 94.8
-6.900
5 87.9 0.300
-6.600 0.100
8 81.3 0.400
-6.200
11 75.1

NUMERICAL ANALYSIS 36
so
t  9, tn 11, An  75.1 , An   6.200 ,2 An  0.400 ,3 An  0.100

 p An p( p 1) 2 p ( p 1)( p  2) 


A
 An    An   An 
3


1! 2! 3! 
 

t  tn 9 11
P   0.667
h 3
h 11 8
h 3

(75.1)  (0.667)(6.200)  (0.667)(0.667 1) (0.400)


 



1 (2)(1) 

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:

x 310 320 330 340 350 360


Yx=log 2.4914 2.5051 2.5185 2.5315 2.5441 2.5563
x

SOLUTION:

First we draw the difference table:

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 y2
 2y 1  y2
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:

x  337.5 , p  0.75 , y0  2.585


Putting the following values in formula:

y p  p( x)  y0  py0  p( p 1) 2 y1  p( p 1)( p  2) 3 y1 


2! 3!
( p 1) p( p 1)( p  2) 4 ( p  2)( p 1) p( p 1)( p  2) 5
 y2   y2
4! 5!
( p 3)( p  2)( p 1) p( p 1)( p  2)( p 3) 6
  y3  .......
6!

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.751)(0.75)(0.751)(0.752)
(0.0003)
(4)(3)(2)(1)
(0.75 2)(0.751)(0.75)(0.751)(0.752)
 (0.0004)
(5)(4)(3)(2)(1)

y0.75  2.5185  9.75103  2.8125105  5.46875106  5.1269531 3.7597656106


y0.75  2.5282822

ANS

NUMERICAL ANALYSIS 41
EXAMPLE:

Interpolate by means of Guass’s backward interpolation formula the sales of a


Concern for the year 1966 .given that:

1940 1950 1960 1970 1980 1990


year(x)
Sales(in
Lakh:of 17 20 27 32 36 38
RS)

SOLUTION:

First we draw the table:

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 y1 -2
3 y2 5 y3
5 1 9
1970 1 32 -1 -2
4  y12 -1 4 y2
1980 2 36 -2

2
1990 3 38

NUMERICAL ANALYSIS 43
Now using Guass’s backward formula:

y p  p( x)  y0  py1  p( p 1) 2 y1  ( p 1)P( p 1) 3 y2 


2! 3!
( p  2)( P 1) p( p 1) 4 ( p  2)( p 1) p( p 1)( p  2) 5
 y2   y3
4! 5!
x 1976
x0 1970
h 1970 1960
h 10
x  x0 1976 1970
p   0.6
h 10
y0.6  32  (0.6)(5)  (0.6)(0.6 1) (1)  (0.6 1)(0.6)(0.6 1) (1) 
2.1 3.2.1
(0.6 2)(0.61) (0.6)(0.61) (0.6  2)(0.61)(0.6)(0.61)(0.6 2)
(2)  (9)
4.3.2.1 5.4.3.2.1
y0.6  32  3  4.8  0.064  0.0832  0.104832
y0.6  30.114368

ANS

NUMERICAL ANALYSIS 44
EXAMPLE:

Using strilling’s formula to find y35 given that:

y10  600, y20  512, y30  439 , y40  346 y50  243

SOLUTION:

Now first we draw the centrel difference table

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 y2
-35

y0 -73
-20  y1 145  y2
2 4
30 0 439
y1
-93 10
40 1 346 -10
y0 3 y1
-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

Using strilling’s formula:

p   y0  y  p2 p   3
y2  y2 
p( x)  y0      y1  
2

1! 2 
 2! 3!  2 

p 2 ( p 2 1)
 4 y2 ........
4!
NUMERICAL ANALYSIS 47
Putting all the values in formula:

0.5  (93) (73)   (0.5)2 (20)  0.5((0.5)2 1)  (10)  (35) 


y35  439    
1 2 
 2.1 3.2.1  2 
(0.5) 2 ((0.5)2 1)
 (145)
4.3.2.1
y35  435 41.5 2.5 0.781251.132815
y 390.648
35
ANS

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 y1 3 y1
66
28 1 3549
448
2 y0

32 2 3992
NUMERICAL ANALYSIS 49
x  x0
p
h
h  x1  x0
h  28  24
h4
p  25  24  0.25
4

Using Bessel’s formula:

 1 
p  p  p 1
py0 p ( p1)  2 y1 y0   2 
p( x)  y0      3 y1......
1! 2!   2 

3!

NUMERICAL ANALYSIS 50
Putting all the values in the formula:

 1 
0.25  0.25  0.251

y25  3162  (0.25)(382)  0.25(0.251)  74 (66)  


   2 
  (8)
1 2.1  2  3.2.1
y
25 316295.50.656250.0625
y25 3256.7813

ANS

NUMERICAL ANALYSIS 51
LAPLACE EVERETT’S FORMULA
As we Know that Gauss forward int erpolation formula is
p  p  1  2 y1  p  1 p  p  1 3 y1
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!

Change the odd differences of above method as

y0  y1  y0 ,  3 y1   2 y0   2 y1

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 y1  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 y1  p 
 2   p  1 p  p  1  p  2   4 y 2 
 
5! 5!

Hisam uddin Shaikh


 p  p  1  2 y 1  p  1 p  p  1   2 y 1    p  1 p  p  1   2 y0 
y p  y0  p  y0   p  y1     
 2! 3!  3!
 

  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 y1 

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 y1 

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 y1 
  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 y1 
  y 2 
4

5! 5!

Separate the terms as

Hisam uddin Shaikh


P  I  q or q  p  I
p  p  1  1  p   p  1 p  p  1  p  2   p  3
y p   1  p  y0   2 y 1   4 y  2  .......
3! 5!

 p  1 p  p  1   2 y0   p  2   p  1 p  p  1  p  2    4 y 1 
 p  y1   
3! 5!

Now sup pose that q  1  p

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!

Hisam uddin Shaikh


1  q   q q   q 1  q    q    q  1  2  q 
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!

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!

Hisam uddin Shaikh


y p  qy0  q(q 1 ) 3 y1  q(q 1 )(q  2 ) 4 y2 ............
2 2 2 2 2 2

3! 5!
p ( p 2 12 ) p ( p 2 12 ))( p2  2)
 py1   y0 
3 4 y1 ....
3! 5!
P  I  q or q  p  I

This is known as “LAPLACE EVERETT’S FORMULA

Hisam uddin Shaikh


EXAMPLE:

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:

y p  qy0  q(q 1 )  3 y1  q(q 1 )(q  2 ) 4 y2 ............


2 2 2 2 2 2

3! 5!
p ( p 2 12 ) p( p 2 12 ))( p2  2)
 py1   y0 
3 4 y1 ....
3! 5!

x0  1.10 h  1.20 1.10  0.1


x  x0 1.15 1.10
x 1.15, p    0.5
h 0.1
q 1 p
q 1 0.5  0.5
(0.5)((0.5) 2 12 )
y0.5  (0.5)(1.049)   (0.002)
3.2.1
 (0.5)(1.096)  (0.5)(0.25) 1 ) (0.003)
2 2

3.2.1
y0.5  0.5245 1.25104  0.548 1.875104

f (1.15) y0.5 1.0728125


ANS

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

(x - x1) (x - x2).....(x - xn) y0 (x - x0) (x - x2) ......(x - xn) y1


y = f(x) = +
(x0 - x1) (x0 - x2).......(x0 - xn) (x1 - x0) (x1 - x2).......(x1 - xn)
(x - x0) (x - x1).....(x - xn).....(x - xi-1) (x - xi+1)......(x - xn) yi
+
(xi - x0) (xi - x1).......(xi - xi-1) (xi - xi+1)......(xi - xn)
(x - x0) (x - x1) (x - x2).......(x - xn -1) yn
+ ........................eq:(2)
(xn - x0) (xn - x1) (xn - x2).......(xn - xn -1)

Equation (2) is Lagrange's formula for interpolation .This formula can


be used whether the values x0, x1 ,x2 ,.....xn are equally spaced or not.

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

•A straightforward approach is the


use of Lagrange polynomials.

•The Lagrange Polynomial may be


used where the data set is unequally
spaced.
General form of the Lagrange
Interpolating Polynomial

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  xn1 )
ADVANTAGES

•The Lagrange formula is popular


because it is well known and is easy to
code.
•Also, the data are not required to be
specified with x in ascending or
descending order.
NEWTON DIVIDED DIFFERENCE METHOD

The Lagrange’s formula has the draw back that


if another interpolation value is inserted, then
Lagrange’s coefficients are required to be
recalculated. This labor of re computing the
interpolation coefficients is saved by using
Newton’s Divided Difference Method

Hisam uddin Shaikh


NEWTON DIVIDED DIFFERENCE METHOD
Let y0 , y1 , y2 ,............. yn be the values of y  f  x  corresponding to the arg uments

x0 , x1 , x2 ,.............xn then from the definition of differences, we have

y  y0
 x, x0   so that y  y0   x  x0   x , x0  (1)
x  x0

from the 2nd differences  x , x0 , x1  


 x, x0    x0 , x1 
so that
x  x1
 x, x0    x0 , x1    x  x1   x , x0 , x1  put in (1)

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 

Hisam uddin Shaikh


Advanced Numerical Analysis

Hisam Uddin Shaikh

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.

Mathematically, the derivative, which serves as the


fundamental vehicle for differentiation, represents the rate of
change of a dependent variable with respect to an
independent variable.
Numerical differentiation is the process of calculating the
derivative of a function at some particular value of the
independent variable by means of a set of given values of that
function. Consider the function y = f(x) which is tabulated for
the values x = x0 + nh, where n = 0, 1, 2, 3, ….
Hisam uddin Shaikh
NEWTONAIN FORWARD INTERPOLATION FORMULA

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!

Hisam uddin Shaikh


differntiate y with respect to p
dy0
 0  y0 
 2 p  1
 2 y0 
 3p 2
 6 p  2
 3 y0 
 4p 3
 18 p 2  22 p  6 
 4 y0 (1)
dp 2! 3! 4!
x  x0 dp 1
As p  so that  (2)
h dx h
To find the derivative of y at x  x0 so p  0 put in (1)

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
00
 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

As we know that the Newtonion Backward formula is


p  p  1  2 yn p  p  1  p  2  3 yn p  p  1  p  2   p  3 4 yn
y p  y n  p  yn   
2! 3! 4!
After rearranging , we get

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

Hisam uddin Shaikh


Find the derivative of y at x  xn so that p  0 then
dy 1 2
 yn   y n 
 0  0  2   3 yn

 0  0  0  6   4 yn
dp 2 3.2.1 4.3.2.1
dy 1 2 1 3 1 4 x  xn dp 1
 yn   y n   y n   y n (1) and p  then  (2)
dp 2 3 4 h dx h
dy
Now we have to find so by chain rule , we can write as
dx
dy dy dp  1 1 1  1
    y n   2 y n   3 y n   4 y n  
dx dp dx  2 3 4  h
dy 1  1 1 1 
  y n   2 y n   3 y n   4 y n 
dx h  2 3 4 
Similarly we find 2nd derivative as
d2y 1  2 11 4 
2
 2 
 y n   3
y n   yn 
dx h  12 
Same as for 3rd derivative , 4th derivative and etc
Hisam uddin Shaikh
Central Differences
Gauss Forward Interpolation Formula
As we know that the Gauss forward formula is
p  p  1  2 y 1  p  1 p  p  1  3 y1
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!
 ..............
After rearranging we get

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 y1

 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 y1 _  3 y1   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 y1 _  3 y1   y 2   y 2  
dx dp dx  2 6 12 30  h
dy 1 1 1 1 4 1 5 
  y0   2 y1 _  3 y1   y 2   y 2  Hisam uddin Shaikh
dx h 2 6 12 30 
Similarly find yourself 2nd derivative, 3rd derivative and so on

Hisam uddin Shaikh


Gauss Backward Interpolation Formula
As we know that the Gauss Backward formula is
p  p  1  2 y 1  p  1 p  p  1  3 y 2
y p  y0  p y1  
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!
After rearranging , we get

y p  y0  p y1 
 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
 y1 
 2 p  1  2 y1

 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

Hisam uddin Shaikh


4! 5!
As we have required the derivative y at x  xn , then p  0
dy 1 2 1 3 1 4 1 5
 y1   y1   y 2 _  y 2   y 3
dp 2 6 12 30

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
   y1   y1   y 2 _  y 2   y 3  
dx dp dx  2 6 12 30  h
dy 1  1 2 1 3 1 4 1 5 
 y1   y1   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  y1 
y p  y0  p  
p 2  2 y1


p 3  p   3 y1   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  y1   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  y1  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  y1  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  y1  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 y1   p  1/ 2  p  p  1 3 y1
y p  y0  p y0  
2! 3!
 p  1 p  p  1  p  2    4 y1   4 y 2 
 .
4!
After rearranging , we get

y p  y0  p y0 
 p 2
 p  
  2
y0   2
y1 
2!


 p 3
 3 / 2 p 2  1/ 2 p  3 y1
3!


 p 4  2 p 3  p 2  2 p    4 y1   4 y 2 

Hisam uddin Shaikh


4!
Differentiate y with respect to p
dy
 0  .y0 
 2 p  1   2 y0   2 y1 

 3p 2

 3 p  1/ 2 3 y1
dp 2! 3!


 4p 3

 6 p 2  2 p  2   4 y1   4 y 2 
dy 4!
We have required at x  x0 so that p  0
dx
dy  0  1   2 y0   2 y1  0  0  1/ 2   3 y1
 y0  
dp 2! 3!
 0  0  0  2    4 y1   4 y 2 

4!
dy 1 2 1 3 1
 
 y0    y0   y1  
2
 y 1    4 y1   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
   y1   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 y1   4 y 2 
 12 
Hisam uddin Shaikh Now find 2nd deri var ive, 3rd derivative and so on
Advanced Numerical Analysis

Hisam Uddin Shaikh

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

Mathematically, definite integration is represented by I  a f  x  d x


Which stands for the integral of the function f(x) with respect to
the independent variable x, evaluated between the limits x = a to x
=b

As suggested by the dictionary definition, the “meaning” of the


integral is the total value, or summation, of f(x) dx over the range
x = a to x = b. In fact, the symbol ∫ is actually a stylized capital S
that is intended to signify the close connection between
integration and summation.
Hisam uddin Shaikh
Numerical integration is sometimes referred to as
QUADRATURE. This is an archaic term that originally meant the
construction of a square having the same area as some curvilinear
figure. Today, the term QUADRATURE is generally taken to be
synonymous with numerical definite integration

Integration has so many engineering and scientific applications


that you were required to take integral calculus. Many specific
examples of such applications could be given in all fields of
engineering and science. A number of examples relate directly
to the idea of the integral as the area under a curve. The
following Figure depicts a few cases where integration is
used for this purpose.

Hisam uddin Shaikh


Other common applications relate to the analogy between
integration and summation.

For example, a common application is to determine the


mean of a continuous function. Recall that the mean of
discrete of n discrete data points. The mean is described as
N

y
i 1
i

Mean  , where yi are individual measurements.


n
In contrast, suppose that y is a continuous function of an
independent variable x. For this case, there are an infinite
number of values between a and b. We can write the mean into
a integral form such as b
N

y
i 1
i  f  x  dx
Hisam uddin Shaikh Mean   a
.
n ba
This formula has hundreds of engineering and scientific
applications.

For example, it is used to calculate the center of gravity of


irregular objects in mechanical and civil engineering and to
determine the root-mean-square current in electrical engineering
and etc…

Hisam uddin Shaikh


NUMERICAL INTEGRATION
The process of evaluating a definite integrals from a set of
tabulated values of the integrand f(x) is called NUMERICAL
INTEGRATION. This process when applied to a function of a
single variable, is known as QUADRATURE.
y

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

I   f  x d x   f  x  d x, where Put x  x0  ph, dx  h dp


a x0
x0  nh n
I   f  x d x    f x 0  ph  h dp (1)
x0 0

As we can say that f  x0  ph   y p

Hisam uddin Shaikh


So that according to Newton ' s Forward int erpolation formula is

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!

Hisam uddin Shaikh


n
I   f x
0
0  ph  h dp

 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! 

THIS IS CALLED NEWTON ' S COTE ' S QUADRATURE FORMULA.


It is a genral form of int egral formulae so deduce it through
n  1, 2, 3, and we get different formulae of INTEGRLS

Hisam uddin Shaikh


TREPEZOIDAL RULE
Put n  1 , in Quadrature and taking the curve through  x0 , y0  and  x1 , y1 
as a straight line so that higher differences of firts become zero
, we get
x0  h
 12   2 y0  y0   2 y0  y1  y0 
I   f  x  dx  h  y0  y0 h   h  
x0  2   2   2 
h
  y0  y1 
2
Similarly we take
x0  2 h
 12   2 y1  y1   2 y1  y2  y1 
I   f  x  dx  h  y1  y1   h   h  
x0  h  2   2   2 
h
  y1  y2 
2
Hisam uddin Shaikh
Similary
x0  3 h
h
I   f  x  dx   y2  y3 
x0  2 h
2
.
.
x0  nh
h
I   f  x  dx   yn  1  yn 
x0   n 1 h
2
Adding all above int egrals, we get
x0  h x0  2 h x0  3 h x0  nh

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

In right hand side, we see that the except the first


and last entry, all entries are twiced
so generally we can write as
x0  nh
h
I   f  x  dx   y0  yn
2
  
 2 y1  y2  y3  ...............  y n  1 
x0

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  6y0   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  6y2   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

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

h  y0  4 y1  y2  y2  4 y3  y4  y4  4 y5 
x0  nh

I  f  x  dx   
x0

3 6 y  ..........  y n2  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

Hisam uddin Shaikh


h  y0  yn   4  y1  y3  y5  ...............  yn  1 
x0  nh  
I   f  x  dx  
3  2  y2  y4  y6  ...............  yn  2  
x0
 
where n  2, 3, ......

THIS IS CALLED SIMPSON ' S 1/ 3 INTEGRAL FORMULA.


NOTE : This formula is suitable for those int ervals
which is subdivided int o even sub  int ervals

Hisam uddin Shaikh


SIMPSON’S 3/8 RULE
Put n  3 , in Quadrature and taking the curve through  x0 , y0  ,  x1 , y1  ,
 x2 , y2  and  x3 , y3  as a straight line so that higher
differences of third become zero, we get
x0  3 h
 9  9   y0  81
2
  y0 
3
I   f  x  dx  h 3 y0  y0   9      27  9  
x0  2  2  2!  4  3! 
 9 9 3  3 
 h 3 y0  y0   2 y0     y0 
 2 4 8  
3h 3h 8 y0  12  y1  y0   6  y2  2 y1  y0  
 8 y0  12 y0  6  y0   y0   
2 3

8 8    y3  3 y2  3y1  y0  
3h
  8 y0  12 y1  12 y0  6 y2  12 y1  6 y0  y3  3 y2  3 y1  y0 
8
x0  3 h
3h
I   f  x  dx   y0  3 y1  3 y2  y3 
x0
8
Hisam uddin Shaikh
Similarly we take
x0  6 h
3h
I   f  x  dx  8 y3  12 y3  6  2 y3   3 y3 
x0  3 h
8

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  ...... 

Hisam uddin Shaikh


In right hand side, we see that the except the first and last entry, all entries
so generally we can write as

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 ......

THIS IS CALLED SIMPSON ' S 3 / 8 INTEGRAL FORMULA.


NOTE : This formula is suitable for those int ervals which is subdivided
int o multiple of 3 sub  int ervals

Hisam uddin Shaikh


WEDDLE’S RULE
Put n  6 , in Quadrature and taking the curve through  x0 , y0  ,  x1 , y1  ,
 x2 , y2  ,  x3 , y3   x4 , y4  ,  x5 , y5  and  x6 , y6  as a straight line so that
higher differences of SIXTH become zero, we get
 9 2 123 4 11 5 
x0  6 h y
 0  3  y0   y0  4  3
y0   y0   y0 
2 60 20
I   f  x  dx  6h  
 1 41 
x0
 6 y0
 6 140 
41 42 3
If we replace by or , the error made will be negligible
140 140 10
After simplication of above all differences , we get
x0  6 h
3h
I   f  x  dx   y0  5 y1  y2  6 y3  y4  5 y5  y6 
x0
10
Similarly we take
x0  12 h
3h  y6  5 y7  y8  6 y9  y10 
I   f  x  dx   
x0  6 h
10   5 y11  y12 
Hisam uddin Shaikh
and continue for higher terms , then adding all these
int egrals from x0 to x0  nh where n is a multiple of 6,
we get
x0  nh
3h  y0  5 y1  y2  6 y3  y4  5 y5 
I   f  x  dx   
x0
10   2 y6  5 y7  y8  ..... 
x0  nh
3h
I   f  x  dx   y0  5 y1  y2  6 y3  y4  5 y5  2 y6  5 y7  y8  .....
x0
10
THIS IS KNOWN AS WEDDLE ' S RULE

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

Hisam uddin Shaikh


Advanced Numerical Analysis

Hisam Uddin Shaikh

Department of Mathematics ,
Shah Abdul Latif University, Khairpur
NUMERICAL SOLUTION OF
DIFFERENTIAL EQUATIONS

Hisam uddin Shaikh


Introduction
Differential equations play a fundamental role in engineering.
Many physical phenomena are best formulated in terms of
their rate of change:
dv c
g v v- dependent variable
dt m t- independent variable
Equations which are composed of an unknown function and its derivatives are
called differential equations.
One independent variable  ordinary differential equation (or ODE)
Two or more independent variables  partial diff. equation (or PDE)
A first order equation includes a first derivative as its highest derivative
Second order equation includes second derivative
Higher order equations can be reduced to a system of first order equations, by
redefining the variables.
Hisam uddin Shaikh
Many problems in engineering and science can be formulated in
terms of differential equations. An equation involving a relation
between an unknown function and one or more of its derivatives
is called a differential equation.

These differential equations basically fall into two classes,


ordinary and partial, depending upon the number of independent
variables present in the differential equation; one for ordinary and
more than one for partial differential equation.

A number of problems in science and technology can be


formulated into differential equations. The analytical methods of
solving differential equations are applicable only a limited class
of equations.

Hisam uddin Shaikh


Quite often differential equations appearing in physical
problems do not belong to any of these familiar types and one
is obliged to resort to numerical methods. These methods are of
even greater importance when we realize that computing
machines are now readily available which reduce numerical
work considerably.

Let us consider by first order DE is


dy
 f  x, y  given y  x0   y0
dx

To study the various numerical methods of solving such


equations. In most of these methods, we replace the differential
equation by a difference equation and then solve it.

Hisam uddin Shaikh


The methods are step by step and multi step methods for the
solution of ordinary first order , higher order and system of
differential equations

Single Step or Step by Step Methods


The information about the curve at one point is utilized, the next
point on the curve is evaluated in short steps ahead, by performing
iterations till sufficient accuracy is achieved. The methods are
• Taylor Series
• Picard Methods
• Euler Method
• Modified Euler Method
• Runge Kutta Method(First order, 2nd order, 3rd order an 4th
order)
Hisam uddin Shaikh
Multi Step Methods

The information about the curve, the initial values are


required because the process of these methods required at
least three starting values is called Multi step Methods such
as

• Adam’s Milne’s Method

• Adam’s Bashforth Method

• Adam’s Moulton’s Method

These methods are also called Predictor-corrector Methods


Hisam uddin Shaikh
Solution of First order ordinary differential equations
PICARD METHOD
Consider the first order differential equation is
dy
 f  x, y  given y  x0   y0 (1)
dx
It is required now to find the particular solution of above
differential equation which assume the values y0 at x = x0
Integrating (1) between limits, we get
y x

 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

For 2nd iteration y2 , we put y  y1 in f  x, y  then int egrate


x

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

Continue this process , we successed y4 , y5 , .... yn then the general form


of int egral will be
x

yn  y0 
 f  x, y
x0
n 1  dx. Hence this method gives a sequence of approximations

y1 , y2 ,...... yn each giving a betther result than the preceding one.


Hisam uddin Shaikh
Taylor’s Series Method
Consider the first order differential equation is
dy
 f  x, y  given y  x0   y0 (1)
dx

It is required now to find the particular solution of above


differential equation which assume the values y0 at x = x0
Then find
d2y d3y d4y
2
, 3
, 4 ,........ at x  x0 , to get the values of
dx dx dx
y ,y  ,y 
'
0
''
0
'''
0
,..... then the Taylor series for 1st iteration is

 x  x0   x  x0 
2 3
y1  y0   x  x0  y '   0

2!
y 
''
0

3!
y 
'''
0
 .... (2)

Hisam uddin Shaikh


Gives the values of y for every values of x for which (2)
completely converged. From (2), we get y1.
For 2nd iterations, calculate

     
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
 ...

Similarly For 3nd iterations, then the Taylor series will be

y ,y  ,y 


'
2
''
2
'''
2
,..... then Taylor series will be

 x  x2  2
 x  x2 
3
y3  y2   x  x2  y  
'
2

2!
y  ''
2

3!
y  '''
2
 ...

Hisam uddin Shaikh


Similarly upto nth iterations find y ,y  ,y 
'
n
''
n
'''
n
,.....
then Taylor series will be
 x  xn   x  xn 
2 3
yn  1  yn   x  xn  y '   n

2!
y 
''
n

3!
y 
'''
n

 x  xn 
n
.........
n!
y 
n
n

Hisam uddin Shaikh


Euler’s Method: Tangent Line Approximation

 For the initial value problem


y  f (t , y ), y (t0 )  y0 ,
we begin by approximating solution y = (t) at initial point
t0.
 The solution passes through initial point (t0, y0) with slope
f (t0, y0). The line tangent to solution at initial point is thus
y  y0  f  t0 , y0  t  t0 

 The tangent line is a good approximation to solution curve


on an interval short enough.
 Thus if t1 is close enough to t0,
we can approximate (t1) by
y1  y0  f  t0 , y0  t1  t0 
Euler’s Formula

 For a point t2 close to t1, we approximate (t2) using the


line passing through (t1, y1) with slope f (t1, y1):
y2  y1  f  t1 , y1  t 2  t1 

 Thus we create a sequence yn of approximations to (tn):


y1  y0  f 0   t1  t0 
y2  y1  f1   t 2  t1 

yn 1  yn  f n   t n 1  t n 

where fn = f (tn, yn).


 For a uniform step size h = tn – tn-1, Euler’s formula becomes
yn 1  yn  f n h, n  0,1, 2,
Euler Approximation

 To graph an Euler approximation, we plot the points


(t0, y0), (t1, y1),…, (tn, yn), and then connect these points
with line segments.
yn 1  yn  f n   t n 1  t n  , where f n  f  t n , yn 
The Euler Method
It is instructive to examine the simplest method, the Euler
method, for solving the first-order scalar IVP given by
dy
 f  x, y  t   0, b 
dx
y  0   y0

(This method is also called the Euler-Cauchy, forward Euler, or


explicit Euler method).

In this method, the value of the dependent variable at the


current point is calculated by straight line extrapolation from
the previous point. Since the initial data is known, we can
evaluate
Hisam uddin Shaikh
and from this, we can calculate an approximation to y(h) by using
the first two terms of a Taylor‘ s series

Hisam uddin Shaikh


Hisam uddin Shaikh

You might also like