Cubic splines
Piecewise interpolation with one cubic per interval: the continuity conditions, the tridiagonal system that fixes the coefficients, natural splines and how to solve them.
Why piecewise
A single high-degree polynomial oscillates between nodes (Runge phenomenon). Splines avoid this by using a different, low-degree polynomial on each interval, joined smoothly. The most used are cubic.
Cubic spline conditions
- Interpolates: S(x_i)=f(x_i) at each node.
- Piecewise: S(x)=S_i(x) on [x_i, x_{i+1}].
- Value continuity at shared nodes: S_{i+1}(x_{i+1})=S_i(x_{i+1}).
- First-derivative continuity: S_{i+1}'(x_{i+1})=S_i'(x_{i+1}).
- Second-derivative continuity: S_{i+1}''(x_{i+1})=S_i''(x_{i+1}).
- Boundary conditions: natural (S''=0 at the ends) or clamped (S' fixed at the ends).
The tridiagonal system
Imposing the conditions turns the computation of the coefficients into a linear system for the . With and :
Once the are solved, the other coefficients follow directly: