Lab for the Newton Interpolation Polynomial

Module for the Newton Polynomial

   Check out the new Numerical Analysis Projects page.

 

Background. Newton Interpolation Polynomial.

 

Definition. Divided Differences.

 

Algorithm. Newton Interpolation Polynomial. To construct and evaluate the Newton polynomial of degree [Graphics:np.txtgr17.gif] that passes through the n+1 points [Graphics:np.txtgr18.gif], for [Graphics:np.txtgr19.gif]:

[Graphics:np.txtgr20.gif]

where [Graphics:np.txtgr21.gif]
and [Graphics:np.txtgr22.gif] .

 

Remark 1. Newton polynomials are created "recursively."

[Graphics:np.txtgr23.gif].

Remark 2. Mathematica's arrays are lists and the subscripts must start with 1 instead of 0.

 

Load in Mathematica's graphics package "Colors".

[Graphics:np.txtgr12.gif][Graphics:np.txtgr24.gif]
 
 
 

Report to be handed in.

Computer Exercises
 

 

First. Enter the subroutine which will construct the Newton polynomials.

[Graphics:np.txtgr12.gif][Graphics:np.txtgr25.gif]
 
 

Exercise 1. (a) Construct the Newton polynomials [Graphics:np.txtgr26.gif], of degree n = 1, 2 using the divided difference formulae.
Use the data points (1, 3.6), (2, 1.8), (3, 1.2).
1. (b) Evaluate the Newton polynomials you found in part (a) at x = 2.5.

[Graphics:np.txtgr12.gif][Graphics:np.txtgr27.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr28.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr29.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr30.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr31.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr32.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr33.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr34.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr35.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr36.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr37.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr38.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr39.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr40.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr41.gif]
 
 

Exercise 2. (a) Construct the Newton polynomial [Graphics:np.txtgr42.gif]of degree n = 4, for the data points

(1, 3.6), (2, 1.8), (3, 1.2), (4, 0.9), (5, 0.72) using the Mathematica subroutine for constructing a Newton polynomial.
2. (b) Show the divided difference table used in the construction.
2. (c) Evaluate [Graphics:np.txtgr43.gif] at x = 2.5,

[Graphics:np.txtgr12.gif][Graphics:np.txtgr44.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr45.gif]

The divided difference table for this problem is:

[Graphics:np.txtgr12.gif][Graphics:np.txtgr46.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr47.gif]

Observe that the coefficients are decreasing in size. Can you explain why this might happen. Is it desirable?

 

 

Exercise 3. Investigate the Newton polynomials of degree n = 1,2,3 for f(x) = cos(x) over the interval [0,3].

[Graphics:np.txtgr12.gif][Graphics:np.txtgr48.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr49.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr50.gif]

[Graphics:np.txtgr12.gif][Graphics:np.txtgr51.gif]

[Graphics:np.txtgr12.gif][Graphics:np.txtgr52.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr53.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr54.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr55.gif]

[Graphics:np.txtgr12.gif][Graphics:np.txtgr56.gif]

[Graphics:np.txtgr12.gif][Graphics:np.txtgr57.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr58.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr59.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr60.gif]

[Graphics:np.txtgr12.gif][Graphics:np.txtgr61.gif]

[Graphics:np.txtgr12.gif][Graphics:np.txtgr62.gif]

 

 

Exercise 4. Application to number theory.

4. (a) Find the formula for the sum of the first n integers.

[Graphics:np.txtgr12.gif][Graphics:np.txtgr63.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr64.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr65.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr66.gif]

Notice that the divided difference table has zeros for the 2nd and higher order differences.

[Graphics:np.txtgr12.gif][Graphics:np.txtgr67.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr68.gif]

Thus the formula for the sum of the first n integers is:

[Graphics:np.txtgr12.gif][Graphics:np.txtgr69.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr70.gif]
 
 

4. (b) Find the formula for the sum of the squares of the first n integers is:

[Graphics:np.txtgr12.gif][Graphics:np.txtgr71.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr72.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr73.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr74.gif]

Notice that the divided difference table has zeros for the 3rd and higher order differences.

[Graphics:np.txtgr12.gif][Graphics:np.txtgr75.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr76.gif]

Thus the formula for the sum of the squares of the first n integers is:

[Graphics:np.txtgr12.gif][Graphics:np.txtgr77.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr78.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr79.gif]
[Graphics:np.txtgr12.gif][Graphics:np.txtgr80.gif]
 

 

 

(c) John H. Mathews, 1998