Interpolation

Work in progress. This note is still being written and incomplete.

Interpolation estimates values between known data points.

Given n+1n+1 points (xi,yi)(x_i,y_i) with distinct nodes

x0<x1<⋯<xn,x_0 < x_1 < \cdots < x_n,

find a function ϕ\phi satisfying

ϕ(xi)=yi,i=0,1,…,n\phi(x_i)=y_i, \qquad i=0,1,\ldots,n

Use ϕ(x)\phi(x) for x∈[x0,xn]x\in[x_0,x_n]. This is interpolation. Values outside this interval are extrapolation. They are less reliable.

Choosing an Interpolant

Choose the form from the data.

DataInterpolantKey Property
Few pointsPolynomialOne formula through every point
Many non-periodic pointsPiecewise polynomialLow-degree formula on each interval
Periodic dataTrigonometricRepeating sine and cosine terms
Poles or sharp changesRationalRatio of polynomials
Values and slopes knownHermiteMatches values and derivatives

Polynomial Interpolation

Theorem

For distinct nodes x0,…,xnx_0,\ldots,x_n and values y0,…,yny_0,\ldots,y_n, exactly 1 polynomial pnp_n of degree at most nn satisfies

pn(xi)=yip_n(x_i)=y_i

The Lagrange form is

pn(x)=∑i=0nyiLi(x),Li(x)=∏j=0j≠inx−xjxi−xjp_n(x)=\sum_{i=0}^{n}y_iL_i(x), \qquad L_i(x)=\prod_{\substack{j=0\\j\ne i}}^{n}\frac{x-x_j}{x_i-x_j}

Each basis polynomial has 1 job.

Li(xj)={1,i=j,0,i≠j.L_i(x_j)= \begin{cases} 1, & i=j,\\ 0, & i\ne j. \end{cases}

Therefore pn(xj)=yjp_n(x_j)=y_j. At node xjx_j, every term disappears except yjLj(xj)y_jL_j(x_j).

Runge Phenomenon The function 1/(1 + 25x^2) on [-1, 1] with 11 equally spaced nodes, interpolated by a degree 10 polynomial, which oscillates near both ends, and by a piecewise linear function, which stays close to the curve. y x p₁₀ f
f the function, 1/(1 + 25x²), drawn dashed. p₁₀ the degree 10 polynomial through the nodes, which oscillates near both ends. piecewise linear straight segments through the same nodes, which stay close to f.

Piecewise Polynomial Interpolation

Split [x0,xn][x_0,x_n] into intervals. Use a low-degree polynomial on each interval.

  • Piecewise linear
    Straight segments. Continuous with corners at the nodes.
  • Piecewise quadratic
    Parabolic segments. Slopes can jump at the nodes.
  • Cubic spline
    Cubic segments with continuous value, slope and curvature.

Other Forms

For periodic data,

ϕ(x)=a02+∑k=1m(akcos⁡(kx)+bksin⁡(kx))\phi(x)=\frac{a_0}{2}+\sum_{k=1}^{m}\left(a_k\cos(kx)+b_k\sin(kx)\right)

For rational interpolation,

ϕ(x)=p(x)q(x)\phi(x)=\frac{p(x)}{q(x)}

For Hermite interpolation, ϕ\phi matches both yiy_i and yi′y_i' at each node.

Wolfram Mathematica notebook

The summary notebook defines every function used in this module, with documentation and no examples, as a starting point for your own problems.

Written by November 4, 2026 2 min read
Was this helpful?