Skip to main content

Natural cubic spline: y(4.5)

Short answer

For the natural cubic spline with h = 2, solve M0 = 0, M1 = -1.6875, M2 = 2.25, M3 = -2.8125, M4 = 0. Evaluating the spline on [3,5] at x = 4.5 gives y(4.5) approximately 11.0215.

Estimate y(4.5) from the following data using Natural Cubic Spline Interpolation technique.

x13579
y101211139

A natural cubic spline is a piecewise cubic S(x) that passes through all data points, has continuous first and second derivatives at the interior knots, and has zero second derivative at the end points (M₀ = Mₙ = 0).

Step 1: Setup

Points: n = 4 intervals, equal spacing h = 2. Let Mᵢ = S″(xᵢ), with M₀ = M4 = 0.

For equal spacing the continuity of S′ at each interior knot gives

M(i−1) + 4Mi + M(i+1) = (6/h²)(y(i+1) − 2yi + y(i−1)),   i = 1 … 3

With 6/h² = 1.5:

4M1 + M2 = 1.5 × (11 − 2(12) + 10) = -4.5000
M1 + 4M2 + M3 = 1.5 × (13 − 2(11) + 12) = 4.5000
M2 + 4M3 = 1.5 × (9 − 2(13) + 11) = -9.0000

Solving these simultaneous equations (elimination) gives

M₀ = 0, M1 = -1.6875, M2 = 2.2500, M3 = -2.8125, M4 = 0

Step 2: Spline on the interval [3, 5]

S(x) = Mi(x(i+1) − x)³/(6h) + M(i+1)(x − xi)³/(6h)
       + (yi/h − Mi·h/6)(x(i+1) − x) + (y(i+1)/h − M(i+1)·h/6)(x − xi)

Here i = 1, x = 4.5: x2 − x = 0.5000, x − x1 = 1.5000, M1 = -1.6875, M2 = 2.2500.

S(4.5) = (-1.6875)(0.5000)³/12 + (2.2500)(1.5000)³/12
          + (6.5625)(0.5000) + (4.7500)(1.5000)
        = -0.0176 + 0.6328 + 3.2812 + 7.1250
        = 11.0215

Answer: y(4.5) ≈ 11.0215

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 4 questions →