4.8.11Numerical Methods

Error in polynomial interpolation

1,862 words8 min readdifficulty · medium

WHAT are we measuring?

The central result we will derive:


WHY does this exact shape appear? (Derivation from scratch)

We want to show E(x)=f(n+1)(ξ)(n+1)!ω(x)E(x) = \dfrac{f^{(n+1)}(\xi)}{(n+1)!}\,\omega(x).

Step 1 — Fix a point and build a helper function. Pick any point xˉ\bar x that is not a node (if it is a node the error is 00 and we're done). We don't yet know the error there; call the unknown constant KK defined by f(xˉ)pn(xˉ)=Kω(xˉ).f(\bar x) - p_n(\bar x) = K\,\omega(\bar x). Why this step? We are forcing the error to have the form (constant)×ω\times\omega. If we can prove K=f(n+1)(ξ)(n+1)!K=\dfrac{f^{(n+1)}(\xi)}{(n+1)!}, the formula is done. This is the Feynman move: assume the answer's shape, then pin it down.

Step 2 — Define an auxiliary function in a new variable tt: g(t)=f(t)pn(t)Kω(t).g(t) = f(t) - p_n(t) - K\,\omega(t). Why this step? We want a function that vanishes at lots of points so we can apply Rolle repeatedly.

Step 3 — Count the zeros of gg.

  • At each node: f(xi)=pn(xi)f(x_i)=p_n(x_i) and ω(xi)=0\omega(x_i)=0, so g(xi)=0g(x_i)=0. That's n+1n+1 zeros.
  • At t=xˉt=\bar x: by definition of KK, g(xˉ)=f(xˉ)pn(xˉ)Kω(xˉ)=0g(\bar x)=f(\bar x)-p_n(\bar x)-K\omega(\bar x)=0. One more zero.

So gg has at least n+2n+2 distinct zeros in [a,b][a,b].

Step 4 — Apply Rolle's theorem repeatedly. Why? Rolle says between two zeros of gg lies a zero of gg'.

  • gg has n+2\ge n+2 zeros \Rightarrow gg' has n+1\ge n+1 zeros.
  • gg'' has n\ge n zeros.
  • g(n+1)g^{(n+1)} has 1\ge 1 zero. Call it ξ\xi.

Step 5 — Differentiate gg exactly n+1n+1 times. g(n+1)(t)=f(n+1)(t)pn(n+1)(t)Kω(n+1)(t).g^{(n+1)}(t) = f^{(n+1)}(t) - p_n^{(n+1)}(t) - K\,\omega^{(n+1)}(t).

  • pnp_n has degree n\le n pn(n+1)0\Rightarrow p_n^{(n+1)}\equiv 0.
  • ω(t)=tn+1+(lower)\omega(t)=t^{n+1}+(\text{lower}), so ω(n+1)(t)=(n+1)!\omega^{(n+1)}(t)=(n+1)! (a constant).

Hence g(n+1)(t)=f(n+1)(t)K(n+1)!.g^{(n+1)}(t)=f^{(n+1)}(t)-K\,(n+1)!.

Step 6 — Evaluate at ξ\xi. Since g(n+1)(ξ)=0g^{(n+1)}(\xi)=0: 0=f(n+1)(ξ)K(n+1)!    K=f(n+1)(ξ)(n+1)!.0=f^{(n+1)}(\xi)-K(n+1)! \;\Rightarrow\; K=\frac{f^{(n+1)}(\xi)}{(n+1)!}.

Step 7 — Substitute back. From Step 1, f(xˉ)pn(xˉ)=Kω(xˉ)=f(n+1)(ξ)(n+1)!ω(xˉ).f(\bar x)-p_n(\bar x)=K\,\omega(\bar x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}\,\omega(\bar x).\qquad\blacksquare

Figure — Error in polynomial interpolation

HOW to use it — error bound

We rarely know ξ\xi, so we bound it. Let Mn+1=max[a,b]f(n+1)(x)M_{n+1}=\max_{[a,b]}|f^{(n+1)}(x)|. Then E(x)Mn+1(n+1)!ω(x),ω(x)i=0nxxi.|E(x)| \le \frac{M_{n+1}}{(n+1)!}\,|\omega(x)|,\qquad |\omega(x)|\le \prod_{i=0}^n |x-x_i|.


Worked examples


Common mistakes (steel-manned)


Recall Feynman: explain it to a 12-year-old

Imagine connecting dots on a graph with a smooth curve. You only know the height at the dots. Between dots you're guessing. How wrong can your guess be? Two things matter: how far you are from the nearest dots (the ω\omega part — the more dots nearby, the safer), and how twisty the real line is (the derivative part — a straight road is easy to guess, a roller-coaster is not). The formula just multiplies "twistiness" by "distance from dots" and divides by a big factorial that softens it. Surprisingly, packing dots more tightly near the edges (Chebyshev) makes the worst guess much better.


Active recall

What is the interpolation error formula for degree-nn interpolation?
E(x)=f(x)pn(x)=f(n+1)(ξ)(n+1)!i=0n(xxi)E(x)=f(x)-p_n(x)=\dfrac{f^{(n+1)}(\xi)}{(n+1)!}\prod_{i=0}^n (x-x_i), with ξ(a,b)\xi\in(a,b).
What smoothness condition does the error formula require?
fCn+1[a,b]f\in C^{n+1}[a,b], i.e. ff has n+1n+1 continuous derivatives.
What is the node polynomial ω(x)\omega(x)?
ω(x)=i=0n(xxi)\omega(x)=\prod_{i=0}^n (x-x_i), which vanishes at every interpolation node.
In the derivation, why does pn(n+1)0p_n^{(n+1)}\equiv 0?
Because pnp_n has degree n\le n, differentiating n+1n+1 times kills it.
What gives the (n+1)!(n+1)! in the denominator?
ω(t)=tn+1+\omega(t)=t^{n+1}+\dots so ω(n+1)(t)=(n+1)!\omega^{(n+1)}(t)=(n+1)!, appearing when Rolle's theorem is applied n+1n+1 times.
How many zeros does the helper g(t)g(t) have, and why?
At least n+2n+2: one at each of the n+1n+1 nodes plus one at the chosen point xˉ\bar x.
Error bound for linear interpolation with spacing hh?
Eh28maxf|E|\le \dfrac{h^2}{8}\max|f''|.
Maximum of ω|\omega| for two nodes occurs where?
At the midpoint, value h2/4h^2/4.
What is the Runge phenomenon?
With equally spaced nodes, increasing the degree can make the interpolation error blow up near the endpoints (e.g. for 1/(1+25x2)1/(1+25x^2)).
Which two factors control the size of the interpolation error?
The high derivative f(n+1)f^{(n+1)} (function's curviness, not controllable) and ω(x)\omega(x) (node placement, controllable).
Why do Chebyshev nodes help?
They cluster near the endpoints and minimise maxω(x)\max|\omega(x)|, reducing worst-case error and avoiding Runge oscillations.
For n+1n+1 equally spaced nodes, the error is what order in hh?
O(hn+1)O(h^{\,n+1}) for sufficiently smooth ff.

Connections

  • Lagrange Interpolation — builds the pnp_n whose error this is.
  • Newton Divided Differences — error term equals next divided difference f[x0,,xn,x]ω(x)f[x_0,\dots,x_n,x]\,\omega(x).
  • Taylor's Theorem with Remainder — limiting case as all nodes coalesce.
  • Rolle's Theorem / Mean Value Theorem — engine of the derivation.
  • Runge Phenomenon and Chebyshev Nodes — node-choice consequences.
  • Numerical Integration — Newton–Cotes error inherits this ω\omega factor.

Concept Map

interpolated by

defines

assumed shape

product of x minus nodes

used to build

has n+2 zeros

yields

apply

solves for

substitute back

equals

f sampled at n+1 nodes

p_n interpolating polynomial

Error E(x) = f(x) - p_n(x)

Node polynomial omega(x)

Helper g(t) = f - p_n - K·omega

Unknown constant K

Rolle's theorem repeated

Zero xi of g^n+1

p_n^(n+1)=0 and omega^(n+1)=(n+1)!

Error formula: f^(n+1)(xi)/(n+1)! · omega(x)

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, polynomial interpolation mein hum ek unknown function f(x)f(x) ko ek polynomial pn(x)p_n(x) se replace karte hain jo diye gaye points (nodes) se exactly guzarta hai. Lekin points ke beech mein hum sirf guess kar rahe hote hain. Toh sawaal yeh hai: yeh guess kitni galat ho sakti hai? Iska answer error formula deta hai: E(x)=f(n+1)(ξ)(n+1)!ω(x)E(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}\,\omega(x), jahan ω(x)=(xxi)\omega(x)=\prod (x-x_i) saare nodes ka product hai.

Is formula ko samajhne ke do simple parts hain. Pehla part f(n+1)f^{(n+1)} — yeh batata hai function kitna "twisty" hai. Agar function bahut wiggle karta hai (high derivative bada), toh error bada. Yeh part aapke control mein nahi — function ki galti hai. Doosra part ω(x)\omega(x) — yeh aapke control mein hai, kyunki aap nodes choose karte ho. Jaha nodes paas-paas hote hain, ω\omega chhota rehta hai aur error kam. Isliye Chebyshev nodes (jo endpoints ke paas zyada dense hote hain) error ko bahut acche se kam kar dete hain.

Derivation ka trick simple hai: ek helper function banao jo nodes par aur ek chuni hui point par zero ho — total n+2n+2 zeros. Phir Rolle's theorem baar-baar lagao; har baar ek derivative ka zero milta hai, aur n+1n+1 baar mein g(n+1)g^{(n+1)} ka zero ξ\xi mil jaata hai. Wahin se (n+1)!(n+1)! aur f(n+1)(ξ)f^{(n+1)}(\xi) pop out ho jaate hain. Bilkul Taylor series ke remainder jaisa, bas single point ki jagah spread-out nodes.

Ek important warning: zyada nodes daalne se hamesha error kam nahi hota! Equally spaced nodes ke saath degree badhane par endpoints ke paas error phat sakta hai — isko Runge phenomenon kehte hain. Isliye smartly nodes choose karo ya splines use karo.

Go deeper — visual, from zero

Test yourself — Numerical Methods

Connections