You are on page 1of 5

Numerical Analysis MTH603

VU

Interpolation Newtons Forward Difference Formula


Let y = f (x) be a function which takes values f(x0), f(x0+ h), f(x0+2h), , corresponding to various equi-spaced values of x with spacing h, say x0, x0 + h, x0 + 2h, . Suppose, we wish to evaluate the function f (x) for a value x0 + ph, where p is any real number, then for any real number p, we have the operator E such that E p f ( x) = f ( x + ph). f ( x0 + ph) = E p f ( x0 ) = (1 + ) p f ( x0 )

p( p 1) 2 p( p 1)( p 2) 3 = 1 + p + + + f ( x0 ) 2! 3! f ( x0 + ph) = f ( x0 ) + pf ( x0 )
p( p 1) 2 p ( p 1)( p 2) 3 f ( x0 ) + f ( x0 ) 2! 3! p ( p 1) ( p n + 1) n + + f ( x0 ) + Error n! This is known as Newtons forward difference formula for interpolation, which gives the value of f(x + ph) in terms of f(x ) and its leading differences. 0 0 This formula is also known as Newton-Gregory forward difference interpolation formula. Here p=(x-x )/h. 0 An alternate expression is p ( p 1) 2 p ( p 1)( p 2) 3 y x = y0 + p y0 + y0 + y0 + 2! 3! p ( p 1)( p n + 1) n + y0 + Error n! If we retain (r + 1) terms, we obtain a polynomial of degree r agreeing with y at x x0, x1, , xr. This formula is mainly used for interpolating the values of y near the beginning of a set of tabular values and for extrapolating values of y, a short distance backward from y0 +

Evaluate f (15), given the following table of values:

Example:

The forward differences are tabulated as

Solution:

Copyright Virtual University of Pakistan

Numerical Analysis MTH603

VU

We have Newtons forward difference interpolation formula p ( p 1) 2 p ( p 1)( p 2) 3 y x = y0 + py0 + y0 + y0 + 2! 3! p ( p 1)( p n + 1) n + y0 + Error n! Here we have x0 = 10, y0 = 46, y0 = 20,
2 y0 = 5, 3 y0 = 2, 4 y0 = 3

Let y be the value of y when x = 15, then 15 x x0 15 10 = = 0.5 p= h 10 (0.5)(0.5 1) f (15) = y15 = 46 + (0.5)(20) + (5) 2 (0.5)(0.5 1)(0.5 2) (0.5)(0.5 1)(0.5 2)(0.5 3) + (2) + (3) 6 24 = 46 + 10 + 0.625 + 0.125 + 0.1172 f (15) = 56.8672 correct to four decimal places.

Find Newtons forward difference, interpolating polynomial for the following data:

Example

The forward difference table to the given data is

Solution;

Copyright Virtual University of Pakistan

Numerical Analysis MTH603

VU

rd th Since, 3 and 4 leading differences are zero, we have Newtons forward difference interpolating formula as p( p 1) 2 y0 y = y0 + py0 + 2 In this problem, x0 = 0.1, y0 = 1.40,
y0 = 0.16, 2 y0 = 0.04,

and p= Substituting these values,

x 0.1 = 10 x 1 0.1

(10 x 1)(10 x 2) (0.04) 2 This is the required Newtons interpolating polynomial. y = f ( x) = 1.40 + (10 x 1)(0.16) +

Estimate the missing figure in the following table:

Example

Since we are given four entries in the table, the function y = f (x) can be represented by a polynomial of degree three.
3 f ( x) = Constant and 4 f ( x) = 0, x

Solution

In particular,

4 f ( x0 ) = 0 Equivalently, ( E 1) 4 f ( x0 ) = 0
Copyright Virtual University of Pakistan

Numerical Analysis MTH603

VU

Expanding, we have ( E 4 4 E 3 + 6 E 2 4 E + 1) f ( x0 ) = 0 That is, f ( x4 ) 4 f ( x3 ) + 6 f ( x2 ) 4 f ( x1 ) + f ( x0 ) = 0

Using the values given in the table, we obtain 32 4 f ( x3 ) + 6 7 4 5 + 2 = 0 which gives f (x ), the missing value equal to 14. 3

Example
Consider the following table of values x .2 .3 .4 .5 F(x) .2304 .2788 .3222 .3617 Find f (.36) using Newtons Forward Difference Formula. .6 .3979

Solution
x
0.2 0.3 0.4 0.5 0.6

y = f ( x)
0.2304 0.2788 0.3222 0.3617 0.3979

y
0.0484 0.0434 0.0395 0.0362

2 y
-0.005 -0.0039 -0.0033

3 y
0.0011 0.0006

4 y
-0.0005

p( p 1) 2 p( p 1)( p 2) 3 y0 + y0 2! 3! p( p 1)( p 2)( p 3) 4 p( p 1)( p 2)........( p n +1) n + y0 ++ y0 4! n! yx = y0 + py0 +


Where x0 = 0.2, y0 = 0.2304, y0 = 0.0484,
y0 = 0.005, y0 = 0.0011 , y0 = .0005
2 3 4

p=

x x0 0.36 0.2 = = 1.6 h 0.1

yx = 0.2304 +1.6(0.0484) +

1.6(1.6 1) 1.6(1.6 1)(1.6 2) 1.6(1.6 1)(1.6 2)(1.6 3) (0.0011) + (.0005) ( 0.005) + 2! 3! 4! 1.6(.6)(.4) 1.6(.6)(.4)(1.4) (.0011) + (.0005) = 0.2304 + .077441.0024 + 6 24 = 0.3078 .0024 .00007 .00001 = .3053
Copyright Virtual University of Pakistan

Numerical Analysis MTH603

VU

Find a cubic polynomial in x which takes on the values -3, 3, 11, 27, 57 and 107, when x = 0, 1, 2, 3, 4 and 5 respectively. Here, the observations are given at equal intervals of unit width. To determine the required polynomial, we first construct the difference table

Example Solution

Difference Table

th Since the 4 and higher order differences are zero, the required Newtons interpolation formula f ( x0 + ph) = f ( x0 ) + pf ( x0 ) + Here x x0 x 0 = =x 1 h f ( x0 ) = 6 p= 2 f ( x0 ) = 2 3 f ( x0 ) = 6 Substituting these values into the formula, we have x( x 1) x( x 1)( x 2) f ( x) = 3 + 6 x + (2) + (6) 2 6 f ( x) = x 3 2 x 2 + 7 x 3, The required cubic polynomial. p ( p 1) 2 p ( p 1)( p 2) 3 f ( x0 ) + f ( x0 ) 2 6

Copyright Virtual University of Pakistan

You might also like