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.20.20.61
0.0384610.10.50.50.10.038461

Runge’s function 1/(1+25x²): degree-5 interpolant vs linear spline-1-0.6-0.20.20.61-0.200.20.40.60.81xyf(x)P₅ (polynomial)linear spline

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 .

SplineDegreeContinuityUnknowns ( intervals)
Linear1 continuous, jumps
Quadratic2 continuous
Cubic3 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:

ConditionEquations
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
1022.7040
20.88884.92888.88
3−0.135635.66−141.61
41.6048−33.956554.55
50.2088928.86−152.13

→ use piece 3:

Quadratic spline through rocket data (a₁ = 0)0510152025300200400600800t (s)v (m/s)dataV(16) = 394.24

⚠️ 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

ConditionEquations
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 polynomial392.19
Cubic polynomial392.06
Quadratic spline ()394.24
Natural cubic spline (extra)392.15