4.8.10Numerical Methods

Polynomial interpolation — Lagrange form, Newton's divided differences

1,694 words8 min readdifficulty · medium2 backlinks

1. The problem & why one polynomial exists

WHY distinct nodes matter: if xi=xjx_i=x_j but yiyjy_i\ne y_j you ask a function to take two values at one point — impossible. Distinctness makes the Vandermonde determinant i<j(xjxi)0,\prod_{i<j}(x_j-x_i)\ne 0, so the system has a unique solution.


2. Lagrange form — build it from "switches"

HOW to build Li(x)L_i(x). I need zeros at all xjx_j with jij\ne i. So put those factors in: numerator=ji(xxj).\text{numerator}=\prod_{j\ne i}(x-x_j). This is zero at every other node. To make it =1=1 at xix_i, divide by its own value there:


3. Newton's divided differences — build it incrementally

Figure — Polynomial interpolation — Lagrange form, Newton's divided differences

4. Error of interpolation


5. Common mistakes (Steel-manned)


Recall Feynman: explain to a 12-year-old

Imagine you have a few dots on graph paper and you want one smooth bendy line through ALL of them. Polynomial interpolation is the rule for that line. The Lagrange way: for each dot, build a special bump-curve that is exactly 1 on its own dot and 0 on all the others. Stack the bumps, each scaled by its dot's height. The line is forced through every dot. The Newton way: start with the first dot. Add a correction so it also hits the second. Add another correction that's zero at the first two so it hits the third — and so on. Each correction is a "fix" that never breaks earlier fixes. Both ways draw the same line — they're just two recipes.


Connections

  • Vandermonde matrix — why interpolation has a unique solution.
  • Runge phenomenon — why high-degree equispaced interpolation fails.
  • Chebyshev nodes — node placement that tames the error product.
  • Cubic splines — piecewise low-degree alternative.
  • Numerical differentiation — derivatives via differentiating P(x)P(x).
  • Newton-Cotes quadrature — integrating the interpolant.
  • Taylor series — limit of divided differences as nodes coalesce (f[x0,,xk]f(k)/k!f[x_0,\dots,x_k]\to f^{(k)}/k!).

Why does a unique interpolating polynomial of degree ≤ n exist for n+1 distinct nodes?
The Vandermonde system is square with nonzero determinant i<j(xjxi)\prod_{i<j}(x_j-x_i) when nodes are distinct, so the coefficients are uniquely determined.
Define the Lagrange basis polynomial Li(x)L_i(x).
Li(x)=jixxjxixjL_i(x)=\prod_{j\ne i}\frac{x-x_j}{x_i-x_j}; it equals 1 at xix_i and 0 at every other node.
What property of LiL_i makes P(x)=yiLi(x)P(x)=\sum y_i L_i(x) interpolate?
Li(xk)=δikL_i(x_k)=\delta_{ik}, so at each node only one term survives, giving P(xk)=ykP(x_k)=y_k.
Give the recursive definition of a divided difference.
f[xi,,xi+k]=f[xi+1,,xi+k]f[xi,,xi+k1]xi+kxif[x_i,\dots,x_{i+k}]=\dfrac{f[x_{i+1},\dots,x_{i+k}]-f[x_i,\dots,x_{i+k-1}]}{x_{i+k}-x_i}, with f[xi]=yif[x_i]=y_i.
Write Newton's forward interpolation polynomial.
P(x)=k=0nf[x0,,xk]j=0k1(xxj)P(x)=\sum_{k=0}^n f[x_0,\dots,x_k]\prod_{j=0}^{k-1}(x-x_j).
Why can you add a data point cheaply in Newton's form but not Lagrange's?
The new Newton term has factor (xxj)\prod(x-x_j) that vanishes at old nodes, so just append one term; Lagrange requires recomputing every basis LiL_i.
Are Lagrange and Newton interpolants the same polynomial?
Yes — by uniqueness they are identical; only the algebraic form differs.
State the interpolation error formula.
f(x)P(x)=f(n+1)(ξ)(n+1)!i=0n(xxi)f(x)-P(x)=\dfrac{f^{(n+1)}(\xi)}{(n+1)!}\prod_{i=0}^n(x-x_i) for some ξ\xi in the interval.
Why does interpolation error grow near interval ends?
The factor (xxi)\prod(x-x_i) becomes large there (Runge phenomenon), inflating the error.
Is the divided difference f[x0,,xk]f[x_0,\dots,x_k] symmetric in its nodes?
Yes — reordering nodes does not change its value; it equals the leading coefficient of the interpolating polynomial.

Concept Map

guarantees

proves

distinctness makes

written two ways

written two ways

builds

weakness: recompute all

motivates

coefficients of

strength

same curve as

n+1 points distinct x_i

Unique polynomial deg <= n

Vandermonde matrix invertible

Lagrange form

Newton form

Basis L_i = 1 at x_i, 0 elsewhere

Add point rebuilds everything

Divided differences slope of slopes

Add point appends one term

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, idea simple hai: tumhare paas kuch points hain (x,y) aur tum chahte ho ek smooth polynomial curve jo exactly har point ke through jaaye. Agar n+1n+1 distinct points hain to ek hi unique polynomial degree n\le n ka exist karta hai — yeh guarantee Vandermonde matrix ke invertible hone se aati hai. Distinct xix_i zaroori hai, warna ek hi point pe do values impossible ho jaayengi.

Lagrange form ka jugaad yeh hai: har node ke liye ek "switch" banao Li(x)L_i(x) jo apne node pe 11 ho aur baaki sab nodes pe 00. Switch banane ke liye numerator mein (xxj)(x-x_j) daalo taaki doosre nodes pe zero ho jaaye, phir apni value se divide kar do taaki apne node pe 11 bane. Phir P(x)=yiLi(x)P(x)=\sum y_i L_i(x) — har node pe sirf ek switch on rehta hai, baaki off. Bas curve fit ho gaya.

Newton's divided differences isi kaam ko incremental tareeke se karta hai. Pehle dot se shuru karo, phir ek term add karo jo second dot ko fix kare, phir teesra term jo pehle do nodes pe zero ho taaki purana kaam na bigde. Yeh "slope of slopes" table banake top diagonal padh lo — wahi coefficients hain. Faayda: naya data point aaye to bas ek term append karna padta hai, poora dobara nahi karna.

Dono forms same polynomial dete hain (uniqueness theorem), bas likhne ka tareeka alag hai. Aur ek warning: zyada points se zyada degree lene se curve ends pe wildly oscillate karta hai (Runge phenomenon), kyunki error mein (xxi)\prod(x-x_i) ka factor bada ho jaata hai. Isliye exam aur real life dono mein splines ya Chebyshev nodes better hote hain.

Go deeper — visual, from zero

Test yourself — Numerical Methods

Connections