1. Why Splines?
Motivation – when polynomial interpolation goes wrong
A single high-degree polynomial behaves badly with noisy data or slope discontinuities, and it oscillates between nodes.
Example (slides) – Runge’s function
| −1 | −0.6 | −0.2 | 0.2 | 0.6 | 1 | |
|---|---|---|---|---|---|---|
| 0.038461 | 0.1 | 0.5 | 0.5 | 0.1 | 0.038461 |
The degree-5 interpolant misses the peak and overshoots below zero near the ends. The piecewise-linear spline stays close to the data.
⚠️ Using more equally spaced nodes with a single polynomial makes Runge’s oscillations worse, not better.
Definition – Spline
Use different low-degree polynomials on each subinterval and join them into one function on .
A spline of degree is : it and its first derivatives are continuous.
With data points there are intervals and pieces .
| Spline | Degree | Continuity | Unknowns ( intervals) |
|---|---|---|---|
| Linear | 1 | continuous, jumps | |
| Quadratic | 2 | continuous | |
| Cubic | 3 | continuous |
2. Linear Splines
Formula
Join consecutive points with straight lines (a broken line):
i.e. , with and the slope of the segment.
⚠️ is not continuous at the nodes (there are corners).
Example (slides) – rocket,
:
(This is identical to linear interpolation on the bracketing pair.)
3. Quadratic Splines
Setup
points → intervals → unknowns, so we need equations:
| Condition | Equations |
|---|---|
| Each piece passes through its 2 end points: , | |
| First derivative continuous at interior nodes: | |
| Extra assumption: first spline is linear, | |
| Total | ✓ |
The second (and higher) derivatives may be discontinuous.
Example (slides) – rocket, 6 points → 5 splines, 15 unknowns
Through the points (10 equations):
- : ,
- : ,
- : ,
- : ,
- : ,
Derivative continuity (4 equations):
- :
- :
- :
- :
Last equation:
⚠️ The slide writes the condition as "". The derivative is , so it should be .
Solution (15×15 system):
| Interval | ||||
|---|---|---|---|---|
| 1 | 0 | 22.704 | 0 | |
| 2 | 0.8888 | 4.928 | 88.88 | |
| 3 | −0.1356 | 35.66 | −141.61 | |
| 4 | 1.6048 | −33.956 | 554.55 | |
| 5 | 0.20889 | 28.86 | −152.13 |
→ use piece 3:
⚠️ The assumption is arbitrary and its effect propagates through every piece. That’s why the quadratic spline (394.24) differs more from the polynomial answers (≈ 392.1) than you might expect.
4. Cubic Splines
Setup
points → cubics → unknowns. Cubics avoid the corners of linear splines and the arbitrary of quadratic ones.
Conditions
| Condition | Equations |
|---|---|
| Interior knots: and | |
| End points fixed: , | |
| 1st derivative continuous at interior nodes: | |
| 2nd derivative continuous at interior nodes: | |
| Subtotal | |
| Boundary conditions (natural spline): , | |
| Total | ✓ |
Example (extra)
The natural cubic spline through the 6 rocket points gives m/s, very close to the cubic polynomial answer (392.06), without Runge-type oscillation.
⚠️ “Natural” means zero curvature at both ends. Other end conditions (e.g. a prescribed end slope, “assume derivative value if needed”) give slightly different splines.
5. Summary – by Every Interpolation Method
| Method | (m/s) |
|---|---|
| Linear (direct / Lagrange / linear spline) | 393.70 |
| Quadratic polynomial | 392.19 |
| Cubic polynomial | 392.06 |
| Quadratic spline () | 394.24 |
| Natural cubic spline (extra) | 392.15 |