Applied and computational mathematics
Interpolation and approximation
Constructing a function that passes through given data points, or approximates a complicated one closely.
IntuitionIntuition: connecting the dots with a curve
A weather station records the temperature at a handful of times during the day, a sensor reports a few discrete measurements, or an engineer has a table of just a few tabulated values — in every case you have a finite list of points and you want to guess the value in between, or draw a smooth curve through all of them. Interpolation is the art of constructing a function that passes through every one of these points exactly, while approximation more broadly looks for a function that stays close to a complicated one without necessarily matching it point for point.
UndergraduateDefinition: the interpolation problem
Definition: Polynomial interpolation
Given distinct nodes and values (typically for some function ), the interpolation problem asks for a polynomial of degree at most with for every . The Lagrange basis polynomials give an explicit construction.
Each basis polynomial is built to vanish at every other node and equal at its own node: plugging in with makes the numerator's factor , giving , while plugging in makes numerator and denominator identical, giving . Summing these building blocks weighted by the target values gives the interpolating polynomial directly.
| Method | Idea | Smoothness across nodes | Weakness |
|---|---|---|---|
| Lagrange | Single polynomial through all nodes | Infinitely smooth (it is one polynomial) | High degree with equispaced nodes oscillates wildly (Runge's phenomenon) |
| Newton divided differences | Same polynomial as Lagrange, built incrementally node by node | Infinitely smooth (same polynomial) | Adding a node is cheap, but suffers the same high-degree oscillation |
| Natural cubic spline | Piecewise cubic, one cubic per subinterval, joined smoothly | (continuous up to the second derivative) | No single global formula; must solve a linear system for the pieces |
UndergraduateKey theorems
Given distinct nodes and values , there exists exactly one polynomial of degree at most such that for every .
Why is it true?
A degree-n polynomial has exactly n+1 free coefficients, and pinning down n+1 point values uses up exactly that many degrees of freedom — no more, no less — so there is room for one solution and no room for two different ones.
Proof
Step 1 (existence). The Lagrange construction with already satisfies for every , since equals when and otherwise, so the sum collapses to the single term . So at least one valid exists, and each has degree exactly (a product of linear factors), so has degree at most .
Step 2 (suppose two solutions). Suppose is any other polynomial of degree at most with for every . Consider the difference . Since both and have degree at most , so does .
Step 3 (count the roots of the difference). For every node , . Since there are distinct nodes , has at least distinct roots.
Step 4 (force D to be identically zero). A nonzero polynomial of degree at most can have at most roots (each root contributes one linear factor, and a degree- polynomial cannot contain more than such factors). Since has roots, more than its degree allows unless is the zero polynomial, we conclude , i.e. . So the interpolating polynomial found in Step 1 is the only one.
Let be -times continuously differentiable on an interval containing distinct nodes and a point , and let be the degree- polynomial interpolating at these nodes. Then there exists in that interval such that .
Why is it true?
The interpolating polynomial matches f exactly at the nodes but knows nothing about f in between, so the leftover error must vanish at every node — exactly what the product term forces — scaled by a leftover derivative that measures how much f curves beyond what a degree-n polynomial can capture.
Proof
Step 1 (a clever auxiliary function). Fix a point that is not one of the nodes (if it is, the error is trivially ). Let and define the constant (well-defined since ). Define the auxiliary function .
Step 2 (count the roots of g). At every node , both (by the interpolation property) and (by definition of ), so for all nodes. Also, by the choice of , . So has distinct roots: the nodes plus itself.
Step 3 (apply Rolle's theorem repeatedly). Between each pair of consecutive roots of (there are such gaps among roots), Rolle's theorem gives a point where vanishes, so has at least roots. Repeating this argument on loses one root each time a derivative is taken, so after applications, has at least one root in the interval.
Step 4 (differentiate and solve for the error). Since has degree at most , its -th derivative is ; and is a monic polynomial of degree , so for every . Differentiating gives , and setting gives . Recalling and solving for the error gives exactly .
Given points with , there exists a unique function that is a cubic polynomial on each subinterval , is twice continuously differentiable on all of , satisfies for every , and satisfies the natural boundary conditions .
Why is it true?
A single high-degree polynomial through many points tends to wiggle, but stitching together many gentle cubic pieces and only demanding they match up smoothly at the seams gives just enough freedom to fit the data without any wild swings, and the natural boundary conditions supply exactly the two extra equations needed to make the whole system solvable.
Proof
Step 1 (unknowns: the second derivatives at the knots). Let for . The natural boundary conditions fix and immediately, leaving unknowns to determine.
Step 2 (reconstruct each cubic piece from its M values). On , since is cubic, is linear, so it must be the straight line through and . Integrating this linear function twice and fixing the two constants of integration using and determines completely on that piece, in terms of and the spacing . So once all the are known, is fully known.
Step 3 (matching slopes gives a linear system). By construction and are already continuous across each knot. Demanding that the first derivative also matches from both sides at each interior knot () produces one linear equation per interior knot relating three consecutive unknowns: . This gives linear equations in the unknowns (using ).
Step 4 (the system has a unique solution). The coefficient matrix of this system is tridiagonal with diagonal entries and off-diagonal entries and ; since (as all spacings ), the matrix is strictly diagonally dominant, and a strictly diagonally dominant matrix is always invertible. So the linear system for has exactly one solution, and by Step 2 this determines exactly one spline , proving both existence and uniqueness.
UndergraduateReal-World Applications and Worked Examples
Interpolation is everywhere data is sampled but a continuous curve is needed: computer fonts and animation paths are drawn with splines, GPS receivers interpolate a handful of satellite readings into a smooth trajectory, image and audio resampling interpolate between pixels or samples when resizing or changing playback speed, and engineers interpolate sparse tables of material properties or thermodynamic data measured only at a few temperatures or pressures. Financial analysts interpolate a yield curve from bond prices observed only at a few maturities to price instruments that mature in between.
Example: Predicting a trend from three measurements with Lagrange interpolation
A lab records three measurements , , . Using the Lagrange interpolating polynomial through these three points, estimate the value at .
Solution
Step 1: write the three basis polynomials evaluated at . With nodes : , , .
Step 2: weight each basis value by its data value. The values are , so the estimate is .
Step 3: add up. .
Step 4: check with the explicit polynomial. Solving directly for the quadratic through the three points gives , and indeed , confirming the Lagrange-form computation without ever writing the polynomial's coefficients explicitly.
Example: Why interpolation error explodes near the edges: a first look at Runge's phenomenon
Take the equally spaced nodes on . Compute the node polynomial at a point near the center, , and at a point near the edge, , and compare their sizes.
Solution
Step 1: evaluate . , which multiplies out to .
Step 2: evaluate . , which multiplies out to , so .
Step 3: compare. is roughly times larger than , even though and are both comfortably inside .
Step 4: connect to the error formula. Since the interpolation error is , the larger near the edges directly inflates the error bound there; for a function like whose high derivatives grow very fast, this edge amplification (made worse as more equispaced nodes are added) is exactly what produces the wild oscillations known as Runge's phenomenon — the motivation for using cubic splines or unevenly spaced (Chebyshev) nodes instead of raising the degree of a single equispaced polynomial.
Given distinct data points, what is the degree of the unique interpolating polynomial guaranteed by the existence-uniqueness theorem?
What is the value of the Lagrange basis polynomial at its own node ?
An engineer fits a single degree- polynomial through equally spaced measurements of a material's thermal conductivity. Near the ends of the measured range, the fitted curve oscillates wildly even though the true conductivity varies smoothly. What is the standard fix?
If on an interval and the node polynomial satisfies there, what bound does the Lagrange error formula give for ?