Sei sulla pagina 1di 36

The Newton Polynomial Interpolation

The Lagrange interpolation relies on the interpolation

points , all of which need to be available to calculate

each of the basis polynomials . If additional points are to be used when they
become available, all basis polynomials need to be recalculated.

In comparison, in the Newton interpolation, when more data points are to be used,
additional basis polynomials and the corresponding coefficients can be calculated,
while all existing basis polynomials and their coefficients remain unchanged. Due to
the additional terms, the degree of interpolation polynomial is higher and the
approximation error may be reduced (e.g., when interpolating higher order
polynomials).

Specifically, the basis polynomials of the Newton interpolation are calculated as


below:

(26)

and the Newton interpolating polynomial is constructed:

(27)

Note that the last data point is not used in any of the basis polynomials, but

it is used for calculating the last coefficient , as shown below. For this nth degree
polynomial to pass all points , it needs to

satisfy the following equations:

(28
)

which can also be expressed in matrix form:

(2
9)

The coefficients can be obtained by solving these equations


in the triangular equation system progressively from top down:
(30)

In general, we have

(31)

which is the expanded form of the kth divided differences of the

first points. Now the Newton polynomial interpolation can be written as


(32
)

Due to the uniqueness of the polynomial interpolation, this Newton interpolation


polynomial is the same as that of the Lagrange and the power function

interpolations: . They are the same nth degree polynomial


but expressed in terms of different basis polynomials weighted by different
coefficients.

We can now consider some important facts all related to the Newton polynomial
interpolation.
 When an additional node point is avialable and to be used, all
previous basis polynomials and their corresponding coefficients remain

unchanged, we only need to obtain a new basis polynomial of degree :

(33)

 together with its coefficient, the (n+1)th divided

difference . The new interpolation polynomial of

degree can then be obtained by including an extra term in the


summation above:

(34)

 As passes through the new point , we have

(35)

 But is just an arbitrary point, we can replace it by , and get

(36)

 Comparing this with the error function:


(37)

 we see that the error term can also be written as

(38)

 and we also get:

(39)

 Specially, if all of the node points approach to a single

position, , at the limit they become the same

point repeated times, then we have

(40)

 and the Newton interpolation based on points becomes

(41)

 which is the first terms of the Taylor series expansion of the function
with the truncation error:

(42)

 where is some point between and . We see that the Taylor series is
actually a special case of the Newton interpolation at the limit when

all node points approach to the same position .

 If all points are equally spaced,


i.e.,

(43)

 then Newton's divided difference interpolation can take a simpler form. For any

point , we let so that it can be represented

as , and , now the


Newton polynomial can be written as
(44)

 where

(45)

Example: Approximate function by a

polynomial of degree , based on the following points:

Based on , we can find all other divided differences

recursively in tabular form as shown below. In general, can be found

based on its left neighbor and top-left neighbor :


The coefficients are the four divided differences along the

diagonal: ,

, , and . Alternatively,
they can also be represented in the expanded form:

(46)

Now the Newton interpolating polynomial can be obtained as:


The polynomial interpolations generated by the power series method, the Lagrange

and Newton interpolations are exactly the same, ,


confirming the uniqueness of the polynomial interpolation, as plotted in the top panel

below, together with the original function . We see that they indeed pass

through all node points at , , and . Also,


the weighted basis polynomials of each of the three methods are plotted in the

subsequent panels, including power series in the second panel, the

Lagrange basis polynomials in the third panel, and the Newton

basis polynomials in the bottom panel. In each case, the


weighted sum of these basis polynomials is the interpolating polynomial that
approximates the given function.
The Matlab code that implements the Newton polynomial method is listed below. The

coefficients can be generated in either the


expanded form or the tabular form by recursion.
function [v N]=NI(u,x,y) % Newton's Interpolation
% vectors x and y contain n+1 points and the corresponding function
values
% vector u contains all discrete samples of the continuous argument of
f(x)
n=length(x); % number of interpolating points
k=length(u); % number of discrete sample points
v=zeros(1,k); % Newton interpolation
N=ones(n,k); % all n Newton's polynomials (each of m elements)
N(1,:)=y(1); % first Newton's polynomial
v=v+N(1,:);
for i=2:n % generate remaining Newton's polynomials
for j=1:i-1
N(i,:)=N(i,:).*(u-x(j));
end
c=DividedDifference(x,y,i) % get the ith coefficient c_i
v=v+c*N(i,:); % weighted sum of all Newton's polynomials
end
end

function dd=DividedDifference(x,y,i) % generate f[x_0,...,x_i] in expanded


form
dd=0;
for k=1:i % loop for summation
de=1;
for l=1:i % loop for product
if k~=l
de=de*(x(k)-x(l));
end
end
dd=dd+y(k)/de; % ith coefficient c_i
end
end

function dd=DividedDifferenceMatrix(x,y) % generate divided difference matrix


n=length(x); % the coefficients are along
diagonal
dd=zeros(n); % matrix of divided differences
dd(:,1)=y;
for i=1:n
fprintf('%6.3f\t',dd(i,1))
for j=2:i
dd(i,j)=(dd(i,j-1)-dd(i-1,j-1))/(x(i)-x(i-j+1));
fprintf('%6.3f\t',dd(i,j));
end
fprintf('\n');
end
end
Newton Interpolation polynomial:

Suppose that we are given a data set . Let us assume


that these are interpolating points of Newton form of interpolating

polynomial of degree i.e

(1)

The Newton form of the interpolating polynomial is given by

(2
)

For i=0, from (1) & (2) we get


(3.1)

For , from (1) & (2) we get

(3.2)

For i=2, from(1) & (2) we get

Using (3.1) & (3.2), we get


(3.3)

Similarly we can find . To express in a compact


manner let us first define the following notation called divided differences:
(4.1)

(4.2)

(4.3)

(4.4)

Now the co-efficients can be expressed in terms of divided


differences as follows:
(5.1)

(5.2)
(5.3)

(5.4)

Note that is called as the first divided difference, as the second divided
difference and so on. Now the polynomial (2) can be rewritten as:

(6.1)
i.e.

This is called as Newton's Divided Difference interpolation polynomial.

Example:

Given the following data table, evaluate using order Newton's


Divided Difference interpolation polynomial.
i 0 1 2 3 4

0 1 2 3 4

1 2.25 3.75 4.25 5.81


Solution:
Here . For constructing order Newton Divided Difference polynomial
we need only four points. Let us use the first four points. The Newton
Divided Difference polynomial is given by:
In this example it may be noted that for calculating the order polynomial,

we first start with . To it we add to get and

to we add to get . Finally on

adding to we get .
Some remarks on the Error in the interpolation approach:

Suppose that the given data points , correspond to a real

valued function defined on the internal . Let be the


interpolating polynomial of

degree . Then the interpolation

error due to interpolation by is given by


(6.2)

An estimate of the error is provided in the following theorem.

Theorem: Let be a real-valued function define on and times

differentiable on If is the polynomial of degree which


interpolates at the (n+1) distinct points , then for all ,

there exists

(6.3)

Note:

i) i.e. depends on the point at which the error estimate is


required.

ii) Since i.e. derivative is seldom known the error

formula in the above theorem is of limited practical value. But when a

bound on is known over the entire interval , then the

formula may be used to get a bound on the interpolation error.


Newton Divided Difference Table:

It may also be noted for calculating the higher order divided differences we
have used lower order divided differences. In fact starting from the given

zeroth order differences ; one can systematically arrive at


any of higher order divided differences. For clarity the entire calculation may
be depicted in the form of a table called

Newton Divided Difference Table.

Again suppose that we are given the data set and that
we are interested in finding the order Newton Divided Difference
interpolynomial. Let us first construct the Newton Divided Difference Table.
Wherein one can clearly see how the lower order differences are used in
calculating the higher order Divided Differences:
Example:
Construct the Newton Divided Difference Table for generating Newton
interpolation polynomial with the following data set:
i 0 1 2 3 4

0 1 2 3 4

0 1 8 27 64

Solution:
Here . One can fit a fourth order Newton Divided Difference
interpolation polynomial to the given data. Let us generate Newton Divided
Difference Table; as requested.

Note: One may note that the given data corresponds to the cubic
polynomial . To fit such a data order polynomial is adequate. From the
Newton Divided Difference table we notice that the fourth order difference is
zero. Further the divided differences in the table can be directly used for
constructing the Newton Divided Difference interpolation polynomial that
would fit the data.
Exercise: Using Newton divided difference interpolation polynomial ,
construct polynomials of degree two and three for the following data:

(1) f(8.1) = 16.94410, f(8.3)=17.56492 , f(8.6) = 18.50515, f(8.7) = 18.82091.

Also approximate f(8.4).

(2) f(0.6) = -0.17694460 , f(0.7) = 0.01375227 , f(0.8) = 0.22363362 , f(1.0) =


0.65809197.

Also approximate f(0.9).


Newton Interpolation polynomial with equidistant points:

Gregory-Newton Forward Difference Approach:

Very often it so happens in practice that the given data

set correspond to a sequence of equally spaced


points. Here we can assume that

(1)

where is the starting point (sometimes, for convenience, the middle data

point is taken as and in such a case the integer is allowed to take both
negative and positive values.) and is the step size. Further it is enough to
calculate simple differences rather than the divided differences as in the non-
uniformly placed data set case. These simple differences can be forward

differences or backward differences . We will first look at forward


differences and the interpolation polynomial based on forward differences.

The first order forward difference is defined as


(7.1)

The second order forward difference is defined as


(7.2)

The order forward difference is defined as


(7.3)
Since we already know Newton interpolation polynomial in terms of divided
differences, to derive or generate Newton interpolation polynomial in terms of
forward differences it is enough to express forward differences in terms of
divided differences.

Recall the definition of first divided difference ,

(8.1)

Similarly we can get


(8.2)

By the definition of second order forward difference , we get

In a similar way, in general, we can show that


(8.4)
(8.5)

For ,

(8.6)

Now using (6.1) & (8.6) the Newton forward difference interpolation
polynomial may be written as follows:

(9)

To rewrite (9) in a simpler way let us set


i.e (10)

where

This is known as Newton-Gregory forward difference interpolation polynomial.


For convenience while constructing (10) one can first generate a forward

difference table and use the from the table. Suppose we have data

set , then forward difference table looks as follows:

Example 1:

Given the following data, estimate using Newton-Gregory forward


difference interpolation polynomial:
i 0 1 2 3 4

1.0 3.0 5.0 7.0 9.0


0 1.0986 1.6094 1.9459 2.1972
Solution:

Here we have five data points i.e Let us first generate the
forward difference table.

Newton Gregory forward difference interpolation polynomial is given by:


Example 2:
Given the following data estimate f(4.12) using Newton-Gregory forward
difference interpolation polynomial:
i 0 1 2 3 4 5

0 1 2 3 4 5

1 2 4 8 16 32

Solution:
Let us first generate the Newton-Gregory forward difference table:

Here

We know that the forward difference interpolation polynomial is given by:


Exercise: Calculate using Newton-Gregory forward difference
formula for the following data

1)

x 10 20 30 40 50
f(x) 0.1736 0.3420 0.5000 0.6428 0.7660

and

2)
x 1.0 2.0 3.0 4.0
f(x) 0.0 0.6931 1.0986 1.3863
and

Newton-Gregory Backward Difference Interpolation polynomial:

If the data size is big then the divided difference table will be too long.

Suppose the desired intermediate value at which one needs to estimate

the function falls towards the end or say in the second half of the
data set then it may be better to start the estimation process from the last data
set point. For this we need to use backward-differences and backward
difference table.
Let us first define backward differences and generate backward difference

table, say for the data set

First order backward difference is defined as:

(11.1)

Second order backward difference is defined as:


(11.2)

In general, the order backward difference is defined as

(11.3)

In this case the reference point is and therefore we can derive the Newton-
Gregory backward difference interpolation polynomial as:

(12)

Where

For constructing as given in it will be easier if we first


generate backward-difference table. The backward difference table for the

data is given below:


The rounded differences appear in Eqn (12)

Newton Backward Difference Table:


Now let us apply Newton Backward difference approach to the second
example solved earlier following the Newton forward difference approach i.e.
Example:

Given the following data estimate using Newton-Gregory backward


difference interpolation polynomial:

i 0 1 2 3 4 5

0 1 2 3 4 5

1 2 4 8 16 32

Solution:
Here
Newton Backward Difference polynomial is given by

Let us first generate backward difference table:


.1

=17.39135 (13.5)

Now for comparison with the earlier solution i.e. the one obtained by forward
Newton Divided Difference approach we may look at the above solution in
stages similar to that provided earlier i.e.
Now one may note from (13.2) and (10a.2) that it is definitely advantageous of
use backward difference approach here, as in exactly the same number of
steps we are relatively more close to the approximate solution.

Exercise:

1) Given

x 1 2 3 4 5 6 7 8

f(x) 1 8 27 64 125 216 343 512

Estimate f(7.5) using Newton-Gregory Backward difference

interpolation formula.

2) Given

x 1.0 2.0 3.0 4.0

ln x 0.0 0.6931 1.0986 1.3863

Estimate ln(3.5) using Newton-Gregory Backward difference


interpolation formula.

Potrebbero piacerti anche