Numerical Methods · Module 7 of 10
Interpolation and Splines
When data are exact and you need a value between them, interpolation fits a curve through every point. One polynomial does it, written two equivalent ways, and splines tame the wiggle when the points are many.
Readiness check
This module fits a curve through exact points. Tick only what you can do closed-notes.
- Evaluate a polynomial at a point.
- Recall that n + 1 points define a degree-n polynomial.
- Form a ratio of differences.
- Distinguish exact data from noisy data.
- Recall why regression smooths rather than passes through points.
The core idea
Through n + 1 exact points there is exactly one polynomial of degree n. Newton's divided differences and the Lagrange form both construct it; they give identical values. For many points, splines fit low-order pieces to avoid wild oscillation.
n + 1 points → unique degree-n polynomialNewton: fn(x) = b0 + b1(x − x0) + …Lagrange: weighted sum of the dataInterpolation differs from regression: the data are taken as exact, and the curve must pass through every point. Through any n + 1 distinct points passes exactly one polynomial of degree n or less, and two constructions reach it. Newton's divided-difference form builds it incrementally, each new point adding one term whose coefficient is a divided difference, so the work from a lower order is reused. The Lagrange form writes the polynomial as a weighted sum of the data values, with weights that are one at their own point and zero at the others. Both give the same number; the choice is convenience. The interpolation error depends on a high derivative and on how far the evaluation point sits from the data, and high-order polynomials can oscillate violently between points. Splines avoid this by fitting low-order polynomials, usually cubics, piece by piece with smooth joins.
The skills, taught in order
Five skills build the interpolating polynomial, its two forms, its error, and the splines that replace it.
7.1 Polynomial interpolation
Exactly one polynomial of degree n or less passes through n + 1 distinct points. Two points give a line, three a parabola, and so on. The polynomial is unique, so all valid methods yield the same curve and the same interpolated value.
7.2 Newton's divided differences
Newton's form builds the polynomial term by term: fn(x) = b0 + b1(x − x0) + b2(x − x0)(x − x1) + …, where each b is a divided difference of the data. Adding a point appends one term without redoing the rest, which is efficient.
| Form | Structure | Strength |
|---|---|---|
| Newton | nested, incremental | easy to add a point |
| Lagrange | weighted sum of data | compact, no differences |
| Spline | low-order pieces | no high-order oscillation |
Newton and Lagrange give the identical polynomial; splines deliberately give a different, piecewise curve.
7.3 The Lagrange form
The Lagrange form writes fn(x) = Σ Li(x) f(xi), where each basis polynomial Li equals one at xi and zero at every other node. It needs no divided differences and is convenient when the polynomial is evaluated rather than built up.
7.4 Interpolation error and oscillation
The error of an n-th order interpolation depends on the (n + 1)-th derivative and the products of distances to the nodes. Pushing the order too high makes the polynomial oscillate wildly between points, the Runge phenomenon, so more points do not always mean a better fit.
7.5 Splines
A spline fits a low-order polynomial, usually cubic, to each interval and matches value and slope (and curvature) at the joins. This keeps each piece tame, eliminating the oscillation of a single high-order polynomial, which is why splines are used for smooth curves through many points.
Engineering connection: CAD surfaces, cam profiles, and tabulated property data are all interpolated, usually with splines, for exactly this reason.
Worked example 1: Newton's divided-difference interpolation
Estimate ln(2) by quadratic interpolation through the points (1, 0), (4, 1.386294), and (6, 1.791759) using Newton's divided differences. The true value is 0.693147.
- ProblemEstimate ln(2) by Newton interpolation through the three points in Figure 1.
- Given / find(1, 0), (4, 1.386294), (6, 1.791759), evaluate at x = 2. Find P2(2) and the error.
- AssumptionsThe data are exact values of ln x; a quadratic through three points.
- ModelP2(x) = b0 + b1(x − x0) + b2(x − x0)(x − x1), with b the divided differences.
- Equationsb1 = (f1 − f0)/(x1 − x0)b2 = (f[x1,x2] − b1)/(x2 − x0)
- Solveb0 = 0. b1 = (1.386294 − 0)/(4 − 1) = 0.462098. f[x1,x2] = (1.791759 − 1.386294)/2 = 0.202733, so b2 = (0.202733 − 0.462098)/(6 − 1) = −0.051873. P2(2) = 0 + 0.462098(1) − 0.051873(1)(−2) = 0.462098 + 0.103746 = 0.565844.
- CheckThe error is |0.693147 − 0.565844|/0.693147 = 18.4 percent, large because the nodes (1, 4, 6) are far from x = 2 and from each other; closer nodes would do better.
- ConclusionThe quadratic gives 0.5658 for ln(2). Interpolation is exact at the nodes but only as good as the spacing allows between them.
Worked example 2: the Lagrange form gives the same value
Interpolate ln(2) again, now with the Lagrange form through the same three points (1, 0), (4, 1.386294), (6, 1.791759), and confirm it matches the Newton result.
- ProblemInterpolate ln(2) with the Lagrange form and compare to Worked Example 1, as in Figure 2.
- Given / findSame three points, evaluate at x = 2. Find the Lagrange estimate.
- AssumptionsExact data; the interpolating polynomial is unique, so the forms must agree.
- Modelf2(x) = Σ Li(x) f(xi), with Li(x) = Πj≠i (x − xj)/(xi − xj).
- EquationsL0(2) = (2−4)(2−6)/((1−4)(1−6))L1(2) = (2−1)(2−6)/((4−1)(4−6))L2(2) = (2−1)(2−4)/((6−1)(6−4))
- SolveL0(2) = (−2)(−4)/((−3)(−5)) = 8/15 (weighting 0, so it drops out). L1(2) = (1)(−4)/((3)(−2)) = 2/3, times 1.386294 = 0.924196. L2(2) = (1)(−2)/((5)(2)) = −1/5, times 1.791759 = −0.358352. Sum = 0.924196 − 0.358352 = 0.565844.
- Check0.565844 equals the Newton result exactly, confirming both forms build the one unique quadratic through the three points.
- ConclusionNewton and Lagrange are two routes to the same polynomial. The choice is a matter of convenience, not accuracy.
Misconceptions and diagnostics
| Mistake | Symptom | Diagnostic question | Correction |
|---|---|---|---|
| Interpolating noisy data | A curve chasing measurement scatter | "Are the data exact?" | Use regression to smooth noisy data, not interpolation. |
| Too high an order | Wild swings between points | "Is the polynomial oscillating?" | Lower the order or switch to splines. |
| Expecting forms to differ | Suspecting Newton and Lagrange disagree | "Is the polynomial unique?" | Both give the same unique polynomial. |
| Extrapolating far | Large error outside the data range | "Is x within the node span?" | Interpolation is reliable only between the nodes. |
Practice ladder
Linearly interpolate between (1, 0) and (4, 1.386) to estimate ln(2).
Show answer
f = 0 + (1.386 − 0)/(4 − 1)·(2 − 1) = 0.462. The linear estimate is coarser than the quadratic 0.566.
Why is the quadratic estimate 0.566 closer to ln(2) than the linear 0.462?
Show answer
The added third point captures the curvature of ln x, which a straight line ignores; the quadratic term −0.0519(x − 1)(x − 4) corrects toward the true 0.693.
Interpolate (0, 1), (1, 2), (2, 5) at x = 1.5 with a quadratic.
Show answer
Divided diffs: b0 = 1, b1 = (2 − 1)/1 = 1, b2 = ((5 − 2)/1 − 1)/2 = 1. P(1.5) = 1 + 1(1.5) + 1(1.5)(0.5) = 1 + 1.5 + 0.75 = 3.25.
You have twenty exact points from a property table and need a smooth value between them. Argue why a spline beats a single degree-19 polynomial.
What good work looks like
A degree-19 polynomial would oscillate wildly (Runge phenomenon), giving large errors between nodes, while a cubic spline fits tame low-order pieces with smooth joins, staying close to the data everywhere.
Working with AI, and proving it yourself
Use AI as an examiner, not a solver
Portfolio task
Interpolate a real exact data table by both Newton and Lagrange, confirm they agree, and compare against a spline where the points are dense.
Retrieval and spaced review
Closed notes. Answer out loud, then reveal.
1. How many points define a degree-n polynomial?
n + 1 distinct points define a unique polynomial of degree n or less.
2. What is a divided difference?
A ratio of differences of the data that forms each Newton coefficient.
3. What is a Lagrange basis polynomial?
A function equal to one at its own node and zero at all others.
4. What is the Runge phenomenon?
Wild oscillation of a high-order interpolating polynomial between points.
5. Why use splines?
Low-order pieces with smooth joins avoid high-order oscillation through many points.
Textbook mapping
This module follows Chapra and Canale, Numerical Methods for Engineers, 7th edition. Use these references to read further.
| Topic in this module | Where to read more |
|---|---|
| Newton divided-difference interpolation | Chapra & Canale, Chapter 18 |
| The Lagrange form | Chapra & Canale, Chapter 18 |
| Splines | Chapra & Canale, Chapter 18 |
Chapter numbers refer to the 7th edition. The interpolation methods are standard, so any recent edition will align closely.