# Cubic splines with endpoint conditions in only one endpoint?

It seems that when using cubic splines the most common thing to do is to specify that the first (or second) derivatives at the left and rightmost points equal prescribed numbers.

I have never seen anyone imposing a condition on the first and second derivative in one of these points. This would still yield the same number of equations as unknowns and I guess unless one is unlucky this would still yield a non-zero determinant.

Or am I missing something obvious?

## 2 Answers

Taking out as many degrees of freedom as possible, suppose we want to interpolate from $(0,0)$ to $(1,j)$ with the first and second derivatives at the origin being $k$ and $l$ respectively. Then if the the cubic spline is $$f(x)=ax^3+bx^2+cx$$ so that $f'(x)=3ax^2+2bx+c$ and $f''(x)=6ax+2b$, the following equations are satisfied: $$f(1)=j:a+b+c=j$$ $$f'(0)=k:c=k$$ $$f''(0)=l:2b=l$$ Thus we have the simple expressions $a=j-\frac l2-k$, $b=\frac l2$, $c=k$ that uniquely determine $f$ for every choice of $j,k,l$. It is entirely possible to fit a unique cubic spline between two points given first and second derivative information at one point, provided that the other point is unconstrained.

You are not missing anything. Theoretically, you can impose first/2nd derivative at any point. But traditionally, we only impose first or 2nd derivative at the end points simply because

• we would like the interpolation to produce the same result even when the point order is reversed, and
• we need to impose first or 2nd derivative at end points to make the spline "connect" to other curves with tangent or curvature continuity (e.g.: creating a transitional curve between two curves).