4.4 Lagrange Polynomials
4.4 Lagrange Polynomials
Consider two points, [a,f(a)] and [b,f(b)]. The linear Lagrange polynomial
P1(x) which passes through these two points is given by
The Lagrange polynomial can be used for both unequally spaced data
and equally spaced data. No system of equations must be solved to evaluate
the polynomial. However, a considerable amount of computational effort is
involved, especially for higher-degree polynomials.
The form of the Lagrange polynomial is quite different in appearance
from the form of the direct fit polynomial, Eq. (4.34). However, by the
uniqueness theorem, the two forms both represent the unique polynomial
that passes exactly through a set of points.
The results are summarized below, where the results of linear, quadratic, and
cubic interpolation, and the errors, Error(3.44) = P(3.44) = 0.290698, are
tabulated. The advantages of higher-degree interpolation are obvious.
where the subscript i denotes the base point of the value (e.g., i,i+ 1, etc.)
and the superscript (n) denotes the degree of the interpolation (e.g., zeroth,
first, second, etc.).
A table of linearly interpolated values is constructed for the original
data, which are denoted as fi(0). For the first interpolation of the data,
f1(3). None of the prior work must be redone, as it would have to be redone
to evaluate a third-degree Lagrange polynomial. If the original data are
arranged in order of closeness to the interpolation point, each value in the
table, fi(n) , represents a centered interpolation.
Consider the four data points given in Example 4.3. Let's interpolate for
f(3.44) using linear, quadratic, and cubic interpolation using Neville's
algorithm. Rearranging the data in order of closeness to x = 3.44 yields the
following set of data:
Let's construct a six-place divided difference table for the data presented in
Section 4.1.
The results are presented in Table 4.4.
Let's define a power series for Pn(x) such that the coefficients are identical to
the divided differences, fi(n) Thus,
The linear interpolation value is much more accurate due to the centering of
the data. The quadratic and cubic interpolation values are the same as before,
except for round-off errors, because the same points are used in those two
interpolations. These results are the same as the results obtained in the
previous examples.