I need to determine which of the properties of a natural cubic spline the following function possesses or does not possess:

$$f(x) = \begin{cases} (x+1)+(x+1)^{3}, & x \in [-1,0] \\ 4+(x-1)+(x-1)^{3}, & x \in (0,1] \end{cases}.$$

However, this function is extremely weird in the sense that I have never seen a spline-like function with one of its intervals only half-open.

I'm thinking that this creates a problem in terms of continuity, because technically, the second piece of the function is not defined at $x=0$, so even though if we plug $x=0$ into that piece, we get the same output as we do from plugging it into the first piece, I'm thinking it's most definitely going to fail continuity at $x=0$. (Moreover, I don't think it would be any different at $f^{\prime}(0)$ or $f^{\prime\prime}(0)$, would it?)

Although, I could be overthinking this problem, or it could be a typo in my textbook. For reference, this is problem 18 in Section 6.4 of Numerical Analysis: Mathematics of Scientific Computing (3$^{\text{rd}}$ edition) by Kincaid and Cheney.

Could somebody please let me know if the half-open interval is a problem?

Thank you.

  • $\begingroup$ You can just plug in 0 to see that it is indeed continuous. $\endgroup$ – Matt Samuel Dec 18 '15 at 8:23

Well the function is a piecewise polynomial, and both pieces have degree 3, so that's a start.

Next, I guess you're supposed to check that the function has a continuous second derivative at $x=0$, and it's second derivatives at $x=-1$ and $x=1$ are both zero.

The use of a half-open interval seems like an insignificant technicality, to me, and is not relevant to what the problem is trying to teach you. In the Wikipedia article, the first example of a spline function uses a half-open interval, so its definitely not unusual. Some people consider non-continuous functions to be splines, and in that case you have no alternative but to use half-open intervals in defining them.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.