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

# Natural cubic spline: y(0.5)

Numerical Method · Chapter 4: Interpolation

- Asked in: 2069 Poush, 10 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-y-0-5
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-4

## Question

Using the Natural Cubic Spline interpolation technique, estimate the value of y(0.5) from the following data:
| x | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| y | 2.0 | 2.2 | 1.0 | 0.5 |

## Short answer

With natural spline (M0=M3=0) and equal spacing h=1, solving 4M1+M2=-8.4 and M1+4M2=4.2 gives M1=-2.52, M2=1.68. For interval [0,1], S(0.5) ≈ 2.2575.

## 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 = 1. 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² = 6:

```text
4M1 + M2 = 6 × (1 − 2(2.2) + 2) = -8.4000
M1 + 4M2 = 6 × (0.5 − 2(1) + 2.2) = 4.2000
```

Solving these simultaneous equations (elimination) gives

```text
M₀ = 0, M1 = -2.5200, M2 = 1.6800, M3 = 0
```

#### Step 2: Spline on the interval [0, 1]

```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 = 0, x = 0.5: x1 − x = 0.5000, x − x0 = 0.5000, M0 = 0.0000, M1 = -2.5200.

```text
S(0.5) = (0.0000)(0.5000)³/6 + (-2.5200)(0.5000)³/6
          + (2.0000)(0.5000) + (2.6200)(0.5000)
        = 0.0000 − 0.0525 + 1.0000 + 1.3100
        = 2.2575
```

**Answer: y(0.5) ≈ 2.2575**

## Check yourself

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

1. What is the RHS of 4M1 + M2 with h = 1?
   A. 0
   B. 6 × (1 - 4.4 + 2) = -8.4
   C. 6 × 1 = 6
   D. 1.5 × (...) = -2.1
   Answer: B. y2 - 2y1 + y0 = 1 - 4.4 + 2 = -1.4, times 6 = -8.4. (Key point: Equation RHS)

2. Which interval is used for 0.5?
   A. [1, 2]
   B. [0, 1]
   C. [0, 3]
   D. [2, 3]
   Answer: B. 0.5 lies between 0 and 1. (Key point: Interval)

3. In S(0.5), why does the M0 term vanish?
   A. M0 = 0 for a natural spline
   B. x - x0 = 0
   C. y0 = 0
   D. h = 0
   Answer: A. End second derivative is zero. (Key point: M0)

## Close variants set in other exams

- [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×

## Related in Numerical Method

- [Natural cubic spline: y(8)](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Aspline-find-y-8) — Numerical Method, chapter 4
- [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
- [MapReduce data flow technique](https://www.bctengineer.com/question.md?key=semester_8%2Fbig_data_technologies%3Amapreduce-data-flow) — Big Data Technologies, chapter 3
