Two endpoint values determine a line. If endpoint slopes are also known, the line generally cannot match all four pieces of information. A cubic has four coefficients, so it is a natural candidate. Cubic Hermite interpolation uses these value-and-slope data on one interval. It is useful for building a smooth curve from local data, but a smooth interpolant need not preserve monotonicity or stay between its endpoint values.
Throughout let , , and let be real data. The variable maps to . We use exact arithmetic and, when estimating error against a function, assume that the stated derivatives are continuous on the closed interval.
Four data require four basis functions
Definition 7.5.1
(Hermite basis functions)
Define
The first index distinguishes value from slope; the second identifies the left or right endpoint.
For example, , and , where the prime here means differentiation with respect to .
Theorem 7.5.2
(Existence and uniqueness of the cubic interpolant)
The unique polynomial of degree at most three with
is
Proof
(Substitution and double zeros)
Direct substitution verifies that supplies value one at and zero for the other three endpoint data; the other basis functions similarly supply one datum each. Since , multiplying slope terms by converts their -derivatives into the requested -derivatives. Thus (2) satisfies all four conditions.
For uniqueness, subtract two candidates. Their difference and vanish at both and . Consequently divides . That polynomial has degree four, so a polynomial of degree at most three with this property is identically zero. The explicit basis formula proves existence separately; merely counting four equations and four unknowns would not rule out dependent equations.
Common mistake
(Forgetting the factor on the slopes)
The factor in the slope terms of (2) is not optional. For example, on , a derivative of with respect to corresponds to a derivative of with respect to . Using in place of produces an interpolant whose slope at is instead of .
Worked example 7.5.3
(Slope data on a longer interval)
On take , , , so . Formula (2) gives with . At , and . The slope at is , and , because the factor vanishes together with its first derivative at . All four conditions hold.
A fourth-derivative error formula
Theorem 7.5.4
(Pointwise remainder and a uniform bound)
Let and use the exact data , , , in (2). For every there is a point such that
At the error is zero. If , then
The constant cannot be lowered for this class.
Proof
(Rolle's theorem with double endpoint zeros)
Fix and write . Put and . Then and . Rolle's theorem gives one zero of in each of and , in addition to the endpoint zeros. Applying Rolle three more times yields a zero of . Since and , this proves (3).
On the interval, , so (4) follows. For sharpness, take . All four endpoint data vanish, hence ; and so . At the midpoint the error is , attaining (4).
Proof X-ray
Counting zeros with multiplicity
The slope data enter the proof at one place: they give the two extra zeros . Together with the two zeros that Rolle's theorem gives inside and , has four distinct zeros, and three more applications of Rolle's theorem leave one zero of . With value data alone, would have only the three zeros , and the same count would reach only . The squared factors in record exactly these double zeros, and the sharpness example is the function for which equality holds in (4).
The point may depend on . Formula (3) does not by itself give a single common point for an integral of the error, and (4) says nothing about inaccuracies already present in .
Worked example 7.5.5
(Interpolation of the exponential)
On , take . The endpoint values are and the endpoint slopes are also . Formula (2) gives
At , , while . Since , the error bound is . The observed error is smaller; the bound is not a prediction of exact error.
Worked example 7.5.6
(A cubic is reproduced exactly)
Let on , so the data are , , , and . Formula (2) gives . This is the edge case : since , (4) forces zero error, and indeed . It also follows from uniqueness, because itself is a cubic satisfying all four conditions.
Quick check
(On , interpolate . Identify .)
Solution · Answer
: it satisfies all four data, and uniqueness applies.
Quick check
(If on an interval of length , give the bound (4).)
Solution · Answer
.
What inaccurate slopes do
Suppose two data sets differ by , and let be the difference of their interpolants.
Proposition 7.5.7
(Sensitivity to errors in values and slopes)
On ,
The slope coefficient is sharp.
Proof
(Signs of the basis functions)
On , and , while and . The value terms therefore form a weighted average of , bounded by their maximum. For the slope terms , and the slope terms carry the factor . For sharpness choose zero value errors and slope errors : then , which equals at .
Combining (4) and (5) separates approximation error from error in measured or computed data. It does not include floating-point rounding incurred while evaluating (2).
Common mistake
(Reading the error bound as a bound on data errors)
The bound (4) assumes that the supplied values and slopes are exactly those of . If the slopes come from measurements or from a finite-difference formula, (4) says nothing about their inaccuracy; (5) shows that an error in a slope is scaled by in the interpolant. Both terms belong in an honest error budget.
Quick check
(If each endpoint value has error at most and each slope has error at most on an interval of length , bound .)
Solution · Answer
Equation (5) gives .
Counterexample mode
Endpoint values do not prevent overshoot
Claim: if both endpoint values are zero, the interpolant stays between zero and the values at the endpoints. On , set , , . The interpolant is and reaches at , although both endpoint values are zero. Matching slopes may be desirable, but neither monotonicity nor range preservation follows from interpolation alone.
Quick check
(On , interpolate , , . Find the maximum of .)
Solution · Answer
, with maximum at .
If neighboring intervals share the same prescribed value and the same prescribed slope at their common node, their cubics join to give a piecewise cubic. Their second derivatives can disagree. Natural cubic splines impose a global condition and endpoint curvature conditions instead; simply stitching prescribed Hermite slopes does not automatically produce a natural spline.
Quick check
(Is an endpoint value match alone enough to make two neighboring cubic pieces ? Give an example.)
Solution · Answer
No. On take ; on take . They agree at zero but their one-sided derivatives there are and .
Practice and solutions
Exercise 7.5.8
(On the data are , , , . Find and its maximum on .)
Core
Solution(3)
- 1
Substitute into formula (2)
Key step
Because: With only the terms with nonzero data survive.
- 2
Check the four conditions
, , so and . All four data are matched.
- 3
Locate the maximum
vanishes at with . So the maximum of on is , attained at , although both endpoint values are zero.