Back to the on-screen lesson ·
Keeping the degree at three and adding pieces instead, counting the conditions that join them, and the end conditions that finish the system.
Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.
By the end of this lesson you will be able to count the unknowns and conditions of a spline, name the kinds of spline by their smoothness and end conditions, evaluate a linear spline, and say what refining the data buys for a cubic spline that it does not buy for a single high-degree interpolant.
You know that a single interpolating polynomial through many equally spaced points can oscillate badly, and that its error bound carries a high derivative you cannot control. This lesson answers that by refusing to raise the degree at all.
A spline is a piecewise polynomial whose pieces join smoothly. Its knots or joins are the points where the pieces meet. A cubic spline is natural when the second derivative is set to zero at both ends and clamped when the first derivative is imposed there. The spacing $h$ is the width of a piece.
Instead of one polynomial of degree $n-1$ through $n$ points, use many polynomials of low degree, one per interval, joined so that the joins are invisible. A cubic spline uses cubics and asks for matching value, first derivative and second derivative at every interior join. The count is exact and worth doing once: $n$ intervals give $4n$ unknown coefficients; hitting the data at both ends of each piece gives $2n$ conditions; matching first and second derivatives at the $n-1$ interior joins gives $2(n-1)$ more; total $4n - 2$. Two conditions short, which is why every cubic spline needs an end condition at each end and why there is more than one kind. The resulting system is tridiagonal, so a spline through a thousand points costs work proportional to a thousand. The payoff is the error: a cubic spline's error is proportional to $h^{4}$, so refining the data improves it predictably, with no high derivative and no node polynomial in sight. That is the whole trade — a guaranteed, modest rate in place of a rate that depends on the function and may be negative.
Another way: picture
A draughtsman's spline is a thin flexible strip held down by weights at the data points. It bends as little as it can between them, which is exactly what minimising the integral of the squared second derivative means — and beyond the outermost weights it straightens out, which is the natural end condition.
Another way: steps
Natural sounds like the default and the best. It is neither: it is the choice that sets the curvature to zero at the two ends, which is a genuine assumption about the function and is usually wrong. Where the end slopes are known, the clamped spline is the better construction, and the difference shows up exactly where the natural spline's assumption bites — in the first and last intervals.
Three cubics give twelve unknown coefficients.
Four per piece.
Six data conditions, two derivative matches at each of the two interior joins: ten in all.
Two short of twelve.
So two end conditions finish it: zero curvature at both ends for a natural spline.
Now the system is square.
A linear spline never leaves the range of its data and never oscillates.
Error proportional to $h^{2}$.
A cubic spline is smooth and has error proportional to $h^{4}$, but may overshoot the data slightly between points.
Smoothness costs monotonicity.
Where the data is known to be monotone and that matters more than smoothness, the linear one is the honest choice.
Choose by what must be preserved.
Five quadratics give fifteen coefficients.
Three per piece.
Ten data conditions and four first-derivative matches at the interior joins make fourteen.
So one end condition is needed, not two.
A cubic spline is built on $4$ intervals, so there are $5$ data points and $3$ interior joins. Fill in the count of unknowns and of conditions.
| How many | |
|---|---|
| Unknown coefficients | |
| Data conditions | |
| First-derivative matches | |
| Second-derivative matches | |
| End conditions still needed |
There are $12$ data points. Why would a cubic spline usually be preferred to the single interpolating polynomial of degree $11$?
Four splines are built on the same $4$ intervals. Match each to what defines it.
| Continuous, with a corner permitted at every node | Slopes match at the joins, but the curvature may jump | Curvature matches, and is set to zero at both ends | Curvature matches, and the slope is imposed at both ends | |
|---|---|---|---|---|
| The linear spline | ||||
| The quadratic spline | ||||
| The natural cubic spline | ||||
| The clamped cubic spline |
Put the five steps of constructing a cubic spline on $8$ intervals into order.
Number the steps in order (write the number in the box):
A cubic spline's error is proportional to the fourth power of the spacing. The spacing is halved $3$ times. By what factor does the error bound fall?
Answer:
Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.
A linear spline interpolates $(0, 5)$, $(1, 11)$ and $(2, 25)$. Give its value at $x = \tfrac12$ and at $x = \tfrac32$, as fractions where they are not whole numbers.
At $x = \tfrac12$ the value is first and at $x = \tfrac32$ it is second
You can count a spline's conditions, evaluate a linear spline and state the order of a cubic spline's error. Say in your own words why a cubic spline needs exactly two end conditions.
8. Your turn: how many end conditions does a quadratic spline on five intervals need?, step 3