Solution (source code)

= Solution

A <natural cubic spline> with the given <knots> is a $C^2$ function that is <polynomial> of <degree> at most three on each <interval> between consecutive <knots> and has $S''(x_0)=S''(x_4)=0$. With the usual whole-line convention, it extends affinely outside the extreme <knots>. The word natural refers to these endpoint second-derivative conditions; the <interpolation> values must be specified separately.

For $H_k(x)=(x-x_k)^3_+$, direct differentiation on either side of the <knot> gives
$$
H_k'(x)=3(x-x_k)^2_+,\qquad H_k''(x)=6(x-x_k)_+.
$$
Both one-sided limits of the function and its first two <derivatives> at $x_k$ are zero, so these formulas are <continuous> there and
$$
\boxed{H_k\in C^2(\mathbb R).}
$$
Its third <derivative> jumps from zero to six, which is permitted for a <cubic spline>.