6.5.2 Cubic spline interpolation and quadrature
Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §6.5.2–6.5.3. Rewritten in original wording. Continues 6.5b Lagrange interpolation labs. Labs: 6.5.2b Cubic splines labs.
From local polynomials to splines
A three-point (parabolic) local Lagrange fit already avoids the wild oscillations of a single high-degree global polynomial. Cubic splines push the idea further: fit a cubic polynomial in each interval, but additionally force the first and second derivatives to match at every shared node. The result is a curve that looks and behaves like a physical drafting spline — a flexible strip of material bent through pins at the data points — smooth in both slope and curvature.
Because each piece is only a cubic, splines never show the runaway oscillations of a high-degree Lagrange fit, and because the pieces are matched smoothly, the composite curve can be safely differentiated and integrated. That matters physically: if the interpolated quantity is a potential, its spline derivative gives a well-behaved force.
Matching conditions and panel integral
On each fit a Taylor cubic about the left node, then glue pieces by value, slope, and curvature. Walk the matching equations and the analytic panel integral — pick the matching formula at each step (lookalikes included).
Interior matching alone leaves two free second derivatives at the ends. Common closures:
- Natural spline: .
- Given first derivatives at the endpoints (measured or estimated) to back out , .
- Given (or estimated) second derivatives directly.
Solving the linear system by hand is mechanical — in practice delegate to a library spline routine rather than rederiving each time. When is known only at nodes, summing cubic panel integrals is about as accurate as tabulated quadrature gets; if you can evaluate freely, prefer Gauss. Finer panels do not automatically help — subtractive cancellation in the endpoint evaluations can grow.
Cubic spline interpolation
1 / 4A cubic spline enforces continuity, across interval boundaries, of…
Pick an answer to see if you are right.
Next: 6.5.2b Cubic splines labs.