18 Polynomial and Spline Interpolation
Suppose a function is known only through measured or computed values at a few points. To estimate a value between those points, we can construct a simpler function that agrees with the available values. Interpolation imposes exact agreement at the data points. It differs from least squares, which permits a nonzero residual there.
Two distinct points determine a line. We ask whether \(n+1\) distinct points similarly determine a polynomial of degree at most \(n\), how to evaluate it, and how far it can lie from the function that supplied the data. When a single polynomial is unsuitable, we use a different cubic polynomial on each subinterval and join the pieces smoothly.
18.1 Existence, Uniqueness, and the Vandermonde Matrix
Let \(x_0, x_1, ..., x_n\) be \(n+1\) pairwise distinct real numbers, and let \(y_0, y_1, ..., y_n\) be arbitrary real numbers. There exists a unique polynomial \(P_n \in \mathcal{P}_n\) of degree at most \(n\) such that \(P_n(x_i) = y_i\) for all \(i = 0, 1, ..., n\).
We first prove that two candidate interpolants cannot differ. Suppose \(P_n(x_i)=Q_n(x_i)=y_i\) for every node. Their difference \(R=P_n-Q_n\) has degree at most \(n\) and vanishes at all \(n+1\) distinct nodes. A nonzero polynomial of degree at most \(n\) has at most \(n\) distinct roots. Hence \(R\) must be the zero polynomial, so \(P_n=Q_n\).
This proves at most one interpolant exists. To prove that one actually exists for arbitrary data, write \[ \begin{align} P_n(x)=c_0+c_1x+\cdots+c_nx^n. \end{align} \] The interpolation condition at node \(x_i\) is \(\sum_{j=0}^nc_jx_i^j=y_i\). These \(n+1\) equations form a square system \(\bV\bc=\by\), where row \(i\) of \(\bV\) is \((1,x_i,...,x_i^n)\).
Suppose \(\bV\bc=\bzero\). Then the polynomial with coefficients \(\bc\) vanishes at every node. By the same root-count argument it is the zero polynomial, meaning every \(c_j\) is zero. Thus \(\bV\) has a trivial null space. Rank–nullity makes its rank \(n+1\), so its range is all of \(\fR^{n+1}\). It therefore has a solution for every data vector \(\by\).
The coefficients of that solution define an interpolating polynomial, proving existence. The uniqueness argument applies to every pair of such polynomials and completes the theorem. Distinctness of the nodes was essential to the root count.
Although the Vandermonde matrix provides a constructive proof of existence, solving \(\bV\bc=\by\) in the monomial basis is often a poor numerical representation. Its condition number depends on the nodes and their scaling and can grow rapidly with degree. A large coefficient error does not imply that the interpolation problem itself is ill-posed. It may instead reflect an ill-conditioned choice of basis. The Lagrange and barycentric forms avoid solving for monomial coefficients.
18.2 The Lagrange Form
The Lagrange formulation circumvents the ill-conditioned Vandermonde linear system by constructing a basis of polynomials tailored to the specific nodes \(x_i\).
Given \(n+1\) distinct nodes \(x_0, x_1, ..., x_n\), the \(i\)-th Lagrange basis polynomial \(L_i \in \mathcal{P}_n\) is defined by \[ \begin{align} L_i(x) = \prod_{\substack{j=0 \\ j \neq i}}^n \frac{x - x_j}{x_i - x_j} = \frac{(x - x_0)\cdots(x - x_{i-1})(x - x_{i+1})\cdots(x - x_n)}{(x_i - x_0)\cdots(x_i - x_{i-1})(x_i - x_{i+1})\cdots(x_i - x_n)}. \end{align} \] The Lagrange basis polynomials satisfy the cardinal Kronecker delta property: \[ \begin{align} L_i(x_j) = \delta_{ij} = \begin{cases} 1, & \text{if } i = j, \\ 0, & \text{if } i \neq j. \end{cases} \end{align} \] The interpolating polynomial in Lagrange form is \[ \begin{align} P_n(x) = \sum_{i=0}^n y_i L_i(x). \end{align} \]
Verify \(L_i(x_j)=\delta_{ij}\). Use uniqueness of interpolation to prove \(\sum_iL_i(x)=1\) and \(\sum_i x_iL_i(x)=x\) when \(n\geq1\). For the Vandermonde determinant, regard the last row as a polynomial in the last node. Identify its roots and leading coefficient, then complete an induction on the number of nodes.
For the data \((0,1)\), \((1,3)\), and \((3,2)\), construct the interpolant first by solving the Vandermonde system and then by constructing the three Lagrange polynomials. Verify agreement by comparing coefficients. Once the barycentric formula has been derived below, use it to evaluate the same polynomial at \(x=2\).
To interpolate the three data points \((-1, 1)\), \((0, 0)\), and \((1, 1)\), we construct the degree-2 Lagrange basis polynomials on \(x_0 = -1, x_1 = 0, x_2 = 1\): \[ \begin{align} L_0(x) &= \frac{(x - 0)(x - 1)}{(-1 - 0)(-1 - 1)} = \frac{x(x - 1)}{2} = \frac{x^2 - x}{2}, \\ L_1(x) &= \frac{(x - (-1))(x - 1)}{(0 - (-1))(0 - 1)} = \frac{(x + 1)(x - 1)}{-1} = 1 - x^2, \\ L_2(x) &= \frac{(x - (-1))(x - 0)}{(1 - (-1))(1 - 0)} = \frac{x(x + 1)}{2} = \frac{x^2 + x}{2}. \end{align} \] Multiplying by the data values \(y_0 = 1, y_1 = 0, y_2 = 1\) gives \[ \begin{align} P_2(x) = 1 \cdot \left(\frac{x^2 - x}{2}\right) + 0 \cdot (1 - x^2) + 1 \cdot \left(\frac{x^2 + x}{2}\right) = \frac{x^2 - x + x^2 + x}{2} = x^2. \end{align} \]
The standard Lagrange form has two practical shortcomings. First, evaluating \(P_n(x)\) at a single point \(x\) requires \(O(n^2)\) floating-point operations. Second, adding a new node \((x_{n+1}, y_{n+1})\) alters every single basis polynomial \(L_i(x)\), requiring a complete recomputation from scratch.
18.3 The Barycentric Interpolation Formula
The products in the Lagrange basis repeat much of the same work. Factoring out their common nodal polynomial gives a formula that costs \(O(n)\) operations per evaluation after the weights have been computed. Its sensitivity still depends on the nodes.
Let \(\ell(x) = \prod_{j=0}^n (x - x_j)\) denote the nodal polynomial. For each node \(x_i\), define the barycentric weights \[ \begin{align} w_i = \frac{1}{\prod_{j \neq i} (x_i - x_j)} = \frac{1}{\ell'(x_i)}, \qquad i = 0, 1, ..., n. \end{align} \] Then the interpolating polynomial satisfies:
First Barycentric Form: \[ \begin{align} P_n(x) = \ell(x) \sum_{i=0}^n \frac{w_i}{x - x_i} y_i. \end{align} \]
Second (True) Barycentric Form: \[ \begin{align} P_n(x) = \frac{\sum_{i=0}^n \frac{w_i}{x - x_i} y_i}{\sum_{i=0}^n \frac{w_i}{x - x_i}}. \end{align} \]
Both displayed formulas use division by \(x-x_i\) and are applied only away from the nodes. If \(x=x_j\), return \(y_j\) directly. The singularities in the formulas are removable, but should not be evaluated as divisions by zero.
Assume first that \(x\) is not any of the nodes. The nodal polynomial contains every factor \(x-x_j\). Removing the \(i\)th factor gives \[ \begin{align} \frac{\ell(x)}{x-x_i}=\prod_{j\neq i}(x-x_j). \end{align} \] Multiplication by the weight \(w_i=1/\prod_{j\neq i}(x_i-x_j)\) gives precisely \(L_i(x)\). Substitute into the Lagrange interpolant: \[ \begin{align} P_n(x)=\sum_i y_iL_i(x) =\ell(x)\sum_i\frac{w_i y_i}{x-x_i}. \end{align} \] This proves the first formula.
Now apply it to data \(y_i=1\) for every \(i\). The constant polynomial \(1\) interpolates those data. By uniqueness it is the interpolant, so \[ \begin{align} 1=\ell(x)\sum_i\frac{w_i}{x-x_i}. \end{align} \] Because \(x\) is away from the nodes, \(\ell(x)\neq0\), and the sum in this identity is \(1/\ell(x)\), also nonzero. Divide the first formula by this identity and cancel \(\ell(x)\). The resulting quotient is the second formula.
At \(x=x_j\), each displayed expression contains a division by zero and is not evaluated as written. In the second formula, multiply its numerator and denominator by \(x-x_j\) and let \(x\to x_j\). All other terms vanish in this limit, leaving \(w_jy_j/w_j=y_j\). The weight is nonzero because all nodes are distinct. Thus the singularity is removable and the direct prescription to return \(y_j\) is consistent.
Interpolate the data \(y_i=1\) to prove \(1=\ell(x)\sum_iw_i/(x-x_i)\). Divide the first formula by this identity to obtain the second. Why does multiplying every weight by the same nonzero constant leave the second formula unchanged? Take the limit as \(x\to x_j\) and verify that it recovers \(y_j\).
The two barycentric formulas have different rounding-error properties. The modified Lagrange (first barycentric) formula admits a backward-error analysis; the second formula has favorable forward-error bounds when the Lebesgue function is modest. Neither representation removes the sensitivity caused by poorly chosen nodes. Furthermore, common multiplicative factors in the weights \(w_i\) cancel out in the numerator and denominator, allowing simple analytical expressions for standard node families (such as Chebyshev nodes).
18.4 The Interpolation Error Formula
Exact agreement at the nodes says nothing by itself about the error between them. To estimate that error, we must assume something about the function beyond its sampled values. The following theorem assumes a bounded derivative of order \(n+1\). Its nodal factor vanishes at each data point, as the error must.
Let \(f \in C^{n+1}[a, b]\), and let \(P_n \in \mathcal{P}_n\) interpolate \(f\) at \(n+1\) distinct nodes \(x_0, x_1, ..., x_n \in [a, b]\). For each point \(x \in [a, b]\), there exists a point \(\xi_x \in (a, b)\) such that \[ \begin{align} f(x) - P_n(x) = \frac{f^{(n+1)}(\xi_x)}{(n+1)!} \prod_{j=0}^n (x - x_j) = \frac{f^{(n+1)}(\xi_x)}{(n+1)!} \omega_{n+1}(x), \end{align} \] where \(\omega_{n+1}(x) = \prod_{j=0}^n (x - x_j)\) is the nodal error polynomial.
If \(x = x_i\) for some node \(x_i\), both sides vanish and the formula holds trivially for any \(\xi_x\). This case must be separated before dividing by the nodal polynomial, because that polynomial is zero at every node.
Now fix \(x \in [a, b]\) with \(x \neq x_i\) for all \(i\). Define the constant \[ \begin{align} \lambda = \frac{f(x) - P_n(x)}{\omega_{n+1}(x)}, \end{align} \] and consider the auxiliary function \(g : [a, b] \to \fR\) defined by \[ \begin{align} g(t) = f(t) - P_n(t) - \lambda \omega_{n+1}(t). \end{align} \] Because \(f \in C^{n+1}[a, b]\) and polynomials are infinitely differentiable, \(g \in C^{n+1}[a, b]\). We evaluate \(g\) at the \(n+2\) distinct points \(x_0, x_1, ..., x_n\) and \(x\): \[ \begin{align} g(x_i) &= f(x_i) - P_n(x_i) - \lambda \omega_{n+1}(x_i) = y_i - y_i - 0 = 0, \qquad i = 0, ..., n, \\ g(x) &= f(x) - P_n(x) - \left( \frac{f(x) - P_n(x)}{\omega_{n+1}(x)} \right) \omega_{n+1}(x) = 0. \end{align} \] Thus \(g(t)\) vanishes at \(n+2\) distinct points in \([a, b]\).
The extra zero at the evaluation point is the reason for choosing \(\lambda\) in this way. The interpolation error alone has \(n+1\) known zeros. Subtracting the scaled nodal polynomial creates one additional zero while preserving all the original zeros.
By Rolle’s Theorem, between any two adjacent zeros of \(g(t)\), its derivative \(g'(t)\) has at least one zero. Therefore, \(g'(t)\) has at least \(n+1\) distinct zeros in \((a, b)\). Applying Rolle’s Theorem successively:
\(g''(t)\) has at least \(n\) distinct zeros in \((a, b)\),
\(g'''(t)\) has at least \(n-1\) distinct zeros in \((a, b)\),
Continuing inductively, \(g^{(n+1)}(t)\) has at least one zero in \((a, b)\), which we denote by \(\xi_x\).
We now differentiate \(g(t)\) exactly \(n+1\) times with respect to \(t\): \[ \begin{align} g^{(n+1)}(t) = f^{(n+1)}(t) - P_n^{(n+1)}(t) - \lambda \frac{d^{n+1}}{dt^{n+1}} [\omega_{n+1}(t)]. \end{align} \] Since \(P_n\) has degree at most \(n\), its \((n+1)\)-th derivative is identically zero: \(P_n^{(n+1)}(t) \equiv 0\). The nodal polynomial \(\omega_{n+1}(t) = t^{n+1} + ...\) is a monic polynomial of degree \(n+1\), so its \((n+1)\)-th derivative is \((n+1)!\). Evaluating at \(t = \xi_x\) gives \[ \begin{align} 0 = g^{(n+1)}(\xi_x) = f^{(n+1)}(\xi_x) - 0 - \lambda (n+1)!. \end{align} \] Solving for \(\lambda\) produces \[ \begin{align} \lambda = \frac{f^{(n+1)}(\xi_x)}{(n+1)!}. \end{align} \] Equating this to our definition of \(\lambda = (f(x) - P_n(x)) / \omega_{n+1}(x)\) completes the proof.
The point supplied by repeated Rolle arguments depends on the chosen evaluation point \(x\). There is no assertion that a single \(\xi\) works for every \(x\) in the interval. The differentiability assumption is used exactly when Rolle’s theorem is repeated through order \(n+1\).
18.5 Runge’s Phenomenon and Chebyshev Nodes
The error bound contains two decoupled components: \[ \begin{align} \|f - P_n\|_\infty \leq \frac{\|f^{(n+1)}\|_\infty}{(n+1)!} \|\omega_{n+1}\|_\infty. \end{align} \] The derivative term \(\|f^{(n+1)}\|_\infty\) depends entirely on the analytical smoothness of \(f\), while \(\|\omega_{n+1}\|_\infty = \max_{x \in [a, b]} |\prod_{j=0}^n (x - x_j)|\) depends exclusively on the geometric placement of the interpolation nodes.
(Runge phenomenon) Analyticity alone does not make equally spaced interpolation converge. For Runge’s function \(f(x)=1/(1+25x^2)\), the interpolants on equally spaced nodes develop increasing endpoint oscillations and satisfy \[ \begin{align} \lim_{n \to \infty} \|f - P_n\|_\infty = \infty, \end{align} \] even though \(f\) is analytic on the real interval. The growing Lebesgue constant amplifies the approximation error, while the nearby complex poles at \(\pm i/5\) limit the rate of polynomial approximation. The derivative remainder bound above warns that convergence is not automatic, but a divergent upper bound by itself would not prove divergence.
The nodal factor can be made small by placing the nodes well. On \([-1,1]\), the best choice is the set of Chebyshev points \(x_k=\cos\big((2k+1)\pi/(2n+2)\big)\), \(k=0,...,n\), the roots of the Chebyshev polynomial \(T_{n+1}\). For these nodes \(\|\omega_{n+1}\|_\infty=2^{-n}\), the smallest value attained by any monic polynomial of degree \(n+1\). the referenced section proves this minimax property and shows that interpolation at Chebyshev points converges geometrically for functions that are analytic in a neighborhood of \([-1,1]\).
The Lebesgue constant \(\Lambda_n = \max_{x \in [a, b]} \sum_{i=0}^n |L_i(x)|\) bounds the stability of polynomial interpolation: \(\|f - P_n\|_\infty \leq (1 + \Lambda_n) \min_{Q \in \mathcal{P}_n} \|f - Q\|_\infty\).
For equally spaced nodes, \(\Lambda_n = \Theta\left(\frac{2^n}{n \log n}\right)\) grows exponentially.
For Chebyshev nodes, \(\Lambda_n = \frac{2}{\pi} \log(n+1) + O(1)\) grows only logarithmically, remaining near-optimal.
18.6 Piecewise Polynomials: Cubic Splines
A single polynomial makes every coefficient depend on all the data. An alternative is to use a polynomial of low degree on each interval between consecutive nodes. Continuity of derivatives at the joins prevents corners. Cubic splines impose continuity through the second derivative, leaving two additional boundary conditions to specify.
Given \(n+1\) distinct points \(a = x_0 < x_1 < ... < x_n = b\) and values \(y_0, y_1, ..., y_n\), a cubic spline \(S(x)\) is a function such that:
On each subinterval \([x_i, x_{i+1}]\), \(S(x) = S_i(x)\) is a cubic polynomial: \[ \begin{align} S_i(x) = a_i + b_i(x - x_i) + c_i(x - x_i)^2 + d_i(x - x_i)^3, \qquad i = 0, ..., n-1. \end{align} \]
Interpolation conditions: \(S(x_i) = y_i\) for all \(i = 0, ..., n\).
\(C^2\) continuity: \(S(x)\), \(S'(x)\), and \(S''(x)\) are continuous on the entire interval \([a, b]\).
Let \(h_i = x_{i+1} - x_i\) and let \(M_i = S''(x_i)\) denote the second derivative of the spline at node \(x_i\). The condition that \(S'(x)\) is continuous at each interior node \(x_i\) (\(i = 1, ..., n-1\)) leads to the linear system \[ \begin{align} h_{i-1} M_{i-1} + 2(h_{i-1} + h_i) M_i + h_i M_{i+1} = 6 \left( \frac{y_{i+1} - y_i}{h_i} - \frac{y_i - y_{i-1}}{h_{i-1}} \right). \end{align} \] To close the system of \(n-1\) equations in \(n+1\) unknowns, two boundary conditions are imposed:
Natural (Free) Spline: \(M_0 = M_n = 0\).
Clamped (Complete) Spline: \(S'(x_0) = f'(a)\) and \(S'(x_n) = f'(b)\).
Periodic Spline: Require \(y_0=y_n\) and impose \(S'(x_0)=S'(x_n)\) and \(M_0=M_n\).
For natural conditions, eliminate the prescribed endpoint values \(M_0=M_n=0\). The resulting interior system is strictly diagonally dominant and symmetric positive definite. For clamped conditions, the endpoint equations obtained from the prescribed first derivatives give the same properties. It can be solved in \(O(n)\) time using the Thomas algorithm.
Since \(S_i(x)\) is a cubic polynomial on \([x_i, x_{i+1}]\), its second derivative \(S_i''(x)\) is a linear function interpolating \(M_i = S''(x_i)\) and \(M_{i+1} = S''(x_{i+1})\): \[ \begin{align} S_i''(x) = M_i \frac{x_{i+1} - x}{h_i} + M_{i+1} \frac{x - x_i}{h_i}. \end{align} \] The formula for the second derivative is the unique line taking values \(M_i\) and \(M_{i+1}\) at the two endpoints. It is therefore convenient to integrate it before imposing the function values.
Integrating twice with respect to \(x\) gives \[ \begin{align} S_i(x) = \frac{M_i (x_{i+1} - x)^3}{6 h_i} + \frac{M_{i+1} (x - x_i)^3}{6 h_i} + C_i (x_{i+1} - x) + D_i (x - x_i). \end{align} \] Applying the interpolation conditions \(S_i(x_i) = y_i\) and \(S_i(x_{i+1}) = y_{i+1}\) determines the constants \(C_i\) and \(D_i\): \[ \begin{align} C_i = \frac{y_i}{h_i} - \frac{M_i h_i}{6}, \qquad D_i = \frac{y_{i+1}}{h_i} - \frac{M_{i+1} h_i}{6}. \end{align} \] Differentiating \(S_i(x)\) to obtain \(S_i'(x)\) and evaluating at the endpoints of \([x_i, x_{i+1}]\) yields \[ \begin{align} S_i'(x_i) &= -\frac{M_i h_i}{3} - \frac{M_{i+1} h_i}{6} + \frac{y_{i+1} - y_i}{h_i}, \\ S_{i-1}'(x_i) &= \frac{M_{i-1} h_{i-1}}{6} + \frac{M_i h_{i-1}}{3} + \frac{y_i - y_{i-1}}{h_{i-1}}. \end{align} \] Each interior knot has two candidate first derivatives, one from the interval on its left and one from the interval on its right. The function and second derivative already agree there by construction. Only equality of these first derivatives remains to impose.
Equating \(S_{i-1}'(x_i) = S_i'(x_i)\) for continuity of the first derivative and gathering terms produces the stated tridiagonal equation. Strict diagonal dominance follows from \(2(h_{i-1} + h_i) > h_{i-1} + h_i\), which gives nonsingularity. Symmetry, positive diagonal entries, and strict diagonal dominance give positive definiteness, so tridiagonal Cholesky can be used.
For natural boundary conditions, eliminating \(M_0\) and \(M_n\) leaves the interior tridiagonal system. The off-diagonal entry between equations \(i\) and \(i+1\) is \(h_i\) in both positions, proving symmetry. In each row, the positive diagonal \(2(h_{i-1}+h_i)\) exceeds the sum of remaining off-diagonal magnitudes. Every eigenvalue is therefore positive by the symmetric diagonal-dominance bound. This also proves uniqueness of the natural spline coefficients. Clamped endpoint equations arise by setting the displayed endpoint derivative formulas equal to the prescribed slopes.
Set up the \(2\times2\) system for the natural cubic spline through the data \[ \begin{align} (0,0),\qquad(1,1),\qquad(2,0),\qquad(3,1). \end{align} \] Solve for \(M_1\) and \(M_2\), and write down the explicit cubic polynomial for each subinterval.
Let \(S(x)\) be the natural cubic spline interpolating \(f(x)\) at \(x_0, x_1, ..., x_n\). Let \(g \in C^2[a, b]\) be any other function satisfying \(g(x_i) = y_i\) for all \(i = 0, ..., n\). Then \[ \begin{align} \int_a^b [S''(x)]^2\,dx \leq \int_a^b [g''(x)]^2\,dx. \end{align} \] Natural cubic splines are the smoothest possible interpolants in the sense of minimizing total bending energy.
Let \(h(x) = g(x) - S(x)\). Since both \(g\) and \(S\) interpolate \(f\) at the knots \(x_0, x_1, ..., x_n\), we have \[ \begin{align} h(x_i) = g(x_i) - S(x_i) = y_i - y_i = 0, \qquad i = 0, 1, ..., n. \end{align} \] Expanding the squared second derivative of \(g = S + h\): \[ \begin{align} \int_a^b [g''(x)]^2\,dx &= \int_a^b [S''(x) + h''(x)]^2\,dx \\ &= \int_a^b [S''(x)]^2\,dx + 2\int_a^b S''(x)h''(x)\,dx + \int_a^b [h''(x)]^2\,dx. \end{align} \] If the cross term is zero, the final term is a square integral and can only increase the energy. We therefore calculate that cross term rather than attempting to compare the two energies directly.
We evaluate the cross term by integrating by parts on each subinterval \([x_i, x_{i+1}]\): \[ \begin{align} \int_{x_i}^{x_{i+1}} S''(x)h''(x)\,dx &= \left[ S''(x) h'(x) \right]_{x_i}^{x_{i+1}} - \int_{x_i}^{x_{i+1}} S'''(x) h'(x)\,dx. \end{align} \] Because \(S(x)\) is a cubic polynomial on \([x_i, x_{i+1}]\), its third derivative \(S_i'''(x)\) is constant on \((x_i, x_{i+1})\). Let \(S_i'''(x) = c_i\). Then \[ \begin{align} \int_{x_i}^{x_{i+1}} S'''(x) h'(x)\,dx &= c_i \int_{x_i}^{x_{i+1}} h'(x)\,dx = c_i [h(x_{i+1}) - h(x_i)] = 0, \end{align} \] since \(h(x_{i+1}) = h(x_i) = 0\). Summing the boundary terms over all subintervals: \[ \begin{align} \int_a^b S''(x)h''(x)\,dx &= \sum_{i=0}^{n-1} \left( S''(x_{i+1}^-) h'(x_{i+1}) - S''(x_i^+) h'(x_i) \right) \\ &= S''(b) h'(b) - S''(a) h'(a) + \sum_{i=1}^{n-1} \left( S''(x_i^-) - S''(x_i^+) \right) h'(x_i). \end{align} \] At each interior knot, the contribution from the interval on the left has a plus sign and the contribution from the interval on the right a minus sign. They involve the same \(h'(x_i)\) because \(h\) is continuously differentiable. This explains the cancellation structure in the sum.
Because \(S \in C^2[a, b]\), the second derivative is continuous across interior knots: \(S''(x_i^-) - S''(x_i^+) = 0\). For a natural cubic spline, \(S''(a) = S''(b) = 0\), so the boundary terms vanish as well. Therefore \[ \begin{align} \int_a^b S''(x)h''(x)\,dx = 0. \end{align} \] Substituting this back yields \[ \begin{align} \int_a^b [g''(x)]^2\,dx &= \int_a^b [S''(x)]^2\,dx + \int_a^b [h''(x)]^2\,dx \geq \int_a^b [S''(x)]^2\,dx, \end{align} \] with equality if and only if \(h''(x) \equiv 0\), meaning \(h\) is linear and hence identically zero because \(h(x_0) = h(x_n) = 0\).
If the remaining integral of \((h'')^2\) is zero, continuity of \(h''\) forces it to vanish at every point: a nonzero value would give a neighborhood with a positive contribution. Then \(h\) is linear. Its zero values at the two distinct endpoints force both linear coefficients to be zero. Thus equality holds only for the spline itself.
18.7 Further Exercises
Compute the barycentric weights \(w_0, ..., w_n\) explicitly for \(n+1\) Chebyshev nodes on \([-1, 1]\). Show that, up to a common nonzero factor, \(w_k = (-1)^k \sin\left(\frac{2k+1}{2n+2}\pi\right)\) (or \((-1)^k \delta_k\) with \(\delta_k = 1/2\) at boundary nodes for Chebyshev-Lobatto points).
Use the referenced result to bound the maximum error when \(f(x) = \sin(x)\) is interpolated by a polynomial of degree 4 on \([0, \pi/2]\) using equally spaced nodes.
For the natural spline through \((0,0)\), \((1,1)\), \((2,0)\), and \((3,1)\), compute its bending energy \(\int_0^3(S'')^2\,dx\) and compare it with the energy of one other twice-differentiable interpolant.