Connecting discrete observations to continuous reality is a foundational task in scientific computation. In physical experiments, telemetry streams, and numerical simulations, we rarely hold closed-form mathematical functions. Instead, we receive a finite set of sampled data points:

(x0,y0),(x1,y1),…,(xn,yn).(x_0, y_0), (x_1, y_1), \dots, (x_n, y_n).

How do we construct a continuous model that passes exactly through each observation?

Polynomials are the primary algebraic candidate: they are infinitely differentiable, straightforward to integrate and differentiate analytically, and fast to evaluate on digital hardware using Horner's nested scheme.

This note establishes the core algebraic mechanics of polynomial interpolation [1][1] R. L. Burden and J. D. Faires, Numerical Analysis, 9th ed. Brooks/Cole, Cengage Learning, 2011., [2][2] M. U. School of Mathematics, “MTH2051: Introduction to Computational Mathematics: Course Lecture Notes and Study Workbooks,” 2026. Monash University course materials and study workbooks, Semester 2, 2026.:

  1. The Interpolation Problem: Formulating exact matching in the polynomial vector space PnP_n;
  2. Approximation versus Interpolation: Why Weierstrass's existential promise differs fundamentally from discrete interpolation;
  3. The Lagrange Form: Building the interpolant using geometric selector switches (ℓi(xj)=δij\ell_i(x_j) = \delta_{ij});
  4. Existence and Uniqueness: Establishing why n+1n+1 distinct points define exactly one polynomial of degree at most nn;
  5. The Newton Divided-Difference Form: Constructing the interpolant incrementally so that new data points stream in at O(n)\mathcal{O}(n) marginal cost.

The interpolation problem

DefinitionPolynomial interpolation

Given n+1n+1 distinct real nodes x0,x1,…,xnx_0, x_1, \dots, x_n and corresponding values y0,y1,…,yny_0, y_1, \dots, y_n, a polynomial Pn∈PnP_n \in P_n is an interpolating polynomial if

Pn(xi)=yi,i=0,1,…,n.P_n(x_i) = y_i, \quad i = 0, 1, \dots, n.

Here PnP_n denotes the real vector space of all polynomials of degree at most nn:

Pn={∑k=0nakxk:ak∈R}.P_n = \left\{ \sum_{k=0}^n a_k x^k : a_k \in \mathbb{R} \right\}.

The space PnP_n is parametrized by n+1n+1 coefficients a0,a1,…,ana_0, a_1, \dots, a_n, so its dimension is dim⁡(Pn)=n+1\dim(P_n) = n+1. Two distinct data points determine a straight line in P1P_1. Three non-collinear points determine a parabola in P2P_2. In general, matching n+1n+1 scalar conditions requires an (n+1)(n+1)-dimensional function space.

Approximation versus interpolation

Before constructing the polynomial, we must distinguish between two easily confused concepts: approximating a continuous function and interpolating discrete samples.

TheoremWeierstrass approximation theorem

Let f∈C([a,b])f \in C([a,b]). For every tolerance ε>0\varepsilon > 0, there exists an integer m≥0m \ge 0 and a polynomial qm∈Pmq_m \in P_m such that

max⁡x∈[a,b]∣f(x)−qm(x)∣<ε.\max_{x \in [a,b]} |f(x) - q_m(x)| < \varepsilon.

The Weierstrass theorem provides an existential guarantee: continuous functions on compact intervals can be approximated uniformly by polynomials of sufficiently high degree.

However, Weierstrass does not claim that the unique polynomial interpolating ff at n+1n+1 equally spaced sample points will converge to ff as n→∞n \to \infty. In fact, forcing a high-degree global polynomial through equidistant points can trigger catastrophic boundary divergence. The distinction is fundamental:

  • Approximation asks for some polynomial that remains within an ε\varepsilon-tube across the entire interval [a,b][a,b];
  • Interpolation constructs the unique polynomial matching the function values at prescribed discrete nodes x0,…,xnx_0, \dots, x_n.

This interactive figure needs JavaScript.

The Lagrange basis

To construct the interpolating polynomial directly, we look for a basis of PnP_n consisting of "selector switches": for each node xix_i, we construct a basis polynomial ℓi(x)\ell_i(x) that evaluates to 11 at xix_i and vanishes at all foreign nodes xjx_j (j≠ij \neq i).

DefinitionLagrange basis polynomials

For n+1n+1 pairwise distinct nodes x0,…,xnx_0, \dots, x_n, the ii-th Lagrange basis polynomial ℓi∈Pn\ell_i \in P_n is defined by

ℓi(x)=∏j=0j≠inx−xjxi−xj.\ell_i(x) = \prod_{\substack{j=0 \\ j \neq i}}^n \frac{x - x_j}{x_i - x_j}.

It satisfies the Kronecker delta selector property:

ℓi(xj)=δij={1,j=i,0,j≠i.\ell_i(x_j) = \delta_{ij} = \begin{cases} 1, & j = i, \\ 0, & j \neq i. \end{cases}

The algebraic design is direct:

  1. The numerator ∏j≠i(x−xj)\prod_{j \neq i} (x - x_j) has degree nn and places a root at every node other than xix_i;
  2. The denominator ∏j≠i(xi−xj)\prod_{j \neq i} (x_i - x_j) is a non-zero scalar constant that normalizes the value at x=xix = x_i to exactly 11.
DefinitionLagrange interpolating polynomial

Given sample values yi=f(xi)y_i = f(x_i), the Lagrange interpolating polynomial is

Pn(x)=∑i=0nyiℓi(x).P_n(x) = \sum_{i=0}^n y_i \ell_i(x).

Evaluating Pn(x)P_n(x) at any node xkx_k isolates a single term:

Pn(xk)=∑i=0nyiℓi(xk)=∑i=0nyiδik=yk.P_n(x_k) = \sum_{i=0}^n y_i \ell_i(x_k) = \sum_{i=0}^n y_i \delta_{ik} = y_k.

Thus PnP_n satisfies all n+1n+1 interpolation conditions by construction.

ExampleQuadratic Lagrange interpolation for three points

Consider the data points (0,1)(0, 1), (1,3)(1, 3), and (2,2)(2, 2), with n=2n = 2. The three quadratic basis polynomials are:

ℓ0(x)=(x−1)(x−2)(0−1)(0−2)=12(x−1)(x−2),ℓ1(x)=(x−0)(x−2)(1−0)(1−2)=−x(x−2),ℓ2(x)=(x−0)(x−1)(2−0)(2−1)=12x(x−1).\begin{aligned} \ell_0(x) &= \frac{(x - 1)(x - 2)}{(0 - 1)(0 - 2)} = \frac{1}{2}(x - 1)(x - 2), \\ \ell_1(x) &= \frac{(x - 0)(x - 2)}{(1 - 0)(1 - 2)} = -x(x - 2), \\ \ell_2(x) &= \frac{(x - 0)(x - 1)}{(2 - 0)(2 - 1)} = \frac{1}{2}x(x - 1). \end{aligned}

Assembling the linear combination:

p2(x)=1⋅ℓ0(x)+3⋅ℓ1(x)+2⋅ℓ2(x)=12(x2−3x+2)−3(x2−2x)+(x2−x)=−32x2+72x+1.\begin{aligned} p_2(x) &= 1 \cdot \ell_0(x) + 3 \cdot \ell_1(x) + 2 \cdot \ell_2(x) \\ &= \frac{1}{2}(x^2 - 3x + 2) - 3(x^2 - 2x) + (x^2 - x) \\ &= -\frac{3}{2}x^2 + \frac{7}{2}x + 1. \end{aligned}

Checking the nodes: p2(0)=1p_2(0) = 1, p2(1)=3p_2(1) = 3, and p2(2)=2p_2(2) = 2.

Lagrange basis polynomials and the assembled quadratic interpolating polynomial passing through the sample points.

Lagrange basis polynomials and the assembled quadratic interpolating polynomial passing through the sample points.

PropositionProperties of the Lagrange basis

The n+1n+1 polynomials ℓ0,ℓ1,…,ℓn\ell_0, \ell_1, \dots, \ell_n:

  1. Are linearly independent in PnP_n;
  2. Form a basis for PnP_n;
  3. Satisfy the partition of unity identity:
∑i=0nℓi(x)=1for all x∈R.\sum_{i=0}^n \ell_i(x) = 1 \quad \text{for all } x \in \mathbb{R}.
Proof

To prove linear independence, suppose ∑i=0nciℓi(x)=0\sum_{i=0}^n c_i \ell_i(x) = 0 for all xx. Evaluating this polynomial identity at x=xkx = x_k yields

∑i=0nciℓi(xk)=∑i=0nciδik=ck=0\sum_{i=0}^n c_i \ell_i(x_k) = \sum_{i=0}^n c_i \delta_{ik} = c_k = 0

for each k=0,1,…,nk = 0, 1, \dots, n. Hence all coefficients vanish, establishing linear independence.

Since dim⁡(Pn)=n+1\dim(P_n) = n+1 and the collection contains n+1n+1 linearly independent polynomials, it spans PnP_n and forms a basis.

Finally, consider the constant function f(x)≡1∈Pnf(x) \equiv 1 \in P_n. Its unique interpolant in PnP_n through the nodes is itself. Expanding it in the Lagrange basis gives ∑i=0n1⋅ℓi(x)=1\sum_{i=0}^n 1 \cdot \ell_i(x) = 1, which proves the partition of unity.

Existence and uniqueness

TheoremExistence and uniqueness of the interpolant

Let x0,x1,…,xnx_0, x_1, \dots, x_n be n+1n+1 pairwise distinct real numbers, and let y0,y1,…,yny_0, y_1, \dots, y_n be arbitrary real numbers. There exists exactly one polynomial Pn∈PnP_n \in P_n such that

Pn(xi)=yi,i=0,1,…,n.P_n(x_i) = y_i, \quad i = 0, 1, \dots, n.
Proof

Existence. The Lagrange formula Pn(x)=∑i=0nyiℓi(x)P_n(x) = \sum_{i=0}^n y_i \ell_i(x) is a linear combination of elements of PnP_n, so Pn∈PnP_n \in P_n. By the selector property, Pn(xi)=yiP_n(x_i) = y_i for all ii.

Uniqueness. Suppose qn∈Pnq_n \in P_n also satisfies qn(xi)=yiq_n(x_i) = y_i for i=0,1,…,ni = 0, 1, \dots, n. Define the difference polynomial

r(x)=Pn(x)−qn(x).r(x) = P_n(x) - q_n(x).

Since PnP_n is a linear vector space, r∈Pnr \in P_n. Evaluating rr at each node:

r(xi)=Pn(xi)−qn(xi)=yi−yi=0,i=0,1,…,n.r(x_i) = P_n(x_i) - q_n(x_i) = y_i - y_i = 0, \quad i = 0, 1, \dots, n.

Thus r(x)r(x) has at least n+1n+1 distinct roots. By the fundamental property of polynomials, a non-zero polynomial of degree at most nn can have at most nn roots. Therefore r(x)r(x) must be the zero polynomial:

r(x)≡0  ⟹  Pn(x)=qn(x)for all x∈R.r(x) \equiv 0 \implies P_n(x) = q_n(x) \quad \text{for all } x \in \mathbb{R}.

The Newton divided-difference form

Although the Lagrange form offers an elegant closed-form proof of existence, it is computationally inefficient when data arrives incrementally. Adding a new sample point (xn+1,yn+1)(x_{n+1}, y_{n+1}) alters the denominator and numerator of every basis polynomial ℓi(x)\ell_i(x), requiring an O(n2)\mathcal{O}(n^2) complete reconstruction.

The Newton form solves this by constructing the interpolant progressively:

Pk(x)=Pk−1(x)+ak∏j=0k−1(x−xj).P_k(x) = P_{k-1}(x) + a_k \prod_{j=0}^{k-1} (x - x_j).

Each new basis element ∏j=0k−1(x−xj)\prod_{j=0}^{k-1} (x - x_j) vanishes at all previous nodes x0,…,xk−1x_0, \dots, x_{k-1}, preserving the values already matched and requiring only a single new coefficient aka_k.

DefinitionDivided differences

Let x0,…,xnx_0, \dots, x_n be distinct nodes with values f(x0),…,f(xn)f(x_0), \dots, f(x_n). The zeroth divided difference is

f[xi]=f(xi).f[x_i] = f(x_i).

The first divided difference is

f[xi,xi+1]=f[xi+1]−f[xi]xi+1−xi.f[x_i, x_{i+1}] = \frac{f[x_{i+1}] - f[x_i]}{x_{i+1} - x_i}.

Higher-order divided differences are defined recursively for k≥2k \ge 2 by

f[xi,xi+1,…,xi+k]=f[xi+1,…,xi+k]−f[xi,…,xi+k−1]xi+k−xi.f[x_i, x_{i+1}, \dots, x_{i+k}] = \frac{f[x_{i+1}, \dots, x_{i+k}] - f[x_i, \dots, x_{i+k-1}]}{x_{i+k} - x_i}.

The denominator of a kk-th order divided difference is always the span between the two outermost nodes, xi+k−xix_{i+k} - x_i.

TheoremNewton form of the interpolating polynomial

The unique polynomial Pn∈PnP_n \in P_n interpolating ff at the distinct nodes x0,…,xnx_0, \dots, x_n can be expressed in Newton form as

Pn(x)=f[x0]+∑k=1nf[x0,x1,…,xk]∏j=0k−1(x−xj).P_n(x) = f[x_0] + \sum_{k=1}^n f[x_0, x_1, \dots, x_k] \prod_{j=0}^{k-1} (x - x_j).
Proof

Let P0,k(x)P_{0, k}(x) be the unique polynomial in PkP_k interpolating ff at x0,…,xkx_0, \dots, x_k. Consider the difference

P0,k(x)−P0,k−1(x).P_{0, k}(x) - P_{0, k-1}(x).

Both polynomials match ff at x0,…,xk−1x_0, \dots, x_{k-1}, so their difference has roots at each of these kk points. By the factor theorem:

P0,k(x)−P0,k−1(x)=ck∏j=0k−1(x−xj),P_{0, k}(x) - P_{0, k-1}(x) = c_k \prod_{j=0}^{k-1} (x - x_j),

where ckc_k is the leading coefficient of P0,k(x)P_{0, k}(x).

Telescoping this relation from k=1k = 1 to nn yields:

Pn(x)=P0,n(x)=P0,0(x)+∑k=1nck∏j=0k−1(x−xj).P_n(x) = P_{0, n}(x) = P_{0, 0}(x) + \sum_{k=1}^n c_k \prod_{j=0}^{k-1} (x - x_j).

It remains to identify ckc_k. Using the Neville recurrence relation:

P0,k(x)=(x−x0)P1,k(x)−(x−xk)P0,k−1(x)xk−x0.P_{0, k}(x) = \frac{(x - x_0) P_{1, k}(x) - (x - x_k) P_{0, k-1}(x)}{x_k - x_0}.

Equating the coefficient of xkx^k on both sides shows that the leading coefficient satisfies the exact divided-difference recurrence:

ck=coeff⁡(P1,k,xk−1)−coeff⁡(P0,k−1,xk−1)xk−x0.c_k = \frac{\operatorname{coeff}(P_{1, k}, x^{k-1}) - \operatorname{coeff}(P_{0, k-1}, x^{k-1})}{x_k - x_0}.

By induction on kk, the leading coefficient of P0,k(x)P_{0, k}(x) is f[x0,…,xk]f[x_0, \dots, x_k].

The divided-difference table

Divided differences are computed systematically in a triangular array:

xif[xi]1st order2nd order3rd orderx0f[x0]f[x0,x1]x1f[x1]f[x0,x1,x2]f[x1,x2]f[x0,x1,x2,x3]x2f[x2]f[x1,x2,x3]f[x2,x3]x3f[x3]\begin{array}{c|cccc} x_i & f[x_i] & \text{1st order} & \text{2nd order} & \text{3rd order} \\ \hline x_0 & \mathbf{f[x_0]} & & & \\ & & \mathbf{f[x_0, x_1]} & & \\ x_1 & f[x_1] & & \mathbf{f[x_0, x_1, x_2]} & \\ & & f[x_1, x_2] & & \mathbf{f[x_0, x_1, x_2, x_3]} \\ x_2 & f[x_2] & & f[x_1, x_2, x_3] & \\ & & f[x_2, x_3] & & \\ x_3 & f[x_3] & & & \end{array}

The Newton coefficients ak=f[x0,…,xk]a_k = f[x_0, \dots, x_k] are the bold entries along the top diagonal.

ExampleStep-by-step table construction and incremental update

Suppose we are given three initial observations: (1,2)(1, 2), (2,3)(2, 3), and (4,9)(4, 9).

  1. Zeroth order: f[x0]=2f[x_0] = 2, f[x1]=3f[x_1] = 3, f[x2]=9f[x_2] = 9.
  2. First order:
f[x0,x1]=3−22−1=1,f[x1,x2]=9−34−2=3.f[x_0, x_1] = \frac{3 - 2}{2 - 1} = 1, \quad f[x_1, x_2] = \frac{9 - 3}{4 - 2} = 3.
  1. Second order:
f[x0,x1,x2]=3−14−1=23.f[x_0, x_1, x_2] = \frac{3 - 1}{4 - 1} = \frac{2}{3}.

The quadratic interpolant is:

p2(x)=2+1⋅(x−1)+23(x−1)(x−2).p_2(x) = 2 + 1 \cdot (x - 1) + \frac{2}{3}(x - 1)(x - 2).

Now suppose a fourth data point (5,12)(5, 12) arrives. We do not rebuild the table. We simply append the new row:

  • f[x2,x3]=12−95−4=3f[x_2, x_3] = \frac{12 - 9}{5 - 4} = 3;
  • f[x1,x2,x3]=3−35−2=0f[x_1, x_2, x_3] = \frac{3 - 3}{5 - 2} = 0;
  • f[x0,x1,x2,x3]=0−2/35−1=−16f[x_0, x_1, x_2, x_3] = \frac{0 - 2/3}{5 - 1} = -\frac{1}{6}.

The updated cubic polynomial is obtained by adding a single term:

p3(x)=p2(x)−16(x−1)(x−2)(x−4).p_3(x) = p_2(x) - \frac{1}{6}(x - 1)(x - 2)(x - 4).

At the previous nodes 1,2,41, 2, 4, the product factor vanishes, preserving the previously matched values automatically.

Horner nested evaluation

Expanding the Newton form into monomial powers ax2+bx+ca x^2 + b x + c is numerically unstable and computationally wasteful. Instead, we evaluate the polynomial in nested Horner form:

Pn(x)=a0+(x−x0)(a1+(x−x1)(a2+⋯+(x−xn−1)an)).P_n(x) = a_0 + (x - x_0) \Big( a_1 + (x - x_1) \Big( a_2 + \dots + (x - x_{n-1}) a_n \Big) \Big).

Algorithm 1 Horner Evaluation for Newton Interpolation

Require: nodes x0,…,xnx_0, \dots, x_n, coefficients a0,…,ana_0, \dots, a_n, evaluation point xx

Ensure: value y=Pn(x)y = P_n(x)

1:y←any \gets a_n

2:for k←n−1k \gets n - 1 downto 00 do

3:y←ak+(x−xk)⋅yy \gets a_k + (x - x_k) \cdot y

4:end for

5:return yy

Evaluating Pn(x)P_n(x) requires only nn additions and nn multiplications, achieving O(n)\mathcal{O}(n) runtime complexity. The algorithmic trade-offs across representations are summarized below [1][1] R. L. Burden and J. D. Faires, Numerical Analysis, 9th ed. Brooks/Cole, Cengage Learning, 2011.:

Comparison of interpolation forms

MetricLagrange FormNewton Form
Construction CostO(n2)\mathcal{O}(n^2)O(n2)\mathcal{O}(n^2)
Adding One NodeO(n2)\mathcal{O}(n^2) complete recomputationO(n)\mathcal{O}(n) append one diagonal entry
Evaluation CostO(n2)\mathcal{O}(n^2) directly (O(n)\mathcal{O}(n) via barycentric)O(n)\mathcal{O}(n) via Horner nested scheme
Theoretical UtilityProving existence and analytical derivationsStreaming data and numerical algorithms

Both forms produce the exact same algebraic polynomial, guaranteed by the uniqueness theorem.

Beyond the nodes

We have resolved how to build polynomials that pass through discrete sample points. However, the fundamental question in numerical analysis remains: how does the interpolating polynomial behave between the nodes?

Does increasing the number of sample points guarantee that the polynomial converges to the underlying function?

In the next note, Interpolation Error and Chebyshev Nodes, we derive Cauchy's error remainder formula, investigate the catastrophic edge oscillations of the Runge phenomenon, and discover how Chebyshev node clustering resolves this instability.

References

  1. [1] R. L. Burden and J. D. Faires, Numerical Analysis, 9th ed. Brooks/Cole, Cengage Learning, 2011. a b
  2. [2] M. U. School of Mathematics, “MTH2051: Introduction to Computational Mathematics: Course Lecture Notes and Study Workbooks,” 2026. Monash University course materials and study workbooks, Semester 2, 2026. ↩