Module

for

Cubic Splines

Cubic Spline Interpolant

Definition (Cubic Spline).  Suppose that    are  n+1  points, where  .  The function    is called a cubic spline if there exists  n  cubic polynomials    with coefficients    that satisfy the properties:

I.
for  .

II.        for  .
The spline passes through each data point.

III.        for  .
The spline forms a continuous function over [a,b].

IV.        for  .
The spline forms a smooth function.

IV.        for  .
The second derivative is continuous.

Lemma (Natural Spline).  There exists a unique cubic spline with the free boundary conditions    and  .

Remark.  The natural spline is the curve obtained by forcing a flexible elastic rod through the points but letting the slope at the ends be free to equilibrate to the position that minimizes the oscillatory behavior of the curve.  It is useful for fitting a curve to experimental data that is significant to several significant digits.

Computer Programs  Cubic Splines  Cubic Splines

Program (Natural Cubic Spline).  To construct and evaluate the cubic spline interpolant for the   data points  ,  using the free boundary conditions    and  .

Mathematica Subroutine (Natural Cubic Spline).

Example 1.  Construct the natural cubic spline for the points   that has the endpoint constraints   .
Solution 1.

Example 2.  Construct the natural cubic spline for the points   that has the endpoint constraints   .  Use Mathematica's procedure SplineFit.
Solution 2.

Remark.  There are five popular types of splines: natural spline, clamped spline, extrapolated spline, parabolically terminated spline, endpoint curvature adjusted spline.
When
Mathematica constructs a cubic spline it uses the "natural cubic spline."

Clamped Spline.

Lemma (Clamped Spline).  There exists a unique cubic spline with the first derivative boundary conditions    and  .

A property of clamped cubic splines.

A practical feature of splines is the minimum of the oscillatory behavior they possess.  Consequently, among all functions f(x) which are twice continuously differentiable on [a,b] and interpolate a given set data points , the cubic spline has "less wiggle."  The next result explains this phenomenon.

Theorem (Minimum property of clamped cubic splines).  Assume that    and    is the unique clamped cubic spline interpolant for   which passes through and satisfies the clamped end conditions    and  .   Then

.

Computer Programs  Cubic Splines  Cubic Splines

Program (Clamped Cubic Spline).  To construct and evaluate the cubic spline interpolant  S(x)  for the  n+1  data points  ,  using the first derivative boundary conditions    and  .

Example 3.  Construct the clamped cubic spline for the points   that has the endpoint constraints   .
Solution 3.

Cubic Splines  Cubic Splines  Internet hyperlinks to web sites and a bibliography of articles.

(c) John H. Mathews 2004