0% found this document useful (0 votes)
166 views19 pages

LEC 5 Interpolation and Polynomial Approximation

Uploaded by

ii76iiq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
166 views19 pages

LEC 5 Interpolation and Polynomial Approximation

Uploaded by

ii76iiq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Engineering College Chemical Engineering Dept.

Chapter -5-
Interpolation and Polynomial Approximation
5.1 Introduction
Engineers and scientists commonly assume that relationships between variables in a
physical problem can be approximately reproduced from data given by the problem. The
ultimate goal might be to determine the values at intermediate points, to approximate the
integral or derivative of the underlying function, or to simply give a smooth or continuous
representation of the variables in the problem.
Interpolation refers to determining a function that exactly represents a collection of data.
The most elementary type of interpolation consists of fitting a polynomial to a collection
of data points. Polynomials have derivatives and integrals that are themselves polynomials,
so they are a natural choice for approximating derivatives and integrals.

5.2 Lagrange Polynomials


Determining a polynomial of degree 1 that passes through the distinct points (x0, y0) and
(x1,y1) is the same as approximating a function f for which f (x0) =y0 and f (x1) =y1 by means
of a first-degree polynomial interpolating, or agreeing with, the values of f at the given
points. Let’s :
𝑥 − 𝑥1 𝑥 − 𝑥0
𝐿0 (𝑥) = 𝑎𝑛𝑑 𝐿1 (𝑥) =
𝑥0 − 𝑥1 𝑥1 − 𝑥0
and note that these definitions imply that
𝑥0 − 𝑥1 𝑥1 − 𝑥1
𝐿0 (𝑥0 ) = = 1, 𝐿0 (𝑥1 ) = , 𝐿 (𝑥 ) = 0 𝑎𝑛𝑑 𝐿1 (𝑥1 ) = 1
𝑥0 − 𝑥1 𝑥0 − 𝑥1 1 0
define
𝑃(𝑥) = 𝐿0 (𝑥)𝑓(𝑥0 ) + 𝐿1 (𝑥)𝑓(𝑥1 )
This gives
𝑃(𝑥0 ) = 𝐿0 (𝑥0 )𝑓(𝑥0 ) + 𝐿1 (𝑥0 )𝑓(𝑥1 ) = 𝑓(𝑥0 ) = 𝑦0
𝑃(𝑥1 ) = 𝐿0 (𝑥1 )𝑓(𝑥0 ) + 𝐿1 (𝑥1 )𝑓(𝑥1 ) = 𝑓(𝑥1 ) = 𝑦1
So, P is the unique linear function passing through (x0,y0) and (x1,y1). (See Figure below)

42
Engineering College Chemical Engineering Dept.

To generalize the concept of linear interpolation to higher-degree polynomials, consider


the construction of a polynomial of degree at most n that passes through the n + 1 points
(x0, f(x0)), (x1, f(x1)),...,(xn, f(xn)).

The interpolating polynomial is easily described now that the form of L n,k (x) is known.
This polynomial is called the nth Lagrange interpolating polynomial.

43
Engineering College Chemical Engineering Dept.

A sketch of the graph of a typical Ln,k is shown in Figure

Note: This formula can also be used to split the given function into
partial fractions. For on dividing both sides of
(𝑥 − 𝑥0 ) (𝑥 − 𝑥1 ) … (𝑥 − 𝑥𝑛 )
𝑓(𝑥)
(𝑥 − 𝑥0 ) (𝑥 − 𝑥1 ) … (𝑥 − 𝑥𝑛 )
𝑓(𝑥0 ) 1
= ∗
(𝑥0 − 𝑥1 ) (𝑥0 − 𝑥2 ) … (𝑥0 − 𝑥𝑛 ) (𝑥 − 𝑥0 )
𝑓(𝑥1 ) 1
+ ∗ +⋯
(𝑥1 − 𝑥0 ) (𝑥1 − 𝑥2 ) … (𝑥1 − 𝑥𝑛 ) (𝑥 − 𝑥1 )
𝑓(𝑥𝑛 ) 1
+ ∗
(𝑥𝑛 − 𝑥0 ) (𝑥𝑛 − 𝑥1 ) … (𝑥𝑛 − 𝑥𝑛−1 ) (𝑥 − 𝑥𝑛 )

44
Engineering College Chemical Engineering Dept.

EXAMPLE 1: Given the values


x 5 7 11 13 17
f(x) 150 392 1452 2366 5202
evaluate f(9), using Lagrange’s formula:
sol: Here is 𝑥0 = 5, 𝑥1 = 7, 𝑥2 = 11, 𝑥3 = 13, 𝑥4 = 17
and 𝑦0 = 150, 𝑦1 = 392, 𝑦2 = 1452, 𝑦3 = 2366, 𝑦4 = 5202
Lagrange’s formula,
(𝑥 − 7)(𝑥 − 11)(𝑥 − 13)(𝑥 − 17) (𝑥 − 5)(𝑥 − 11)(𝑥 − 13)(𝑥 − 17)
𝑓(𝑥) = ∗ 150 +
(5 − 7)(5 − 11)(5 − 13)(5 − 17) (7 − 5)(7 − 11)(7 − 13)(7 − 17)
(𝑥 − 5)(𝑥 − 7)(𝑥 − 13)(𝑥 − 17)
∗ 392 + ∗ 1452
(11 − 5)(11 − 7)(11 − 13)(11 − 17)
(𝑥 − 5)(𝑥 − 7)(𝑥 − 11)(𝑥 − 17)
+ ∗ 2366
(13 − 5)(13 − 7)(13 − 11)(13 − 17)
(𝑥 − 5)(𝑥 − 7)(𝑥 − 11)(𝑥 − 13)
+ ∗ 5202
(17 − 5)(17 − 7)(17 − 11)(17 − 13)
For 𝑥 = 9, 𝑡ℎ𝑒𝑛
(9 − 7)(9 − 11)(9 − 13)(9 − 17) (9 − 5)(9 − 11)(9 − 13)(9 − 17)
𝑓(9) = ∗ 150 +
(5 − 7)(5 − 11)(5 − 13)(5 − 17) (7 − 5)(7 − 11)(7 − 13)(7 − 17)
(9 − 5)(9 − 7)(9 − 13)(9 − 17)
∗ 392 + ∗ 1452
(11 − 5)(11 − 7)(11 − 13)(11 − 17)
(9 − 5)(9 − 7)(9 − 11)(9 − 17)
+ ∗ 2366
(13 − 5)(13 − 7)(13 − 11)(13 − 17)
(9 − 5)(9 − 7)(9 − 11)(9 − 13)
+ ∗ 5202
(17 − 5)(17 − 7)(17 − 11)(17 − 13)
50 3136 3872 2366 578
𝑓(9) = − + + + + = 810
3 15 3 3 5
EXAMPLE 2: A curve passes through the points (0, 18), (1, 10), (3, –18) and (6, 90).
Find the slope of the curve at x = 2.
𝑑𝑓(𝑥)
Solution: the slope of the curve=
𝑑𝑥

45
Engineering College Chemical Engineering Dept.

(𝑥 − 1)(𝑥 − 3)(𝑥 − 6) (𝑥 − 0)(𝑥 − 3)(𝑥 − 6)


𝑓(𝑥) = ∗ 18 + ∗ 10
(0 − 1)(0 − 3)(0 − 6) (1 − 0)(1 − 3)(1 − 6)
(𝑥 − 0)(𝑥 − 1)(𝑥 − 6) (𝑥 − 0)(𝑥 − 1)(𝑥 − 3)
+ ∗ −18 + ∗ 90
(3 − 0)(3 − 1)(3 − 6) (6 − 0)(6 − 1)(6 − 3)
𝑓(𝑥) = (−𝑥 3 + 10𝑥 2 − 27 𝑥 + 18) + (𝑥 3 − 9𝑥 2 + 18𝑥 ) + (𝑥 3 − 7𝑥 2 + 6 𝑥) + (𝑥 3
− 4𝑥 2 + 3 𝑥)
𝑓(𝑥) = 2𝑥 3 − 10𝑥 2 + 18
𝑑𝑓(𝑥) 𝑑𝑓(2)
= 6𝑥 2 − 20𝑥, = −16
𝑑𝑥 𝑑𝑥
3𝑥 2 +𝑥+1
EXAMPLE 3: Using Lagrange’s formula, express the function
(𝑥−1)(𝑥−2)(𝑥−3)

as a sum of partial fractions.


Solution: 𝑦 = 3𝑥 2 + 𝑥 + 1
𝑥 𝑥0 = 1 𝑥1 = 2 𝑥2 = 3
𝑦 𝑦0 = 5 𝑦1 = 15 𝑦2 = 31
Lagrange’s formula is
(𝑥 − 2)(𝑥 − 3) (𝑥 − 1)(𝑥 − 3) (𝑥 − 1)(𝑥 − 2)
𝑦= ∗5+ ∗ 15 + ∗ 31
(1 − 2)(1 − 3) (2 − 1)(2 − 3) (3 − 1)(3 − 2)
[3𝑥 2 + 𝑥 + 1
= 2.5(𝑥 − 2)(𝑥 − 3) − 15 ∗ (𝑥 − 1)(𝑥 − 3) + 15.5 (𝑥 − 1)(𝑥 − 2)]
1

(𝑥 − 1)(𝑥 − 2)(𝑥 − 3)
3𝑥 2 + 𝑥 + 1 2.5 15 15.5
= − +
(𝑥 − 1)(𝑥 − 2)(𝑥 − 3) 𝑥 − 1 𝑥 − 2 𝑥 − 3
EXAMPLE 4: Using the numbers, or nodes, x0 = 2,x1 = 2.5, and x2 = 4 to find the second
interpolating polynomial for f (x) =1/x, then find y(3)
Sol.
𝑥 𝑥0 = 2 𝑥1 = 2.5 𝑥2 = 4
𝑦 𝑦0 = 0.5 𝑦1 = 0.4 𝑦2 = 0.25

46
Engineering College Chemical Engineering Dept.

(𝑥 − 2.5)(𝑥 − 4) (𝑥 − 2)(𝑥 − 4) (𝑥 − 2)(𝑥 − 2.5)


𝑦= ∗ 0.5 + ∗ 0.4 + ∗ 0.25
(2 − 2.5)(2 − 4) (2.5 − 2)(2.5 − 4) (4 − 2)(4 − 2.5)
𝑦 = (0.05𝑥 − 0.425)𝑥 + 1.15
1
𝑦(3) = (0.05 ∗ 3 − 0.425) ∗ 3 + 1.15 = 0.325 ≈
3
EXAMPLE 5: Table 3.2 lists values of a function at various points. Find the
approximations to f (1.5) by Lagrange polynomials
𝑥 1 1.3 1.6 1.9 2.2
𝑦 0.7651977 0.6200860 0.4554022 0.2818186 0.1103623
1- Degree 1
2- Degree 2
3- Degree 3
4- Degree 4
The obtained value will be compared with exact value of f (1.5)= 0.5118277
Sol.
1- Degree 1
Since 1.5 is between 1.3 and 1.6, the most appropriate linear polynomial uses
(𝑥 − 1.6) (𝑥 − 1.3)
𝑦= ∗ 0.620086 + ∗ 0.4554022
(1.3 − 1.6) (1.6 − 1.3)
(1.5 − 1.6) (1.5 − 1.3)
𝑦1 (1.5) = ∗ 0.620086 + ∗ 0.4554022 = 0.5102968
(1.3 − 1.6) (1.6 − 1.3)
2- Degree 2

𝑥0 = 1.3, 𝑥1 = 1.6, 𝑥2 = 1.9


(1.5 − 1.6)(1.5 − 1.9) (1.5 − 1.3)(1.5 − 1.9)
𝑦(1.5) = ∗ 0.620086 + ∗ 0.4554022
(1.3 − 1.6)(1.3 − 1.9) (1.6 − 1.3)(1.6 − 1.9)
(1.5 − 1.3)(1.5 − 1.6)
+ ∗ 0.2818186
(1.9 − 1.3)(1.9 − 1.6)
𝑦2 (1.5) = 0.5112857
Also
𝑥0 = 1, 𝑥1 = 1.3, 𝑥2 = 1.6

47
Engineering College Chemical Engineering Dept.

(1.5 − 1.6)(1.5 − 1) (1.5 − 1.3)(1.5 − 1)


𝑦̂(1.5) = ∗ 0.620086 + ∗ 0.4554022
(1.3 − 1.6)(1.3 − 1) (1.6 − 1.3)(1.6 − 1)
(1.5 − 1.3)(1.5 − 1.6)
+ ∗ 0.7651977
(1 − 1.3)(1 − 1.6)
𝑦̂2 (1.5) = 0.5124715
3- Degree 3
𝑥0 = 1.3, 𝑥1 = 1.6, 𝑥2 = 1.9, 𝑥3 = 2.2
𝑦3 (1.5) = 0.5118302
also
𝑥0 = 1, 𝑥1 = 1.3, 𝑥2 = 1.6, 𝑥3 = 1.9
𝑦̂3 (1.5) = 0.5118127
4- Degree 4
𝑥0 = 1, 𝑥1 = 1.3, 𝑥2 = 1.6, 𝑥3 = 1.9, 𝑥4 = 2.2
𝑦4 (1.5) = 0.5118200

The true accuracies of the approximations are as follows:

|𝑦1 (1.5) − 𝑓(1.5)| ≈ 1.53 ∗ 10−3 |𝑦3 (1.5) − 𝑓(1.5)| ≈ 2.5 ∗ 10−6
|𝑦2 (1.5) − 𝑓(1.5)| ≈ 5.42 ∗ 10−4 |𝑦̂3 (1.5) − 𝑓(1.5)| ≈ 1.5 ∗ 10−5
|𝑦̂2 (1.5) − 𝑓(1.5)| ≈ 6.44 ∗ 10−4 |𝑦4 (1.5) − 𝑓(1.5)| ≈ 7.7 ∗ 10−6
although y3(1.5) is the most accurate approximation, if we had no knowledge
of the actual value of f (1.5).

note: A practical difficulty with Lagrange interpolation is that since the error term is
difficult to apply, the degree of the polynomial needed for the desired accuracy is
generally not known until the computations are determined. The usual practice is to
compute the results given from various polynomials until appropriate agreement is
obtained, as was done in the previous example. However, the work done in calculating
the approximation by the second polynomial does not lessen the work needed to
calculate the third approximation; nor is the fourth approximation easier to obtain
once the third approximation is known, and so on. To derive these approximating
polynomials in a manner that uses the previous calculations to advantage, we need
some new notation.

48
Engineering College Chemical Engineering Dept.

5.3 Divided Differences


Iterated interpolation was used in the previous section to generate successively higher
degree polynomial approximations at a specific point. Divided-difference methods
introduced in this section are used to successively generate the polynomials themselves.

𝑃𝑛 (𝑥) = 𝑎0 + 𝑎1 (𝑥 − 𝑥0 ) + 𝑎2 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) + 𝑎3 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) +


⋯ + 𝑎𝑛 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) … (𝑥 − 𝑥𝑛 ) eq 1

To determine the constants, 𝑎0 , 𝑎1 , … , 𝑎𝑛


For 𝑎0 , use
𝑃𝑛 (𝑥𝑜 ) = 𝑓(𝑥𝑜 )
For 𝑎1
𝑃𝑛 (𝑥1 ) = 𝑓(𝑥1 )
From eq 1
𝑓(𝑥1 ) = 𝑎0 + 𝑎1 (𝑥1 − 𝑥0 )
𝑓(𝑥1 ) = 𝑓(𝑥𝑜 ) + 𝑎1 (𝑥1 − 𝑥0 )
𝑓(𝑥1 ) − 𝑓(𝑥0 )
𝑎1 =
𝑥1 − 𝑥0
We first need to introduce the divided-difference notation, which should remind
you of the Aitken’s ∆2notation. Suppose we are given the n +1 points (𝑥𝑜 , 𝑓(𝑥𝑜 )),
(𝑥1 , 𝑓(𝑥1 )), …, (𝑥𝑛 , 𝑓(𝑥𝑛 )).. There are n + 1 zeroth divided differences of the
function f. For each i = 0, 1, ..., n we define 𝑓[𝑥𝑖 ]simply as the value of f at xi:
𝑓[𝑥𝑖 ] = 𝑓(𝑥𝑖 )
The remaining divided differences are defined inductively. There are n first divided
differences of f, one for each i = 0, 1, ..., n-1.
𝑓[𝑥𝑖+1 ] − 𝑓[𝑥𝑖 ]
𝑓[𝑥𝑖 , 𝑥𝑖+1 ] =
𝑥𝑖+1 − 𝑥𝑖
The process ends with the single nth divided difference,
𝑓[𝑥1 , 𝑥2 , … , 𝑥𝑛 ] − 𝑓[𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛−1 ]
𝑓[𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛 ] =
𝑥𝑛 − 𝑥0
With this notation, it can be shown that the nth Lagrange interpolation polynomial
for f with respect 𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛 can be expressed as
𝑃𝑛 (𝑥) = 𝑓[𝑥0 ] + 𝑓[𝑥0 , 𝑥1 ](𝑥 − 𝑥0 ) + 𝑓[𝑥0 , 𝑥1 , 𝑥2 ](𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) + ⋯
+ 𝑓[𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛 ](𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) … (𝑥 − 𝑥𝑛 )
which is called Newton’s divided-difference formula.

49
Engineering College Chemical Engineering Dept.

In compressed form we have the following


Newton’s Interpolatory Divided-Difference Formula

𝑃𝑛 (𝑥) = 𝑓[𝑥0 ] + ∑ 𝑓[𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑘 ] (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) … (𝑥 − 𝑥𝑘 )


𝑘=1
The generation of the divided differences is outlined in Table below

𝑥𝑖 𝑓(𝑥𝑖 ) 1st divided differences 2nd divided differences 3rd divided differences
𝑥0 𝑓[𝑥0 ]
𝑓[𝑥1 ] − 𝑓[𝑥0 ]
𝑓[𝑥0 , 𝑥1 ] =
𝑥1 − 𝑥0
𝑥1 𝑓[𝑥1 ] 𝑓[𝑥1 , 𝑥2 ] − 𝑓[𝑥0 , 𝑥1 ]
𝑓[𝑥0 , 𝑥1 , 𝑥2 ] =
𝑥2 − 𝑥0
𝑓[𝑥2 ] − 𝑓[𝑥1 ] 𝑓[𝑥1 , 𝑥2 , 𝑥3 ] − 𝑓[𝑥0 , 𝑥1 , 𝑥2 ]
𝑓[𝑥1 , 𝑥2 ] = 𝑓[𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 ] =
𝑥2 − 𝑥1 𝑥3 − 𝑥0
𝑥2 𝑓[𝑥2 ] 𝑓[𝑥2 , 𝑥3 ] − 𝑓[𝑥1 , 𝑥2 ]
𝑓[𝑥1 , 𝑥2 , 𝑥3 ] =
𝑥3 − 𝑥1
𝑓[𝑥3 ] − 𝑓[𝑥2 ] 𝑓[𝑥2 , 𝑥3 , 𝑥4 ] − 𝑓[𝑥1 , 𝑥2 , 𝑥3 ]
𝑓[𝑥2 , 𝑥3 ] = 𝑓[𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ] =
𝑥3 − 𝑥2 𝑥4 − 𝑥1
𝑥3 𝑓[𝑥3 ] 𝑓[𝑥3 , 𝑥4 ] − 𝑓[𝑥2 , 𝑥3 ]
𝑓[𝑥2 , 𝑥3 , 𝑥4 ] =
𝑥4 − 𝑥2
𝑓[𝑥4 ] − 𝑓[𝑥3 ] 𝑓[𝑥3 , 𝑥4 , 𝑥5 ] − 𝑓[𝑥2 , 𝑥3 , 𝑥4 ]
𝑓[𝑥3 , 𝑥4 ] = 𝑓[𝑥2 , 𝑥3 , 𝑥4 , 𝑥5 ] =
𝑥4 − 𝑥3 𝑥5 − 𝑥2
𝑥4 𝑓[𝑥4 ] 𝑓[𝑥4 , 𝑥5 ] − 𝑓[𝑥3 , 𝑥4 ]
𝑓[𝑥3 , 𝑥4 , 𝑥5 ] =
𝑥5 − 𝑥3
𝑓[𝑥5 ] − 𝑓[𝑥4 ]
𝑓[𝑥4 , 𝑥5 ] =
𝑥5 − 𝑥4
𝑥5 𝑓[𝑥5 ]

50
Engineering College Chemical Engineering Dept.

EXAMPLE 5: Table 3.2 lists values of a function at various points. Find the
approximations to f (1.5) by Divided-difference methods
𝑥 1 1.3 1.6 1.9 2.2
𝑦 0.7651977 0.6200860 0.4554022 0.2818186 0.1103623
Sol:
𝑓[𝑥𝑖−1 , 𝑥𝑖 ]
0.6200860 − 0.7651977
𝑓[1,1.3] = = −0.4837057
1.3 − 1
0.4554022 − 0.6200860
𝑓[1.3,1.6] = = −0.548946
1.6 − 1.3
0.2818186 − 0.4554022
𝑓[1.6,1.9] = = −0.578612
1.9 − 1.6
0.1103623 − 0.2818186
𝑓[1.9,2.2] = = −0.571521
2.2 − 1.9
𝑓[𝑥𝑖−2 , 𝑥𝑖−1 , 𝑥𝑖 ]
−0.548946 + 0.4837057
𝑓[𝑥0 , 𝑥1 , 𝑥2 ] = = −0.1087339
1.6 − 1
−0.578612 + 0.548946
𝑓[𝑥1 , 𝑥2 , 𝑥3 ] = = − 0.0494433
1.9 − 1.3
−0.571521 + 0.578612
𝑓[𝑥2 , 𝑥3 , 𝑥4 ] = = 0.0118183
2.2 − 1.9
𝑓[𝑥𝑖−3 , … , 𝑥𝑖 ]
− 0.0494433 + 0.1087339
𝑓[𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 ] = = 0.0658784
1.9 − 1
0.0118183 + 0.0494433
𝑓[𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ] = = 0.0680685
2.2 − 1.3
0.0680685 − 0.0658784
𝑓[𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ] = = 0.0018251
2.2 − 1

i 𝑥𝑖 𝑓(𝑥𝑖 ) 𝑓[𝑥𝑖−1 , 𝑥𝑖 ] 𝑓[𝑥𝑖−2 , 𝑥𝑖−1 , 𝑥𝑖 ] 𝑓[𝑥𝑖−3 , … , 𝑥𝑖 ] 𝑓[𝑥𝑖−4 , … , 𝑥𝑖 ]


0 1 0.7651977
−0.4837057
1 1.3 0.6200860 −0.1087339
−0.548946 0.0658784
2 1.6 0.4554022 − 0.0494433 0.0018251
−0.578612 0.0680685
3 1.9 0.2818186 0.0118183
−0.571521
4 2.2 0.1103623
The coefficients of the Newton forward divided-difference form of the interpolator
polynomial is along the upper diagonal in the table. The polynomial is
𝑃4 (𝑥) = 0.7651977 − 0.4837057(𝑥 − 1) − 0.1087339(𝑥 − 1)(𝑥 − 1.3)
+ 0.0658784(𝑥 − 1)(𝑥 − 1.3)(𝑥 − 1.6)
+ 0.0018251(𝑥 − 1)(𝑥 − 1.3)(𝑥 − 1.6)(𝑥 − 1.9)
𝑃4 (1.5. ) = 0.51182

51
Engineering College Chemical Engineering Dept.

Newton forward divided-difference form

Newton’s interpolatory divided-difference formula has a simpler form when 𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛 are


arranged consecutively with equal spacing. In this case, we first introduce the notation

ℎ = 𝑥𝑖+1 − 𝑥𝑖
Then we let a new variable s be defined by the equation
𝑥 = 𝑥0 + 𝑠ℎ
𝑥 − 𝑥𝑖 = (𝑠 − 𝑖)ℎ
Newton Forward Divided-Difference Formula
𝑛
𝑠
𝑃𝑛 (𝑥) = 𝑃𝑛 (𝑥0 + 𝑠ℎ) = 𝑓[𝑥0 ] + ∑ ( ) ∆𝑘 𝑓(𝑥0 )
𝑘
𝑘=1
𝑤ℎ𝑒𝑟𝑒 ∶

𝑠 𝑠 (𝑠 − 1)(𝑠 − 2) … (𝑠 − 𝑘 + 1)
( )=
𝑘 𝑘!

If the interpolating nodes are reordered from last to first as xn,xn-1,...,x0, This form is called the Newton
backward divided-difference formula. It is used to derive a formula known as the Newton backward-
difference formula.

Newton Backward Divided-Difference Formula


𝑛
−𝑠
𝑃𝑛 (𝑥) = 𝑃𝑛 (𝑥𝑛 + 𝑠ℎ) = 𝑓[𝑥𝑛 ] + ∑(−1)𝑘 ( ) ∆𝑘 𝑓(𝑥𝑛 )
𝑘
𝑘=1
𝑤ℎ𝑒𝑟𝑒 ∶

−𝑠 𝑠 (𝑠 − 1)(𝑠 − 2) … (𝑠 − 𝑘 + 1)
( ) = (−1)𝑘
𝑘 𝑘!

52
Engineering College Chemical Engineering Dept.

EXAMPLE 5: Table 3.2 lists values of a function at various points. Find the
approximations to f (1.1) & f (2) by Divided-difference methods
𝑥 1 1.3 1.6 1.9 2.2
𝑦 0.7651977 0.6200860 0.4554022 0.2818186 0.1103623
Sol
i 𝑥𝑖 𝑓(𝑥𝑖 ) 𝑓[𝑥𝑖−1 , 𝑥𝑖 ] 𝑓[𝑥𝑖−2 , 𝑥𝑖−1 , 𝑥𝑖 ] 𝑓[𝑥𝑖−3 , … , 𝑥𝑖 ] 𝑓[𝑥𝑖−4 , … , 𝑥𝑖 ]
0 1 0.7651977
−0.4837057
1 1.3 0.6200860 −0.1087339
−0.548946 0.0658784
2 1.6 0.4554022 − 0.0494433 0.0018251
−0.578612 0.0680685
3 1.9 0.2818186 0.0118183
−0.571521
4 2.2 0.1103623
For f (1.1) Newton Forward
ℎ = 1.3 − 1 = 0.3
1.1 − 1 1
𝑠= =
0.3 3
1
𝑃4 (1.1) = 𝑃4 (1 + 0.3 ∗ )
3
= 0.7651977 + h ∗ s(−0.4837057) + 𝑠 ∗ (𝑠 − 1) ∗ ℎ2 (−0.1087339) + 𝑠 ∗ (𝑠 − 1)
∗ (𝑠 − 2) ∗ ℎ3 0.0658784 + 𝑠 ∗ (𝑠 − 1) ∗ (𝑠 − 2)(𝑠 − 3) ∗ ℎ4 0.0018251
1 1 2 1 2 5
= 0.7651977 + 0.3 ∗ (−0.4837057) + ∗ (− ) ∗ 0.32 (−0.1087339) + ∗ (− ) ∗ (− )
3 3 3 3 3 3
1 2 5 8
∗ 0.33 0.0658784 + ∗ (− ) ∗ (− )(− ) ∗ 0.34 0.0018251
3 3 3 3
𝑃4 (1.1) = 0.7196480
For f (2) Newton backward
ℎ = 1.3 − 1 = 0.3
2 − 2.2 2
𝑠= =−
0.3 3
2
𝑃4 (2) = 𝑃4 (2.2 − 0.3 ∗ )
3
= 0.1103623 + 𝑠 ∗ ℎ ∗ (−0.571521) + 𝑠 ∗ (𝑠 + 1) ∗ ℎ2 ∗ (0.0118183) + 𝑠 ∗ (𝑠 + 1)
∗ (𝑠 + 2) ∗ ℎ3 (0.0680685) + 𝑠 ∗ (𝑠 + 1) ∗ (𝑠 + 2) ∗ (𝑠 + 3) ∗ ℎ4 ∗ (0.0018251)
2 2 1 2 1 4
𝑃4 (2) = 0.1103623 − ∗ 0.3 ∗ (−0.571521) − ∗ ( ) ∗ 0.32 ∗ (0.0118183) − ∗ ( ) ∗ ( )
3 3 3 3 3 3
2 1 4 7
∗ 0.33 (0.0680685) − ( ) ∗ ( ) ∗ ( ) ∗ 0.34 ∗ (0.0018251)
3 3 3 3
𝑃4 (2) = 0.2238754

53
Engineering College Chemical Engineering Dept.

The Newton formulas are not appropriate for approximating f (x) when x lies near the center of the table,
since employing either the backward or forward method in such a way that the highest-order difference
is involved will not allow x0 to be close to x. A number of divided-difference formulas are available for
this situation, each of which has situations when it can be used to maximum advantage. These methods
are known as centered-difference formulas. There are a number of such methods, but we do not discuss
any of these techniques.

EXAMPLE 6: In the table below, the values of y are consecutive terms of a series of
which 23.6 is the 6th term. Find the first and tenth terms of the series:
x 3 4 5 6 7 8 9
y 4.8 8.4 14.5 23.6 36.2 52.8 73.9
Solution:
3 4.8
3.6
4 8.4 1.25
6.1 0.083333
5 14.5 1.5
9.1 0.083333
6 23.6 1.75
12.6 0.083333
7 36.2 2
16.6 0.083333
8 52.8 2.25
21.1
9 73.9
To find the first term, use Newton’s forward interpolation formula with

ℎ =4−3=1
1−3
𝑠= = −2
1
𝑃3 (1) = 𝑃3 (3 − 2)
= 4.8 + h ∗ s(3.6) + 𝑠 ∗ (𝑠 − 1) ∗ ℎ2 (1.25) + 𝑠 ∗ (𝑠 − 1) ∗ (𝑠 − 2) ∗ ℎ3 ∗ 0.083333
𝑃3 (1) = 3.1
To obtain the tenth term, u se Newton’s backward interpolation formula with
ℎ =4−3=1
10 − 9
𝑠= =1
1
𝑃3 (10) = 𝑃10 (9 + 1)
= 73.9 + 𝑠 ∗ ℎ ∗ (21.1) + 𝑠 ∗ (𝑠 + 1) ∗ ℎ2 ∗ (2.25) + 𝑠 ∗ (𝑠 + 1) ∗ (𝑠 + 2)
∗ ℎ3 (0.083333) = 100

54
92CHAPTER 3. INTERPOLATION AND POLYNOMIAL APPROXIMATION

EXERCISE SET 3.2

1. For the given functions f (x), let x0 = 0, x1 = 0.6, and x2 = 0.9. Construct
the Lagrange interpolating polynomials of degree (i) at most 1 and (ii) at
most 2 to approximate f (0.45), and find the actual error.


(a) f (x) = cos x (b) f (x) = 1+x

(c) f (x) = ln(x + 1) (d) f (x) = tan x

2. Use the Lagrange polynomial error formula to find an error bound for the
approximations in Exercise 1.

3. Use appropriate Lagrange interpolating polynomials of degrees 1, 2, and 3 to


approximate each of the following:

(a) f (8.4) if f (8.1) = 16.94410, f (8.3) = 17.56492, f (8.6) = 18.50515,


f (8.7) = 18.82091

(b) f − 13 if f (−0.75) = −0.07181250, f (−0.5) = −0.02475000, f (−0.25) =


0.33493750, f (0) = 1.10100000

(c) f (0.25) if f (0.1) = 0.62049958, f (0.2) = −0.28398668, f (0.3) = 0.00660095,


f (0.4) = 0.24842440

(d) f (0.9) if f (0.6) = −0.17694460, f (0.7) = 0.01375227, f (0.8) = 0.22363362,


f (1.0) = 0.65809197

4. Use Neville’s method to obtain the approximations for Exercise 3.



5. Use Neville’s method to approximate 3 with the function f (x) = 3x and the
values x0 = −2, x1 = −1, x2 = 0, x3 = 1, and x4 = 2.
√ √
6. Use Neville’s method to approximate 3 with the function f (x) = x and
the values x0 = 0, x1 = 1, x2 = 2, x3 = 4, and x4 = 5. Compare the accuracy
with that of Exercise 5.

7. The data for Exercise 3 were generated using the following functions. Use the
error formula to find a bound for the error and compare the bound to the
actual error for the cases n = 1 and n = 2.

(a) f (x) = x ln x

(b) f (x) = x3 + 4.001x2 + 4.002x + 1.101

(c) f (x) = x cos x − 2x2 + 3x − 1

(d) f (x) = sin(ex − 2)


3.2. LAGRANGE POLYNOMIALS 93

8. Use the Lagrange interpolating polynomial of degree 3 or less and four-digit


chopping arithmetic to approximate cos 0.750 using the following values. Find
an error bound for the approximation.

cos 0.698 = 0.7661 cos 0.733 = 0.7432


cos 0.768 = 0.7193 cos 0.803 = 0.6946

The actual value of cos 0.750 is 0.7317 (to four decimal places). Explain the
discrepancy between the actual error and the error bound.

9. Use the following values and four-digit rounding arithmetic to construct a


third Lagrange polynomial approximation to f (1.09). The function being ap-
proximated is f (x) = log10 (tan x). Use this knowledge to find a bound for the
error in the approximation.

f (1.00) = 0.1924 f (1.05) = 0.2414 f (1.10) = 0.2933 f (1.15) = 0.3492

10. Repeat Exercise 9 using Maple with Digits set to 10.

11. Let P3 (x) be the interpolating polynomial for the data (0, 0), (0.5, y), (1, 3),
and (2, 2). Find y if the coefficient of x3 in P3 (x) is 6.

12. Neville’s method is used to approximate f (0.5), giving the following table.

x0 = 0 P0 = 0
x1 = 0.4 P1 = 2.8 P0,1 = 3.5
27
x2 = 0.7 P2 P1,2 P0,1,2 = 7

Determine P2 = f (0.7).

13. Suppose you need to construct eight-decimal-place tables for the common, or
base-10, logarithm function from x = 1 to x = 10 in such a way that linear
interpolation is accurate to within 10−6 . Determine a bound for the step size
for this table. What choice of step size would you make to ensure that x = 10
is included in the table?

14. Suppose xj = j for j = 0, 1, 2, 3 and it is known that

P0,1 (x) = 2x + 1, P0,2 (x) = x + 1, and P1,2,3 (2.5) = 3.

Find P0,1,2,3 (2.5).

15. Neville’s method is used to approximate f (0) using f (−2), f (−1), f (1), and
f (2). Suppose f (−1) was overstated by 2 and f (1) was understated by 3.
Determine the error in the original calculation of the value of the interpolating
polynomial to approximate f (0).
94CHAPTER 3. INTERPOLATION AND POLYNOMIAL APPROXIMATION

16. The following table lists the population of the United States from 1940 to
1990.

Year 1940 1950 1960 1970 1980 1990


Population 132, 165 151, 326 179, 323 203, 302 226, 542 249, 633
(in thousands)

Find the Lagrange polynomial of degree 5 fitting this data, and use this
polynomial to estimate the population in the years 1930, 1965, and 2010.
The population in 1930 was approximately 123,203,000. How accurate do you
think your 1965 and 2010 figures are?

17. In Exercise 15 of Section 1.2 a Maclaurin series was integrated to approximate


erf(1), where erf(x) is the normal distribution error function defined by
 x
2 2
erf(x) = √ e−t dt.
π 0

(a) Use the Maclaurin series to construct a table for erf(x) that is accurate
to within 10−4 for erf(xi ), where xi = 0.2i, for i = 0, 1, . . . , 5.

(b) Use both linear interpolation and quadratic interpolation to obtain an


approximation to erf( 13 ). Which approach seems more feasible?
3.3. DIVIDED DIFFERENCES 101

EXERCISE SET 3.3


1. Use Newton’s interpolatory divided-difference formula to construct interpo-
lating polynomials of degrees 1, 2, and 3 for the following data. Approximate
the specified value using each of the polynomials.

(a) f (8.4) if f (8.1) = 16.94410, f (8.3) = 17.56492, f (8.6) = 18.50515,


f (8.7) = 18.82091
(b) f (0.9) if f (0.6) = −0.17694460, f (0.7) = 0.01375227, f (0.8) = 0.22363362,
f (1.0) = 0.65809197

2. Use Newton’s forward-difference formula to construct interpolating polyno-


mials of degrees 1, 2, and 3 for the following data. Approximate the specified
value using each of the polynomials.

(a) f − 13 if f (−0.75) = −0.07181250, f (−0.5) = −0.02475000, f (−0.25) =


0.33493750, f (0) = 1.10100000
(b) f (0.25) if f (0.1) = −0.62049958, f (0.2) = −0.28398668,
f (0.3) = 0.00660095, f (0.4) = 0.24842440

3. Use Newton’s backward-difference formula to construct interpolating polyno-


mials of degrees 1, 2, and 3 for the following data. Approximate the specified
value using each of the polynomials.

(a) f − 13 if f (−0.75) = −0.07181250, f (−0.5) = −0.02475000, f (−0.25) =


0.33493750, f (0) = 1.10100000
(b) f (0.25) if f (0.1) = −0.62049958, f (0.2) = −0.28398668,
f (0.3) = 0.00660095, f (0.4) = 0.24842440

4. (a) Construct the fourth interpolating polynomial for the unequally spaced
points given in the following table:

x 0.0 0.1 0.3 0.6 1.0


f (x) −6.00000 −5.89483 −5.65014 −5.17788 −4.28172

(b) Suppose f (1.1) = −3.99583 is added to the table. Construct the fifth
interpolating polynomial.
5. (a) Use the following data and the Newton forward divided-difference for-
mula to approximate f (0.05).

x 0.0 0.2 0.4 0.6 0.8


f (x) 1.00000 1.22140 1.49182 1.82212 2.22554
102CHAPTER 3. INTERPOLATION AND POLYNOMIAL APPROXIMATION

(b) Use the Newton backward divided-difference formula to approximate


f (0.65).

6. The following population table was given in Exercise 16 of Section 3.2.

Year 1940 1950 1960 1970 1980 1990


Population 132, 165 151, 326 179, 323 203, 302 226, 542 249, 633
(in thousands)

Use an appropriate divided difference method to approximate each value.

(a) The population in the year 1930.

(b) The population in the year 2010.

7. Show that the polynomial interpolating the following data has degree 3.

x −2 −1 0 1 2 3
f (x) 1 4 11 16 13 −4

8. (a) Show that the Newton forward divided-difference polynomials

P (x) = 3 − 2(x + 1) + 0(x + 1)(x) + (x + 1)(x)(x − 1)

and

Q(x) = −1 + 4(x + 2) − 3(x + 2)(x + 1) + (x + 2)(x + 1)(x)

both interpolate the data

x −2 −1 0 1 2
f (x) −1 3 1 −1 3

(b) Why does part (a) not violate the uniqueness property of interpolating
polynomials?

9. A fourth-degree polynomial P (x) satisfies ∆4 P (0) = 24, ∆3 P (0) = 6, and


∆2 P (0) = 0, where ∆P (x) = P (x + 1) − P (x). Compute ∆2 P (10).
3.3. DIVIDED DIFFERENCES 103

10. The following data are given for a polynomial P (x) of unknown degree.

x 0 1 2
P (x) 2 −1 4

Determine the coefficient of x2 in P (x) if all third-order forward differences


are 1.

11. The Newton forward divided-difference formula is used to approximate f (0.3)


given the following data.

x 0.0 0.2 0.4 0.6


f (x) 15.0 21.0 30.0 51.0

Suppose it is discovered that f (0.4) was understated by 10 and f (0.6) was


overstated by 5. By what amount should the approximation to f (0.3) be
changed?

12. For a function f , the Newton’s interpolatory divided-difference formula gives


the interpolating polynomial
16
P3 (x) = 1 + 4x + 4x(x − 0.25) + x(x − 0.25)(x − 0.5)
3
on the nodes x0 = 0, x1 = 0.25, x2 = 0.5 and x3 = 0.75. Find f (0.75).

13. For a function f , the forward divided differences are given by

x0 = 0 f [x0 ]
f [x0 , x1 ]
50
x1 = 0.4 f [x1 ] f [x0 , x1 , x2 ] = 7
f [x1 , x2 ] = 10
x2 = 0.7 f [x2 ] = 6

Determine the missing entries in the table.

You might also like