Interpolation: polynomials vs. splines
In the applet below you can choose a number of points and compare the behavior of
(algebraic) polynomial vs. the (natural) cubic spline
passing through the given points.
Try to put about eight points in a straight line. Then move one of the points
in the middle up and down. You will see that the interpolating polynomial will
change drastically even far away from the perturbed node.
For the cubic spline, however, the changes rapidly decay away from the perturbed node.
The polynomial interpolant is the unique (algebraic) polynomial of
degree n-1 or less which passes through the given n points.
The cubic spline is the unique piecewise cubic polynomial such that its
pointvalues and its first two derivatives (but not the third) are continuous at the given n points.
Having zero second derivatives at the endpoints makes it natural.
It is the smoothest of all possible interpolating curves in the sense that
it minimizes the integral of the square of the second derivative.
Acknowledgement. Thanks to Tobias von Petersdorff who wrote this code
with the help of Michael Heinrichs' Curve Applet
and to Hetal Patel
for the implementation.