Consider now a set of points (knots)
and polynomials
defined on each subinterval,
. We think of a function
on the appropriate subintervals. A spline is a piecewise kth degree
polynomial that is smoothly connected at each knot.
We shall examine cubic splines, the third order interplation allowing a change in curvature in a given subinterval. We demand
There are n polynomials, so there are 4n coefficients that need to be determined. These constraints give n+1 + 3(n-1) = 4n-2 conditions. The extra 2 conditions are usually specified as derivative information at the ends. Free splines specify zero second derivatives at btoh ends; clamped splines specify the first derivatives at the ends.
On
, consider the spline S. Because it is cubic,
its second derivative is linear,
, and we have
By evaluating at the two knots, we find
Now impose the continuity of deivatives from left and right. After considerable algebra, we find
This is n-1 equations for the n+1 unknowns
. A free spline
implies
, while a clamped spline gives derivative conditions for S'.
We are left with a tridiagonal system to solve.