Skip to main content

Natural cubic spline: y(8)

Short answer

Natural cubic spline with h=2, M₀=M₃=0. Continuity gives M₁=1.1, M₂=−1.4. On [7,9]: S(8)=2.3500.

Find y at x = 8 from the following data using Natural Cubic Spline interpolation.

x3579
y3231

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 = 3 intervals, equal spacing h = 2. Let Mᵢ = S″(xᵢ), with M₀ = M3 = 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 … 2

With 6/h² = 1.5:

4M1 + M2 = 1.5 × (3 − 2(2) + 3) = 3.0000
M1 + 4M2 = 1.5 × (1 − 2(3) + 2) = -4.5000

Solving these simultaneous equations (elimination) gives

M₀ = 0, M1 = 1.1000, M2 = -1.4000, M3 = 0

Step 2: Spline on the interval [7, 9]

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 = 2, x = 8: x3 − x = 1.0000, x − x2 = 1.0000, M2 = -1.4000, M3 = 0.0000.

S(8) = (-1.4000)(1.0000)³/12 + (0.0000)(1.0000)³/12
          + (1.9667)(1.0000) + (0.5000)(1.0000)
        = -0.1167 + 0.0000 + 1.9667 + 0.5000
        = 2.3500

Answer: y(8) ≈ 2.3500

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 4 questions →