---
title: "Natural cubic spline: y(8)"
subject: "Numerical Method"
chapter: 4
key: "semester_4/numerical_method:spline-find-y-8"
source: https://www.bctengineer.com/q/semester_4/numerical_method/spline-find-y-8
site: BCT Engineering
---

# Natural cubic spline: y(8)

Numerical Method · Chapter 4: Interpolation

- Asked in: 2070 Bhadra, 8 marks
- Video: [Natural Cubic Spline Interpolation Example | Numerical Methods](https://www.youtube.com/watch?v=yOUst2672qo) — StudySession
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/numerical_method/spline-find-y-8
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-4

## Question

Find y at x = 8 from the following data using Natural Cubic Spline interpolation.
| x | 3 | 5 | 7 | 9 |
|---|---|---|---|---|
| y | 3 | 2 | 3 | 1 |

## 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.

## Answer

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

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

With 6/h² = 1.5:

```text
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

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

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

```text
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.

```text
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**

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which interval is used for x = 8?
   A. [3, 9]
   B. [5, 7]
   C. [7, 9]
   D. [3, 5]
   Answer: C. 8 lies between 7 and 9. (Key point: Interval)

2. What are the end values of M?
   A. M0 = y0
   B. All Mi = 1
   C. M0 = M3 = 0
   D. M1 = M2 = 0
   Answer: C. Natural spline has zero second derivative at the ends. (Key point: End conditions)

3. What is the right side of 4M1 + M2?
   A. 6 × 3 = 18
   B. 0
   C. 1.5 × (3 - 4 + 3) = 3.0
   D. 1.5 × (2 + 3) = 7.5
   Answer: C. 6/h² = 1.5 and y2 - 2y1 + y0 = 3 - 4 + 3 = 2, giving 3.0. (Key point: Equations)

## Related in Numerical Method

- [Natural cubic spline: y(6.5)](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Aspline-5-7-9-11) — Numerical Method, chapter 4, asked 3×
- [Natural cubic spline: y(4.5)](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Aspline-4-5) — Numerical Method, chapter 4, asked 3×
- [Natural cubic spline: y(0.5)](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Aspline-y-0-5) — Numerical Method, chapter 4, asked 3×
- [Cubic spline and its advantage](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Acubic-spline-advantage) — Numerical Method, chapter 4

## Related in other subjects

- [Interpolation versus approximation spline](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Ainterpolation-vs-approximation-spline) — Computer Graphics, chapter 5, asked 2×
- [Uniform cubic B-spline segment points](https://www.bctengineer.com/question.md?key=semester_4%2Fcomputer_aided_design%3Auniform-cubic-bspline-numerical) — Computer Aided Design, chapter 3
- [Convert Hermite data to Bezier cubic](https://www.bctengineer.com/question.md?key=semester_4%2Fcomputer_aided_design%3Ahermite-to-bezier-conversion) — Computer Aided Design, chapter 3
