Professional Documents
Culture Documents
Polynomial Interpolation
Applications of Interpolation:
• Data fitting: Given a set of of data points {(xi, yi)}ni=0 (i.e. measured
values with a unknown functional relation y = f (x)). Find a reasonable
function y = φ(x), that fits the data points and which approximately
described f in the sense yi = φ(xi), i = 0(1)n.
If the data are accurate it makes sense to require that φ(x) interpolate
the data; approximating functions which do not fit the data exactly are
considered in the chapter ’approximation of functions’.
• Approximating known functions: If a complicated function f is known,
but the numerical costs for computation are high, it will be used a simpler
(interpolating) function φ for computation of the values.
• In computer graphics are to compound given points to a smooth curve
(or surface). This is often an interpolating problem.
• Auxiliary problems in mathematics for numerical differentiation, for
integration etc. are solved by interpolation.
Problem: ⇒ Approximation of a function which is known
through its nodal values.
Precisely, given n + 1 pairs (xi, yi), the problem consists of finding a
function Φ = Φ(xi) = yi for i = 0, . . . , n, yi being some given values,
and say that Φ interpolates {yi} at the nodes {xi}.
Questions:
• Existence and Uniqueness of the interpolating function.
• Stable computation of functional values of the interpolant.
• Describing of a procedure, numerical complexity.
• Choice of classes of functions for interpolation, error estimations.
Polynomial Interpolation
Given: n + 1 pairs (xi, yi). Pm - class of polynomials, grad Pm ≤ m.
Find a polynomial Πm ∈ Pm, called an interpolating polynomial, such that
Πm(xi) := amxm
i + . . . + a1 xi + ao = yi , i = 0, . . . , n. (1)
The points xi are called interpolation nodes. If n 6= m the problem is over
or under-determined. We consider here the case n = m.
A first example for 5 given data points:
If we define
n
Y x − xj
Lin ∈ Pn : Lin(x) = , i = 0, . . . , n,
x
j=0 i
− xj
j6=i
then Lin(xj ) = δij and we immediately get from the equ. that bi = yi.
The polynomials {Lin} form a basis for Pn (proof ?). As a consequence,
the interpolating polynomial exists and has the following form,
called the Lagrange form
Xn
Πn(x) = yiLin(x). (2)
i=0
To prove the uniqueness, suppose that another interpolating polynomial Ψm
of degree m ≤ n exists, such that Ψm(xi) = yi, ∀i. Then the difference
polynomial Πn − Ψm vanishes at n + 1 distinct points xi and thus coincides
with the null polynomial, therefore, Ψm = Πn. 2
We can write
n
X ωn+1(x)
Πn(x) = 0 yi (3)
i=0
(x − xi)ωn+1 (xi)
where ωn+1 is the nodal polynomial of degree n + 1 defined as
Yn
ωn+1(x) = (x − xi). (4)
i=0
Formula (2) is called the Lagrange form of the interpolating polynomial,
while the polynomials Lin(x) are the characteristic polynomials.
The Interpolation Error
2
Λn(X) > log(n + 1) − C, C > 0, n = 0, 1, . . .
π
This property shows that Λn(X) → ∞ as n → ∞. This has important
consequences (in particular there always exists a continuous function f ,
such that Πnf does not converge uniformly to f .
1
Example: (Runge’s counterexample) f (x) = 1+x2
, −5 ≤ x ≤ 5.
⇒ Lagrange interpolation diverges for |x| > 3.63.
Newton Form of the Interpolating Polynomial
The Lagrange form (2) of the interpolating polynomial is not the most
convenient from a practical point of view. Alternatively, we introduce an
other form characterized by a cheaper computational cost.
Our Goal: Represent the polynomial Πn with Πn(xi) = yi for i = 0, . . . .n
as the sum of Πn−1 (with Πn−1(xi) = yi for i = 0, . . . , n − 1) and a
polynomial of degree n:
Πn(x) = Πn−1(x) + qn(x), qn ∈ Pn. (6)
Since qn(xi) = Πn(xi) − Πn−1(xi) = 0 for i = 0, . . . , n − 1, it must
necessarily be that
qn(x) = an(x − x0) . . . (x − xn−1) = anωn(x).
We find from Πnf (xn) = f (xn) that
f (xn) − Πn−1f (xn)
an =
ωn(xn)
The coefficient an is called n-th the Newton divided difference and is
generally denoted by
an = f [x0, x1, . . . , xn] for n ≥ 1. (7)
As a consequence we get
Πnf (x) = Πn−1f (x) + ωn(x)f [x0, x1, . . . , xn]. (8)
If we let y0 = f (x0) = f [x0] and ω0 = 1, by recursion on n we can obtain
from(8) the formula
n
X
Πnf (x) = ωk (x) f [x0, x1, . . . , xn]. (9)
k=0
for j:= Ø to n
for m:=j-1 downto Ø
f[m]:= (f[m+1]-f[m])/(x[j]-x[m])
s[j]:=f[Ø]
Definition: Divided Differences For 0 ≤ j, k ≤ n and j + k ≤ n.
f [xj ] := fj , j = 0, 1, . . . , n,
f [xj+1, . . . , xj+k ] − f [xj , . . . , xj+k−1]
f [xj , . . . , xj+k ] :=
xj+k − xj
1. periodic splines, if
(m) (m)
sk (a) = sk (b), m = 0, 1, . . . , k − 1; (12)
2. natural splines, if for k = 2l − 1, with l ≥ 2
(l+j) (l+j)
sk (a) = sk (b)= 0, j = 0, 1, . . . , l − 2; (13)
3. clamped splines (for cubic splines, esp.), if the 1-st derivative (k > 3:
more conditions) is given on the boundaries.
6 fi+1 − fi fi − fi−1
di = − , i = 1, . . . , n − 1.
hi + hi+1 hi+1 hi
System (15) has n + 1 unknowns and n − 1 equations; thus, two conditions
are still lacking. In general, these conditions can be of the form
2M0 + λ0M1 = d0, µnMn−1 + 2Mn = dn,
with 0 ≤ λ0, µn ≤ 1 and d0, dn given values. (for instances, in order to
obtain the natural splines (satisfying s003 (a) = s003 (b) = 0), we must set the
above coefficients equal to zero. A popular choice sets λ0 = µn = 1 and
d0 = d1, dn = dn−1, which corresponds to prolongating the spline outside
the end points of the interval [a, b] and treating a and b as internal points.
This strategy produces a spline with a ”smooth” behavior. In general, the
resulting linear system is tridiagonal of the form
2 λ0 ··· 0 M0 d0
µ1 2 λ .. M d
1 1 1
0
. .. . .. . .. .
0 . = .
. (16)
.. µn−1 2 λn−1 Mn−1 dn−1
0 ··· 0 µn 2 Mn dn
and it can be efficiently solved using a special algorithm for tridiagonal
systems.
x=xk Z xk
0 0 00 0 0 000
= [f − s3]s3 (x) − [f − s3]s3 (x) dx
x=xk−1 xk−1
x=xk x=xk −0
0 0 00 000
= [f − s3]s3 (x) − [f − s3]s3 +
x=xk−1 x=xk−1 +0
| {z }
f (xk )=s3 (xk ) ∀k
Z xk
(4)
+ [f − s3]s3 (x) (x) dx,
xk−1
| {z }
s3 ∈P3 , s0000
3 (x)≡0
The 1-st term can be summarized for all k, we note that f 0, s0, and s00 are continuous
functions. Thus we finally find the result
Z b
00 00 00 0 0 0 0
{f − s3 }s3 (x) dx = {f − s } (b) − {f − s } (a).
a
Interpolating cubic spline and its derivatives for the Runge function
B–Splines
We go back to splines of a generic degree k, and we consider now the
B-spline (or bell-spline) basis, referring to divided differences.