---
tag: T53N88Y21J
kind: statement
role: theorem
name: Monotone cubic interpolation
msc: [65D05, 65D07, 41A05]
uses: [HCQWPAHYAT, 0A7KV2WB7A, SS1YMS2NPC]
about: [HCQWPAHYAT]
sources:
  - url: https://en.wikipedia.org/wiki/Monotone_cubic_interpolation
same_as:
  wikidata: Q4044484
  wikipedia: Monotone cubic interpolation
---

## Statement

Let $x_0 < x_1$, let $y_0, y_1 \in \R$ with $y_0 \ne y_1$, and let $m_0, m_1 \in \R$.
Let $p$ be the [[cubic Hermite interpolant|HCQWPAHYAT]] on $[x_0, x_1]$ with $p(x_i) = y_i$ and $p'(x_i) = m_i$ for $i = 0, 1$.
Let $\Delta = (y_1 - y_0)/(x_1 - x_0)$, $\alpha = m_0/\Delta$ and $\beta = m_1/\Delta$.

1. If $p$ is [[monotone|0A7KV2WB7A]] on $[x_0, x_1]$, then $\alpha \ge 0$ and $\beta \ge 0$.
2. If $0 \le \alpha \le 3$ and $0 \le \beta \le 3$, then $p$ is monotone on $[x_0, x_1]$.

In particular, let $x_0 < \cdots < x_n$ and $y_0 \le \cdots \le y_n$, with slopes $m_0, \dots, m_n$.
On each interval $[x_k, x_{k+1}]$ assume that either $y_k = y_{k+1}$ and $m_k = m_{k+1} = 0$, or the ratios $\alpha_k, \beta_k$ lie in $[0, 3]$.
Then the piecewise cubic Hermite interpolant is non-decreasing on $[x_0, x_n]$.

## Remarks

With $h = x_1 - x_0$ and $t = (x - x_0)/h$, the derivative is
$$\frac{p'(x)}{\Delta} = \alpha (1 - t)(1 - 3t) + \beta \, t (3t - 2) + 6 t (1 - t).$$
At $t = 0$ and $t = 1$ this gives $\alpha$ and $\beta$, which proves part 1.
For fixed $t$, the right side is affine in $(\alpha, \beta)$, so its minimum over the square $[0, 3]^2$ is at a corner.
At the four corners it equals $6t(1 - t)$, $3(1 - t)^2$, $3t^2$ and $3(1 - 2t)^2$, all non-negative, which proves part 2.

The Fritsch–Carlson method (1980) uses this to make a monotone $C^1$ interpolant.
It starts from some slope estimates and sets $m_k = m_{k+1} = 0$ on flat intervals.
Where $\alpha_k^2 + \beta_k^2 > 9$, it multiplies both slopes by $3/\sqrt{\alpha_k^2 + \beta_k^2}$, which moves $(\alpha_k, \beta_k)$ into the disc of radius $3$, a subset of the square.
Without such a limiter, a cubic spline through monotone data can overshoot: for data $0, 0, 1, 1$ at $x = 0, 1, 2, 3$, the natural cubic spline dips below $0$ on $(0, 1)$.
Example: for $y = 0, 1$ on $[0, 1]$ with $m_0 = m_1 = 3$, one has $\alpha = \beta = 3$ and $p(x) = 3x - 6x^2 + 4x^3$.
Then $p'(x) = 3(1 - 2x)^2 \ge 0$, so $p$ is monotone, with a flat point at $x = 1/2$.

## Explanations

### L1 human

Smooth curves through increasing data points can still wiggle down between points, which is bad for data such as cumulative totals or concentrations.
This theorem says how steep the curve may be at the data points without causing such wiggles.
If the slopes at both ends of an interval are between $0$ and $3$ times the slope of the straight line between the points, the curve stays monotone.

### L2 human

The condition is sufficient, and the exact region of monotone $(\alpha, \beta)$ found by Fritsch and Carlson is larger than the square.
Monotone interpolation trades some smoothness for shape preservation: the result is $C^1$ but in general not $C^2$, unlike a cubic spline.
It is the basis of the PCHIP routine in many numerical libraries and of shape-preserving interpolation more generally.
