[Math] Why do we choose cubic polynomials when we make a spline

cubicsinterpolationpolynomialsspline

Good morning,

I want to learn more about cubic splines but unfortunately my class goes pretty quickly and we really only get the high level overview of why they're important and why they work.

To me it's clear why we dont use linear functions, we cant differentiate the spline at the points we have to interpolate. Due to this, we lose important information about the underlying function.

But now this is where it gets harder for me. I know we can't use hermite polynomials because we require the derivative and many times we dont have this information available to us.

So we could use quadratic polynomials between each point to approximate it so its smooth on the points and we can differentiate it. The book goes on to state

The difficulty arises because we generally need to specify conditions about the derivative of the interpolant at the endpoints $x_0$ and $x_n$. [In quadratic polynomials] there is not sufficient number of constants to ensure that condition will be satisfied.

How does the number of constant bear anything on the endpoint constraints? A quadratic polynomial is twice differentiable. Can anyone fill me in on gap I have here in my knowledge of why we need cubic splines?

thank you!

Best Answer

A quadratic polynomial $y=ax^2+bx+c$ has only three "degrees of freedom" ($a,b,c$). Thus if you want your quadratic function to run through two points, you have already only one degree of freedom left. If you want to prescribe the slope at one of the two points, this already uses up the last degree of freedom, thus leaving no choice for the slope at the other end, for example. A cubic polynomial $y=ax^3+bx^2+cx+d$ has four degrees of freedom, thus allowing to prescribe a total of four conditions, such as passing through two points and having specific slopes at two points.

Admittedly, with splines the situation is different - but only slightly: We may view both $x$ and $y$ as cubic functions of a parameter $t$, and what we want is indeed not just the directions to match (with neighbouring spline segments, say) at the endpoints, but in fact also the "speed", so the parametrization cannot be ignored. Thus we want a total of 8 conditions to hold ($x$ at $t=0$, $y$ at $t=0$, $x$ at $t=1$, $y$ at $t=1$ and the same for the derivatives with respect to $t$).

Maybe the most instructive argument is to really join a few quadratic splines that match only in endpoints and tangent directions. The sudden change in curvature is noticeable (either by the eye or by the passenger of a rollercoaster constructed this way). - As an extreme example: you cannot join ends with a single quadratic spline if they point in opposite directions (i.e. if you need a point of inflexion)