Professional Documents
Culture Documents
4 Interpolation
• 4.1 Problem formulation;
where n is non-negative integer and ai are real constants. The main advantage of poly-
nomial is that they uniformly approximate continuous function. The other important
property is their easy computation.
Definition 4.1. Given the values of a function y = f (x) at the n + 1 points yi = f (xi ),
i = 0, 1, · · · , n + 1, (We do not know any other property of f (x), including of the explicit
1
expression at all.) to approximate the function f (x), the process of looking for the other
function P (x) based on
P (xi ) = yi , i = 0, 1, 2, · · · , n (4.1)
is said as interpolation. In particular, if the function P (x) we construct is a polynomial
of degree n, it is said as polynomial interpolation. The condition (4.1) is the interpola-
tory conditions, P (x) is the interpolatory function, the unknown f (x) is the interpolated
function. xi is referred to the interpolating nodes.
There are many types for interpolation whose name is relevant to the form of P (x).
If P (x) is chosen as piecewise functions, then the interpolation is piecewise interpolation.
Spline function P (x) result in spline interpolation. In this chapter, we shall focus on the
polynomial interpolation. The immediate question is wether there exists the interpolatory
polynomial of degree Pn (x) satisfying
Pn (xi ) = yi , i = 0, 1, 2, · · · , n.
1. Geometrical figure
What we are looking for is a polynomial of degree n such that
Pn (xi ) = yi , i = 0, 1, 2, · · · , n.
Figure 4.1: The quadratic function y = x2 (the dash line) is interpolated by the polynomial
P1 (x) = 5x − 4 (the solid line) passing through two points (1, 1) and (4, 16) (the circles).
2
For the given data x0 x1 · · · xn
,
y0 y1 · · · yn
suppose the interpolating polynomial of degree n is
Pn (x) = a0 + a1 x + a2 x2 + · · · + an xn .
Pn (xi ) = yi , i = 0, 1, 2, · · · , n.
a0 + a1 x0 + · · · + an xn0 = y0 ,
n
a0 + a1 x1 + · · · + an x1 = y1 ,
a0 + a1 x2 + · · · + an xn2 = y2 ,
..
.,
a0 + a1 xn + · · · + an xnn = yn .
Note that once the unknown coefficients a0 , a1 , · · · , an are determined, we will get the
interpolating polynomial Pn (x). The above linear system also can be written into matrix
form
a y
1 x0 x20 · · · xn0
0 0
1 x1 x21 · · · xn1 a 1
y
1
.
.. .. = . . (4.2)
··· ···
1 xn x2n · · · xnn an yn
Since
1 1 ··· 1
x20 xn0
1 x0 ···
x0 x1 ··· xn
1 x1 x21 ··· xn1
x2
.. .. .. ..
0 x21 ··· x2n
= .
. . . . .. ..
..
2 n
. .
1 xn−1 xn−1 · · · xn−1
xn−1 xn−1
··· xn−1
1 xn x2n · · · xnn (n+1)×(n+1) 0 n
1 n
x0 xn1 ··· xnn
(n+1)×(n+1)
1
1 ··· 1
0
x1 − x0 ··· xn − x0
0 x 2 − x x · · · x 2 − x x
1 0 n 0
n
1
=
.. .. ..
. . .
0 xn−1 − xn−2 x0 · · · xn−1 − xn−2 x0
1 1 n n
0 xn − xn−1 x0 · · · xnn − xnn−1 x0 (n+1)×(n+1)
1 1
(x1 − x0 ) ··· (xn − x0 )
.. .. ..
= n−2 . . .
n−2
1n−1 (x1 − x0 ) · · · xn (xn − x0 )
x
x (x1 − x0 ) · · · xn (xn − x0 ) n−1
1 n×n
1
1 ··· 1
x1 x 2 · · · x n
= (x1 − x0 )(x2 − x0 ) · · · (xn − x0 ) ...
.. ..
n−2 . .
n−2 n−2
x
n−11 x 2 · · · x n
n−1 n−1
x
1 x 2 · · · x n
n×n
3
Y
= (xj − xi ),
0≤i<j≤n
f n+1 (ξ)
Rn (x) = f (x) − Pn (x) = (x − x0 )(x − x1 ) · · · (x − x0 ), (4.3)
(n + 1)!
where ξ lies in x, x0 , x1 , · · · , xn .
where λn is related to x.
If we find the form of λ(x), then the representation of Rn (x) is is decided by λ(x).
Define
ψ(t) = f (t) − Pn (t) − λn (x)(t − x0 )(t − x1 ) · · · (t − x0 ). (4.4)
Then it can be checked that x, x0 , x1 , · · · , xn are zeros of ψ(t). Based on the Rolle
theorem, it reads as follows
ψ (n+1) (ξ) = 0,
where ξ lies in the zeros x, x1 , x2 , · · · , xn .
Thus taking the n + 1th derivative of (4.4) with respect to t, it follows that
which implies
f (n+1) (ξ)
λn (x) = .
(n + 1)!
The theorem can be concluded.
4
Commence from the simplest case of two points. Given two interpolatory condition
(x0 , y0 ) and (x1 , y1 ) to find the polynomial of degree 1,
P1 (x) = a0 + a1 x,
we have
x − x1 x − x0
P1 (x) = y0 + y1 = l0 (x)y0 + l1 (x)y1 .
x0 − x1 x1 − x0
Note that P1 (x) is the linear combination of two polynomials of degree 1. Two polynomials
l0 (x) and l1 (x) satisfy the properties
l0 (x0 ) = 1, l0 (x1 ) = 0,
l1 (x0 ) = 0, l1 (x1 ) = 1.
On the other hand, let’s consider it reversely to derive the following theorem.
Theorem 4.2. Suppose that one polynomial Q0 (x) of degree 1 such that Q(x0 ) = 1,
Q(x1 ) = 0, then it has the form
x − x1
Q(x) = .
x0 − x1
Proof. Since x1 is one zero of Q(x), then Q(x) = A(x − x1 ). Moreover, it holds that
1
Q(x0 ) = 1 ⇒ A(x0 − x1 ) = 1 ⇒ A = x0 −x 1
. Thus, we have
x − x1
Q(x) = .
x0 − x1
l0 (x0 ) = 1, l0 (x1 ) = 0,
l1 (x0 ) = 1, l1 (x1 ) = 1.
P1 (x0 ) = y0 , P1 (x1 ) = y1 .
It can be easily checked that Pn (x) passes through the interpolatory nodes
5
This kind of Pn (x) is what we are looking for. Note that Pn (x) is determined by l0 (x), l1 (x), · · · , ln (x).
Considering the properties of l0 (x), it is observed that x1 , x2 , · · · , xn are zeros of l0 (x),
which yields that
l0 (x) = A(x − x1 )(x − x2 ) · · · (x − xn ).
With the last property l0 (x0 ) = 1, it follows that
1
A= .
(x0 − x1 )(x0 − x2 ) · · · (x0 − xn )
Thus, it follows that
(x − x1 )(x − x2 ) · · · (x − xn )
l0 (x) = .
(x0 − x1 )(x0 − x2 ) · · · (x0 − xn )
Similarly, we have
(x − x0 )(x − x1 ) · · · (x − xi−1 )(x − xi+1 ) · · · (x − xn )
li (x) = ,
(xi − x0 )(xi − x1 ) · · · (xi − xi−1 )(xi − xi+1 ) · · · (xi − xn )
where i = 0, 1, · · · , n. Substituting li (x) into Pn (x), we obtain
n
X
Pn (x) = li (x)yi := Ln (x),
i=1
6
4.3 Newton polynomial interpolation
It is observed that the disadvantage of Lagrangian interpolation is that if more nodes
are complemented to the interpolation conditions, all coefficients already computed will
have to be calculated again. To reduce the truncation error, more nodes always occur. In
this subsection, we focus on the other efficient algorithm.
When n = 0, the constant function P0 (polynomial of degree ≤ 0) can be chosen so
that P0 (x0 ) = y0 = f (x0 ).
For n = 1, the polynomial P1 (x) of degree 1 can be denoted as P1 (x) = f (x0 ) + C1 (x −
x0 ). Substituting (x1 , f (x1 )) into P1 (x), it holds that
f (x1 ) − f (x0 )
P1 (x) = f (x0 ) + (x − x0 ).
x1 − x0
Furthermore, suppose that we have obtained a polynomial Pk−1 of degree ≤ k − 1 with
Pk−1 (xi ) = yi for 0 ≤ i ≤ k − 1. We try to construct Pk with the form
Pk (x) = Pk−1 (x) + C(x − x0 )(x − x1 ) · · · (x − xk−1 ),
which is a polynomial of degree at most k. Now we determine the unknown coefficient C
from the condition Pk (xk ) = f (xk ). This leads to the equation
Pk−1 (xk ) + C(xk − x0 )(xk − x1 ) · · · (xk − xk−1 ) = f (xk ).
Before we attempt to calculate the constant C, the definition of divided difference should
be introduced firstly.
Definition 4.2. The divided difference of the function f (x) for the points (xi , f (xi )),
i = 0, 1, · · · , n, is defined as follows:
The zeroth divided difference,
f [x0 ] := f (x0 ) = y0 .
The quantity f [x0 , x1 ]
f [x1 ] − f [x0 ] f (x1 ) − f (x0 )
f [x0 , x1 ] := = .
x1 − x0 x1 − x0
is called the first order divided difference of two points x0 and x1 .
Using this recurrence, we have the second order divided difference of three points
(x0 , f (x0 )), (x1 , f (x1 )), (x2 , f (x2 )),
f [x1 , x2 ] − f [x0 , x1 ]
f [x0 , x1 , x2 ] = .
x2 − x1
Also
f [x1 , x2 , x3 ] − f [x0 , x1 , x2 ]
f [x0 , x1 , x2 , x3 ] = .
x3 − x0
It can be summarized as
f [x1 , x2 , · · · xn ] − f [x0 , x1 , · · · xn ]
f [x0 , x1 , · · · , xn ] = .
xn − x0
A divided difference table with the following form can be displayed as a table
x0 f (x0 )
x1 f (x1 ) f [x0 , x1 ]
x2 f (x2 ) f [x1 , x2 ] f [x0 , x1 , x2 ]
x3 f (x3 ) f [x2 , x3 ] f [x1 , x2 , x3 ] f [x0 , x1 , x2 , x3 ]
x4 f (x4 ) f [x3 , x4 ] f [x2 , x3 , x4 ] f [x1 , x2 , x3 , x4 ] f [x0 , x1 , x2 , x3 , x4 ].
7
Newton form of the interpolatory polynomial
xi x0 x1 ··· xn
For the interpolator condition we
yi y0 = f (x0 ) y1 = f (x1 ) · · · yn = f (xn )
shall formulate an algorithm-Newton interpolation in a recursive form.
whose form is called Newton interpolation, denoted by Nn (x). The condition f (xn ) =
Pn (xn ) yields
f (xn ) − Pn−1 (xn )
Cn = .
(xn − x0 )(xn − x1 ) · · · (xn − xn−1 )
To derive the constant Cn , the following theorem is formulated.
C0 = f [x0 ],
C1 = f [x0 , x1 ],
C2 = f [x0 , x1 , x2 ],
..
.,
Cn = f [x0 , x1 , x2 , · · · , xn ].
8
Proof. We shall prove Cn = f [x0 , x1 , x2 , · · · , xn ] by the induction.
This formula is true for n = 0 and n = 1. Now, assuming that it holds for n − 1, i.e.
Set
x − xn
Nn (x) = q(x) + (q(x) − Nn−1 (x)).
xn − x0
We claim that Nn (x) interpolates all points (xi , yi ), i = 0, 1, · · · , n. To check this claim,
we go through all point xi with i = 0, 1, · · · , n, as follows
Therefore, we get
Since the Uniqueness of interpolating polynomials, they must have matching coefficients
for each term pertinent to xn ,. Especially, for the leading term, it results in
Cn = f [x0 , x1 , · · · , xn ].
The relation between the divided difference table and the Newton form can be con-
structed as
9
and
x0 f (x0 )
x1 f (x1 ) f [x0 , x1 ]
x2 f (x2 ) f [x1 , x2 ] f [x0 , x1 , x2 ]
x3 f (x3 ) f [x2 , x3 ] f [x1 , x2 , x3 ] f [x0 , x1 , x2 , x3 ]
It is observed that the coefficients of Newton form are the first one of each column in the
table except for the first column.
x 1 2 0 3
Example Find the Newton interpolating polynomial for the data
y 3 2 -4 5
Solution Based on the table
1
3
2 2
-1
,
0 −4 3
-4
3 5 3 0
2
On the other hand, the error of the Newton form has it’s own representation. Commence
from
Considering the arbitrary property of the point xn+1 , switching xn+1 to x results in
10
which also implies the relation between the divided difference and the derivatives
f (n+1) (ξ)
= f [x0 , x1 , · · · , xn , x], ξ lies in x, x0 , x1 , · · · , xn .
(n + 1)!
f (1) (ξ)
f [x0 , x1 ] = , ξ lies in x0 and x1 .
1!
When n = 2,
f (2) (ξ)
f [x0 , x1 , x2 ] = , ξ lies in x0 , x1 and x1 .
2!
In particular, if x0 = x1 = x2 = · · · = xn , it yields
n+1
z }| { f (n) (x0 )
f [x0 , x0 , · · · , x0 ] = .
n!
In addition,
f [x0 , x1 ] = f [x1 , x0 ],
f [x0 , x1 , x2 ] = f [x1 , x0 , x2 ] = · · · ,
f [x0 , x1 , · · · , xn ] = f [ any permutation of x0 , x1 , · · · , xn ].
where
(x − x1 ) · · · (x − xn ) (x − x0 ) · · · (x − xn−1 )
Ln (x) = f (x0 ) + · · · + f (xn )
(x0 − x1 ) · · · (x0 − xn ) (xn − x0 ) · · · (xn − xn−1 )
where
πn+1 (x) = (x − x0 )(x − x1 ) · · · (x − xn ).
Exercises
(1) Find the Lagrange interpolating polynomial and Newton interpolating polynomial
for these data
3
x 1 2 0 2
13 5
f(x) 3 4 3 3
11
(2) The polynomial
x -1 0 1 2 3
y 2 1 2 -7 10
By adding one additional term to P (x), find a polynomial that interpolates the whole
table.
(3) Let f (x) = x1 and prove
n
Y 1
f [x0 , x1 , · · · , xn ] = (−1)n .
xi
i=0
x0 f (x0 )
x0 f (x0 ) f 0 (x0 )
f [x0 , x1 ]−f 0 (x0 )
x1 f (x0 ) f [x0 , x1 ] x1 −x0
Therefore,
f [x0 , x1 ] − f 0 (x0 )
N2 (x) = f (x0 ) + f 0 (x0 )(x − x0 ) + (x − x0 )2 .
x1 − x0
Example Use the extended Newton divided difference algorithm to determine a
polynomial that takes these values
1 2
1 2 3
2 6 4 1 ,
2 6 7 3 2
2 6 7 4 1 −1
12
it can be written directly that
and
R4 (x) = f [1, 1, 2, 2, 2, x](x − 1)2 (x − 2)3 .
2. Lagrange form of Hermite interpolation
Example Find a polynomial P (x) by interpolation under these data
Suppose that
The error is
f (3) (ξ)
R2 (x) = (x − 0)(x − 1)2 .
3!
In general, if values of a function f and some of its derivations are to be interpolated
by a polynomial, we are encountered with some difficulties because the linear systems of
equations may be singular. A simple example will illustrate this.
Exercise Find a polynomial P (x) meeting these values
0 1
P (0) = 0, P (1) = 1, P = 2.
2
13
Solution Since there are three conditions, we try a quadratic
P (x) = a0 + a1 x + a2 x2
Then
P (0) = 0 ⇒ a0 = 0
P (1) = a1 + a2 = 1
0 1 0
P (x) = a1 + 2a2 x ⇒ P = a1 + a2 = 2.
2
Thus no quadratic polynomial solves our problem. Notice the coefficient matrix is
singular. If we try a cubic polynomial for the same problem,
P (x) = a0 + a1 x + a2 x2 + a3 x3 ,
then we get
P (0) = a0 = 0.
The remaining conditions are
P (1) = 1 ⇒ a0 + a1 + a2 + a3 = 1
1 3
P 0 (x) = a1 + 2a2 x + 3a3 x2 and P 0 = 2 ⇒ a1 + a2 + a3 = 2.
2 4
x 0 1 2
p(x) -2 -4 10
2. Find a formula for the polynomial P of least degree that takes these values:
14