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.

01

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.
0 or 1 weak itemsContinue with this module.
2 weak itemsContrast with regression in Module 6.
3 or more weak itemsReview polynomials in Mathematics, Module 1.
02

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 data

Interpolation 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 skill works when: you fit the right order through the points and gauge the error from the spacing.
The skill breaks down when: a single high-order polynomial is forced through many points and oscillates.
The concept. Interpolation threads a single polynomial exactly through the data points, then reads off a value between them. The fit is exact at the points by construction.
03

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.

FormStructureStrength
Newtonnested, incrementaleasy to add a point
Lagrangeweighted sum of datacompact, no differences
Splinelow-order piecesno 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.

04

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.

Figure 1. The parabola through three points of ln x estimates the value at x = 2. Because the nodes are spread wide, the estimate carries an 18 percent error.
  1. ProblemEstimate ln(2) by Newton interpolation through the three points in Figure 1.
  2. Given / find(1, 0), (4, 1.386294), (6, 1.791759), evaluate at x = 2. Find P2(2) and the error.
  3. AssumptionsThe data are exact values of ln x; a quadratic through three points.
  4. ModelP2(x) = b0 + b1(x − x0) + b2(x − x0)(x − x1), with b the divided differences.
  5. Equationsb1 = (f1 − f0)/(x1 − x0)b2 = (f[x1,x2] − b1)/(x2 − x0)
  6. 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.
  7. 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.
  8. ConclusionThe quadratic gives 0.5658 for ln(2). Interpolation is exact at the nodes but only as good as the spacing allows between them.
Result. P2(2) = 0.565844 (true 0.693147, error 18.4%).
05

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.

Figure 2. The Lagrange weighted sum produces the identical value to Newton's divided differences, confirming the interpolating polynomial through three points is unique.
  1. ProblemInterpolate ln(2) with the Lagrange form and compare to Worked Example 1, as in Figure 2.
  2. Given / findSame three points, evaluate at x = 2. Find the Lagrange estimate.
  3. AssumptionsExact data; the interpolating polynomial is unique, so the forms must agree.
  4. Modelf2(x) = Σ Li(x) f(xi), with Li(x) = Πj≠i (x − xj)/(xi − xj).
  5. 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))
  6. 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.
  7. Check0.565844 equals the Newton result exactly, confirming both forms build the one unique quadratic through the three points.
  8. ConclusionNewton and Lagrange are two routes to the same polynomial. The choice is a matter of convenience, not accuracy.
Result. Lagrange gives 0.565844, identical to Newton.
06

Misconceptions and diagnostics

MistakeSymptomDiagnostic questionCorrection
Interpolating noisy dataA curve chasing measurement scatter"Are the data exact?"Use regression to smooth noisy data, not interpolation.
Too high an orderWild swings between points"Is the polynomial oscillating?"Lower the order or switch to splines.
Expecting forms to differSuspecting Newton and Lagrange disagree"Is the polynomial unique?"Both give the same unique polynomial.
Extrapolating farLarge error outside the data range"Is x within the node span?"Interpolation is reliable only between the nodes.
07

Practice ladder

Level 1 · Direct skill

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.

Level 2 · Mixed concept

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.

Level 3 · Independent problem

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.

Transfer task | Real engineering

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.

08

Working with AI, and proving it yourself

Use AI as an examiner, not a solver

"Check that my Newton and Lagrange estimates agree."
"Give me three data sets; I will choose interpolation or regression for each."
"Interpolate this for me." Building the polynomial is the skill.
"Why is the error large?" Reasoning from node spacing is the point.

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.

Must include: a divided-difference table, a matching Lagrange value, and a spline comparison.
09

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.

TodayFinish this quiz and Levels 1 and 2 of the ladder.
+1 dayRe-derive the quadratic interpolation from a blank page.
+3 daysInterpolate three new data sets by both forms.
+7 daysIntegrate a function numerically, Module 8.
+30 daysReuse splines for a smooth property-table lookup.
10

Textbook mapping

This module follows Chapra and Canale, Numerical Methods for Engineers, 7th edition. Use these references to read further.

Topic in this moduleWhere to read more
Newton divided-difference interpolationChapra & Canale, Chapter 18
The Lagrange formChapra & Canale, Chapter 18
SplinesChapra & Canale, Chapter 18

Chapter numbers refer to the 7th edition. The interpolation methods are standard, so any recent edition will align closely.