You are on page 1of 7

NEWTON'S DIVIDED DIFFERENCE FORMULA

f(xi) - f(xj) Let us assume that the function f(x) is linear then we have (xi - xj) here xi and xj are any two tabular points, is independent of xi and xj. This ratio is called the first divided difference of f(x) relativ xi and xj and is denoted by f [xi, xj]. That is

f [xi, xj] f(xi) - f(xj) = f [xj, = xi] (xi - xj) nce the ratio is independent of xi and xj we can write f [x0, x] = f [x0, x1] f(x) - f(x0) = f [x0, x1] (x - x0) f(x) = f(x0) + (x - x0) f [x0, x1]

1 =

f(x0)

x0 x

f1 - f0 = x +

f0x1 - f1x0

x x - x0 f(x1) 1 x1 - x0 x1 - x0 x o if f(x) is approximated with a linear polynomial then the function value at any point x can be calculated by using f(x) P1(x) = x0) + (x - x1) f [x0, x1]

here f [x0, x1] is the first divided difference of f relative to x0 and x1.

milarly if f(x) is a second degree polynomial then the secant slope defined above is not constant but a linear function of x. Hence e have f [x1, x2] - f [x0, x1]

x2 - x0 independent of x0, x1 and x2. This ratio is defined as second divided difference of f relative to x0, x1and x2. The secind divided fference are denoted as f [x1, x2] - f [x0, x1] f [x0, x1, x2] = x2 - x0 f [x1, x0, x] = f [x0, x1, x2] f [x0, x] - f [x1, x0]

ow again since f [x0, x1,x2] is independent of x0, x1 and x2 we have

= f [x0, x1, x2] x - x1 f [x0, x] = f [x0, x1] + (x - x1) f [x0, x1, x2]

f [x] - f [x0] = x - x0 f(x) = f [x0] + (x - x0) f [x0, x1] + (x - x0) (x - x1) f [x0, x1, x2] f [x0, x1] + (x - x1) f [x0, x1, x2]

his is equivalent to the second degree polynomial approximation passing through three data points

x0 x1 x2 f0 f1 f2 o whenever f(x) is approximated with a second degree polynomial, the value of f(x) at any point x can be computed using the bove polynomial. the same way if we define recursively kth divided difference by the relation f [x1, x2, . . ., xk] - f [x0, x1, . . ., xk-1] f [x0, x1, . . ., xk] = xk - x0

he kth degree polynomial approximation to f(x) can be written as

x) = f [x0] + (x - x0) f [x0, x1] + (x - x0) (x - x1) f [x0, x1, x2] + . . . + (x - x0) (x - x1) . . . (x - xk-1) f [x0, x1, . . ., xk].

his formula is called Newton's Divided Difference Formula. Once we have the divided differences of the function f relative to th bular points then we can use the above formula to compute f(x) at any non tabular point.

omputing divided differences using divided difference table: Let us consider the points (x1, f1), (x2, f2), (x3, f3) and (x4, ) where x1, x2, x3 and x4 are not necessarily equi-distant points then the divided difference table can be written as xi x1 fi f1 f [x1, x2] = x2 f2 f [x2, x3] = f3 - f 2 x3 - x2 f [x1, x2,x3,x4] = x4 - x1 f2 - f 1 x2 - x1 f [x2, x3] - f [x1, x2] f [x1, x2,x3] = x3 - x1 f [xi, xj] f [xi, xj, xk ] f [xi, xj, xk, xl]

f [x2, x3,x4] - f [x1, x2,x3

f [x3, x4] - f [x2, x3] x3 f3 f [x3, x4] = f4 - f 3 x4 - x3 f [x2, x3,x4] = x4 - x2

x4 f4 xample : Compute f(0.3) for the data 1 3 3 49 4 129 7 813

x 0 f 1 ing Newton's divided difference formula. xi 0 1 3 4

olution : Divided difference table fi 1 2 3 23 49 80 129 228 813 37 19 3 7 3

7 ow Newton's divided difference formula is

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]

0.3) = 1 + (0.3 - 0) 2 + (0.3)(0.3 - 1) 7 + (0.3) (0.3 - 1) (0.3 - 3) 3 = 1.831

nce the given data is for the polynomial f(x) = 3x3 - 5x2 + 4x +1 the analytical value is f(0.3) = 1.831

he analytical value is matched with the computed value because the given data is for a third degree polynomial and there are five ata points available using which one can approximate any data exactly upto fourth degree polynomial. If f(x) is a polynomial of degree N, then the Nth divided difference of f(x) is a constant. (x1+ h)n - xn = x+h-x h n h xn-1+ . . .

roperties :

roof : Consider the divided difference of xn xn =

= a polynomial of degree (n - 1)

lso since divided difference operator is a linear operator, of any Nth degree polynomial is an (N-1)th degree polynomial and cond is an (N-2) degree polynomial, so on the Nth divided difference of an Nth degree polynomial is a constant. If x0, x1, x2 . . . xn are the (n+1) discrete points then the Nth divided difference is equal to f0 f[x0, x1, x2 . . . xn] = fn

+...+ (x0 - x1) . . . (x0 - xn) (xn - x0) . . . (xn - xn-1) roof : If n = 0 f(x0) = f(x0) hence the result is true let us assume that the result is valid upto n = k f[x0, x1, . . . xk] = f0 +...+ (x0 - x1) . . . (x0 - xk) (xk - x0) . . . (xk - xk-1) fk

onsider the case n = k + 1 f[x0, x1, . . . xk, xk+1] = f[x1, x2, . . . xk+1] - f[x0, x1, . . . xk] (xk+1 - x0) 1 = (xk+1 - x0) f1 +...+ (x1 - x2) . . . (x1 - xk+1) 1 (xk+1 - x0) f0 + (x0-x1)...(x0-xk+1) (x1-x2)...(x1 - xk)(xk+1 - x0) f1 1 x1-xk+1 x1-x0 (xk+1 - x1) . . . (xk+1 - xk) fk+1

]
fk (xk - x0) . . . (xk - xk-1) fk+1 +...+

f0 +...+ (x0 - x1) . . . (x0 - xk) 1

(xk+1-x0)...(xk+1-xk

f0 + (x0 - x1) . . . (x0 - xk+1) Sheppard Zigzag rule :

f1 +...+ (x1 - x0) (x1 - x2) . . . (x1 - xk+1)

fk+1 (xk+1 - x0) . . . (xk+1 - xk)

onsider the divided difference table for the data points (x0, f0), (x1, f1), (x2, f2) and (x3, f3)

the difference table the dotted line and the solid line give two differenct paths starting from the function values to the higher vided difference's posssible to the function values. The Sheppard's zigzag rule says the function value at any non-tabulated from e dotted line or from the solid line are same provided the order of xi are taken in the direction of the zigzag line. That is ny f(x) through the dotted line can be approximated as

x) = f0 + (x - x0) f [x0, x1] + (x - x0) (x - x1) f [x0, x1,x2] + (x - x0) (x - x1) (x - x2)f [x0, x1, x2, x3].

milarly f(x) over the solid line is euivalent to

x) = f2 + (x - x2) f [x1, x2] + (x - x2) (x - x1) f [x1, x2,x3] + (x - x2) (x - x1) (x - x3)f [x0, x1, x2, x3].

xample : Find f(1.5) from the data points

x 0 f(x) 1

0.5 1.8987

1 3.7183

2 11.3891

1.5) along the dotted line is 1.5) = 1 + 1.5 x 1.7974 + 1.5 (1) x 1.8418 + (1.5) (1) (0.5) x 0.4229 = 6.770

milarly f(1.5) along the solid line is 1.5) = 3.7183+(1.5 - 1)x3.6392+(1.5 - 1)(1.5 - 0.5)x2.6877+(1.5 -1)(1.5 - 0.5)(1.5 - 2)x0.4229 = 6.770

he data is given for f(x) = x2 + ex and the analytical value for f(1.5) = 6.7317

LAGRANGE'S INTERPOLATION FORMULA


This is again an Nth degree polynomial approximation formula to the function f(x), which is known at discrete points xi, i = 0, 1, 2 . . . Nth. The formula can be derived from the Vandermonds determinant but a much simpler way of deriving this is from Newton's divided difference formula. Iff(x) is approximated with an Nth degree polynomial then the Nth divided difference of f(x)constant and (N+1)th divided difference is zero. That is f [x0, x1, . . . xn, x] = 0 From the second property of divided difference we can write
f0 + (x0 - x1) . . . (x0 - xn)(x0 - x) (xn - x0) . . . (xn - xn-1)(xn - x) fn +...+ (x - x0) . . . (x - xn) fx = 0

or
(x - x1) . . . (x - xn) f(x) = (x0 - x1) . . . (x0 - xn) f0 + . . . + (xn - x0) . . . (xn - xn-1) (x - x0) . . . (x - xn-1) fn

i=0

n | | x - xj j = 0 (xi - xj) j 1

fi

Since Lagrange's interpolation is also an Nth degree polynomial approximation to f(x) and the Nthdegree polynomial passing through (N+1) points is unique hence the Lagrange's and Newton's divided difference approximations are one and the same. However, Lagrange's formula is more convinent to use in computer programming and Newton's divided difference formula is more suited for hand calculations. Example : Compute f(0.3) for the data
x 0 1 f 1 3 3 49 4 129 7 813

using Lagrange's interpolation formula (Analytic value is 1.831)

(x - x1) (x - x2)(x- x3)(x - x4) f(x) = (x0 - x1) (x0 - x2)(x0 - x3)(x0 - x4) f 0+ . . . +

(x - x0)(x - x1) (x - x2)(x - x3) f4 (x4 - x0)(x4 - x1)(x4 - x2)(x4 - x3)

(0.3 - 1)(0.3 - 3)(0.3 - 4)(0.3 - 7) = (-1) (-3)(-4)(-7) 1+

(0.3 - 0)(0.3 - 3)(0.3 - 4)(0.3 - 7) 3+ 1 x (-2)(-3)(-6)

(0.3 - 0)(0.3 - 1)(0.3 - 4)(0.3 - 7) 49 + 3 x 2 x (-1)(-4)

(0.3 - 0)(0.3 - 1)(0.3 - 3)(0.3 - 7) 129 + 4 x 3 x 1 (-3)

(0.3 - 0)(0.3 - 1)(0.3 - 3)(0.3 - 4) 813 7x6x4x3

= 1.831

You might also like