Lecture 6
Lecture 6
4.6. Divided differences. Defining the divided difference f [x0 ] = f (x0 ), we can generate
the polynomials Pn (x) recursively. Beginning with P0 (x) = f (x0 ) = f [x0 ], we obtain
P1 (x) = P0 (x) + f [x0 , x1 ](x − x0 ) = f [x0 ] + f [x0 , x1 ](x − x0 ).
Then
P2 (x) = P1 (x) + f [x0 , x1 , x2 ](x − x0 )(x − x1 )
= f [x0 ] + f [x0 , x1 ](x − x0 ) + f [x0 , x1 , x2 ](x − x0 )(x − x1 ).
In general, we get the formula:
n
X i−1
Y
(4.2) Pn (x) = f [x0 , . . . , xi ] (x − xj ),
i=0 j=0
Q−1
where we define j=0 (x − xj ) = 1.
In order to use formula (4.2), we must of course be able to evaluate the divided difference
f [x0 , . . . , xi ]. Using (4.1), we have that
f (x0 ) f (x1 ) f (x1 ) − f (x0 )
f [x0 , x1 ] = + = .
x0 − x1 x1 − x0 x1 − x0
and
f (x0 ) f (x1 ) f (x2 )
f [x0 , x1 , x2 ] = + + .
(x0 − x1 )(x0 − x2 ) (x1 − x0 )(x1 − x2 ) (x2 − x0 )(x2 − x0 )
Observing that
f (x1 ) f (x1 ) f (x1 )
= − ,
(x1 − x0 )(x1 − x2 ) (x1 − x0 )(x0 − x2 ) (x1 − x2 )(x0 − x2 )
we can rewrite
f (x2 ) − f (x1 ) f (x1 ) − f (x0 ) f [x1 , x2 ] − f [x0 , x1 ]
f [x0 , x1 , x2 ] = − /(x2 − x0 ) = .
x2 − x1 ) x1 − x0 ) x2 − x0
The reason for writing f [x0 , x1 , x2 ] in this form is that it indicates an easy way of generating
divided differences recursively. We can show in general that
f [x1 , . . . , xn ] − f [x0 , . . . , xn−1 ]
f [x0 , . . . , xn ] = .
xn − x0
This formula allows us to generate all the divided differences needed for the Newton formula
in a simple manner by using a divided difference table, rather than using formula (4.1). We
illustrate such a table in the case n = 4.
The divided differences in the table are calculated a column at a time using the formula
f [xi+1 , . . . , xi+k ] − f [xi , . . . , xi+k−1 ]
f [xi , . . . , xi+k ] = .
xi+k − xi
The coefficients needed for the Newton formula are then found at the beginning of each
column.
16 MATH 373 LECTURE NOTES
Table 1
Note how entries are added to the table each time a a new data point is added. For
example, if we started with the entries in the table involving only the points x0 , x1 , x2 , x3 , and
added the point x4 , we would successively generate f [x3 , x4 ]. f [x2 , x3 , x4 ], f [x1 , x2 , x3 , x4 ],
and finally f [x0 , x1 , x2 , x3 , x4 ], the additional divided difference needed for the construction
of P4 (x).
We shall return frequently to the idea of degrees of freedom of a function f . These are
quantities that uniquely determine the function f . In all our applications, these will be
values of f or
R b itsr derivatives at specific points, or possibly moments of f , i.e., quantities
of the form a x f (x) dx for some integers f ≥ 0. Note that a function may be uniquely
determined by several sets of degrees of freedom, and the choice of which ones to use and
how to represent the function will depend on the application. For example, we can also
represent any polynomial of degree ≤ n by its Taylor series expansion about a point x0 , i.e.,
n
X P (j) (x0 )
Pn (x) = (x − x0 )j .
j=0
j!
In this representation, we see that Pn (x) is uniquely determined by the quantities P (j) (x0 ),
i.e., its derivatives up to order n at the point x0 .
4.7. Interpolation error. We now turn to an analysis of the error f (x̄) − Pn (x̄), for x̄ 6=
x0 , . . . xn . For the moment, consider x̄ fixed, and let Pn+1 denote the polynomial of degree
≤ n+1 interpolating f (x) at x0 , x1 , . . . , xn and x̄. Using the Newton form of the interpolating
polynomial, we know that
n
Y
Pn+1 (x) = Pn (x) + f [x0 , . . . , xn , x̄] (x − xj ).
j=0
We next find an equivalent expression for f [x0 , . . . , xn , x̄], valid when f is sufficiently smooth.
Combining Lemma (1) with the representation of the interpolation error given by formula
(4.3), we get the following result.
Theorem 4. Suppose that f ∈ C n+1 [a, b] and that Pn (x) is a polynomial of degree ≤ n that
interpolates f at the n + 1 distinct points x0 , . . . , xn ∈ (a, b). Then for all x ∈ [a, b], there
exists a point ξ ∈ (a, b) (depending on x) such that
n
f (n+1) (ξ) Y
f (x) − Pn (x) = (x − xj ).
(n + 1)! j=0
Proof. If x is equal to any of the interpolation points xj , then the equation holds since
both sides are zero. If x is not equal to any of the interpolation points, we have from the
18 MATH 373 LECTURE NOTES
Since the n + 2 points x0 , . . . , xn , x are all distinct, we can apply Lemma (1) to conclude
that f [x0 , . . . , xn , x] = f (n+1) (ξ)/(n + 1)! for some ξ ∈ (a, b) (depending on x). Substituting
this result gives the theorem.
Note that since ξ is not known explicitly, this formula can not be used to find the actual
error. This is not surprising, since f can take on any value at non-interpolation points.
However, the theorem can be used to find an upper bound on the interpolation error if we
have more information about the way the derivatives of f behave. The following results
follow directly from the theorem.
Corollary 3. Suppose the conditions of Theorem (4) are satisfied. If maxa≤ξ≤b |f (n+1) (ξ)| ≤
Mn+1 , then
Mn+1
(4.4) |f (x) − Pn (x)| ≤ |(x − x0 )(x − x1 ) · · · (x − xn )|, for all x ∈ [a, b]
(n + 1)!
and
Mn+1
(4.5) max |f (x) − Pn (x)| ≤ max |(x − x0 )(x − x1 ) · · · (x − xn )|.
a≤x≤b (n + 1)! a≤x≤b
Let us now consider an application of these results to find a bound on the error in linear
interpolation. Recall that the linear polynomial interpolating f (x) at x0 and x1 is given by
P1 (x) = f (x0 ) + f [x0 , x1 ](x − x0 ). If x ∈ [x0 , x1 ] and maxx0 ≤ξ≤x1 |f ′′ (ξ)| ≤ M2 , then we have
by (4.4) with a = x0 , b = x1 that
M2
|f (x) − P1 (x)| ≤ |(x − x0 )(x − x1 )|, for all x ∈ [a, b]
2
and by (4.5) that
M2 M2
max |f (x) − P1 (x)| ≤ max |(x − x0 )(x − x1 )| ≤ (x1 − x0 )2 ,
x0 ≤x≤x1 2 x0 ≤x≤x1 8
since the maximum occurs at the midpoint (x0 + x1 )/2.