Ex. 5.1
Ex. 5.1
Show that the truncated power basis functions in (5.3) in the textbook represent a basis for a cubic spline with the two knots as indicated.
Soln. 5.1
Let
\[\begin{equation}
f(x) = \sum_{i=1}^6\beta_ih_i(x),\non
\end{equation}\]
where \(\beta_i, i=1,...,6\) are constants and
\[\begin{eqnarray}
&&h_1(x) = 1, \ h_3(x) = x^2, \ h_5(x) = (x-\xi_1)_{+}^3,\non\\
&&h_2(x) = x, \ h_4(x) = x^3, \ h_6(x) = (x-\xi_2)_{+}^3,\non
\end{eqnarray}\]
and \(\xi_1,\xi_2\) are constants.
We need to show that \(f(x)\) is continuous and has continuous first and second derivatives at \(\xi_1\) and \(\xi_2\) (by choosing appropriate \(\beta_i\)). Let's rewrite
\[\begin{equation}
f(x) = \begin{cases}
\beta_1 + \beta_2x + \beta_3x^2 + \beta_4x^3, & \text{if } x \le \xi_1\\
\beta_1 + \beta_2x + \beta_3x^2 + \beta_4x^3 + \beta_5(x-\xi_1)^3, & \text{if } \xi_1 < x < \xi_2\\
\beta_1 + \beta_2x + \beta_3x^2 + \beta_4x^3 + \beta_5(x-\xi_1)^3 + \beta_6(x-\xi_2)^3, & \text{if } x \ge \xi_2.\non
\end{cases}
\end{equation}\]
For \(\xi_1\), it's easy to see that
\[\begin{equation}
f'_{-}(\xi_1) = \lim_{h\ra 0^{-}}\frac{f(x+h)-f(x)}{h} = \beta_2 + 2\beta_3\xi_1 + 3\beta_4\xi_1^2\non
\end{equation}\]
and
\[\begin{equation}
f'_{+}(\xi_1) = \lim_{h\ra 0^{+}}\frac{f(x+h)-f(x)}{h} = \beta_2 + 2\beta_3\xi_1 + 3\beta_4\xi_1^2 + 0\non
\end{equation}\]
so that the left-hand derivative at \(\xi_1\) equals its right-hand derivative and thus \(f'\) is continuous at \(\xi_1\). Similarly, we have
\[\begin{equation}
f''_{-}(\xi_1) = \lim_{h\ra 0^{-}}\frac{f'(x+h)-f'(x)}{h} = 2\beta_3 + 6\beta_4\xi_1\non
\end{equation}\]
and
\[\begin{equation}
f''_{+}(\xi_1) = \lim_{h\ra 0^{+}}\frac{f'(x+h)-f'(x)}{h} = 2\beta_3 + 6\beta_4\xi_1 + 0,\non
\end{equation}\]
and thus \(f''\) is continuous at \(\xi_1\). Similar arguments apply to \(\xi_2\). Therefore, it is easy to see that \(f(x)\) is continuous and has continuous first and second derivatives for \(x\in\mathbb{R}\).