Lecture 7
Lecture 7
A more general interpolation problem is to find the polynomial of least degree such that
dk P dk f
(xi ) = k (xi ), i = 0, 1, · · · , n, k = 0, 1, · · · , mi .
dxk dx
Note that we allow the possibility of interpolating a different number (mi ) derivatives of f
at different interpolation points.
For this case mi = 1, there is a formula analogous to the Lagrange interpolation formula
discussed previously.
Theorem 5. If f ∈ C 1 [a, b] and x0 , x1 , · · · xn are distinct points in [a, b], then the unique
polynomial of least degree agreeing with f and f ′ at x0 , x1 , · · · xn is the Hermite polynomial
of degree ≤ 2n + 1 given by:
Xn Xn
H2n+1 (x) = Hk,n (x)f (xk ) + Ĥk,n (x)f ′ (xk ),
k=0 k=0
where
Hk,n (x) = [1 − 2(x − xk )L′k,n (xk )]L2k,n (x), Ĥk,n (x) = (x − xk )L2k,n (x),
and for k = 0, 1, . . . , n:
Yn
(x − xj )
Lk,n (x) = , n ≥ 1, L0,0 (x) = 1.
j=0
(xk − xj )
j6=k
2n+2
Moreover, if f ∈ C [a, b], then there is a point ξ(x) ∈ (a, b), such that
f 2n+2 (ξ(x))
f (x) − H2n+1 (x) = (x − x0 )2 · · · (x − xn )2 .
(2n + 2)!
Recall that the key property satisfied by Lk,n (x) was Lk,n (xi ) = 1 if k = i and Lk,n (xi ) = 0
if k 6= i. The analogous properties for Hk,n (x) and Ĥk,n (x) are:
′
Hk,n (xi ) = 1, k = i, Hk,n (xi ) = 0, k 6= i, Hk,n (xi ) = 0, i = 0, . . . , n,
′ ′
Ĥk,n (xi ) = 1, k = i, Ĥk,n (xi ) = 0, k 6= i, Ĥk,n (xi ) = 0, i = 0, . . . , n.
20 MATH 373 LECTURE NOTES
where by the interpolating polynomial we now mean that if the point z appears k + 1 times
among x0 , . . . , xn , then
Pn(j) (z) = f (j) (z), j = 0, . . . , k.
Furthermore, if f ∈ C n+1 (a, b) and x0 , . . . , xn , x ∈ [a, b], then one can show that
f (n+1) (ξ)
f [x0 , . . . , xn , x] =
(n + 1)!
for some ξ satisfying min(x0 , . . . , xn , x) ≤ ξ ≤ max(x0 , . . . , xn , x).
Example: f (x) = ln x. Calculate f (1.5) by cubic interpolation using the data: f (1) = 0,
f ′ (1) = 1, f (2) = 0.693147, f ′ (2) = 0.5. Take x0 = 1, x1 = 1, x2 = 2, x3 = 2.
Table 2
Divided difference table
xk f (xk ) f[,] f[,,] f[,,,]
1 0
1
1 0 −.306853
.693147 .113706
2 .693147 −0.193147
.5
2 .693147
MATH 373 LECTURE NOTES 21
From the error formula, we have ln(x) − P3 (x) = f (4) (ξ)(x − 1)2 (x − 2)2 /4!. Hence,
1 6 1
| ln(1.5) − P3 (1.5)| ≤ max 4 (.5)4 = = 0.015624
4! 1≤ξ≤2 ξ 64
The actual error is .00361.
4.10. Runge example. One might infer from the error formula for polynomial interpola-
tion that as one adds more and more interpolation points, one gets a better and better
approximation. This fact is not true in general and depends on how the points are added.
Example: Runge f (x) = 1/(1 + x2 ), x ∈ [−5, 5]. Set xj = −5 + j∆x, j = 0, 1, . . . , n,
∆x = 10/n. For each n, there is a unique polynomial Pn (x) of degree ≤ n satisfying
Pn (xj ) = f (xj ). However, |f (x) − Pn (x)| will become arbitrarily large at points in [−5, 5] as
n becomes large. One can show that for n = 2r,
Yn
f (x)(−1)r+1
f (x) − Pn (x) = x(x − xj ) Qr 2
.
j=0 j=0 (1 + xj )
For n = 2,
|x2 (x + 5)(x − 5)
|f (x) − P2 (x)| ≤ ≤ 1,
26(1 + x2 )
by looking at the graphs. For n = 10, x = −4.5, |f (x) − Pn (x)| = 1.53166, so the maximum
error is not getting smaller as n increases.