A rearranged form of Newton’s divided difference polynomial.
The k-th Lagrange basis polynomial for n+1 nodes is:
Ln,k(x)=i=0i=k∏nxk−xix−xi
Here:
- x0,x1,…,xn: the n+1 distinct data points (nodes)
- Ln,k(xk)=1 and Ln,k(xi)=0 for i=k
The n-th Lagrange interpolating polynomial through the data (xk,f(xk)) is:
Pn(x)=k=0∑nLn,k(x)f(xk)
Example
Interpolate through (1,1), (2,4), (3,9) (i.e., f(x)=x2).
Basis polynomials for n=2:
L2,0(x)=(1−2)(1−3)(x−2)(x−3)=2(x−2)(x−3)
L2,1(x)=(2−1)(2−3)(x−1)(x−3)=−(x−1)(x−3)
L2,2(x)=(3−1)(3−2)(x−1)(x−2)=2(x−1)(x−2)
P2(x)=1⋅2(x−2)(x−3)−4(x−1)(x−3)+9⋅2(x−1)(x−2)
At x=4: L2,0(4)=1, L2,1(4)=−3, L2,2(4)=3, so:
P2(4)=1(1)+4(−3)+9(3)=1−12+27=16=42✓