Polynomial interpolation

Database › Mathematics › Applied mathematics › Numerical analysis

NUM-0005MethodUndergraduate

Through n + 1 points passes a unique polynomial of degree n (Lagrange form); its error is f⁽ⁿ⁺¹⁾(ξ)/(n+1)! times the product of distances to the nodes, and high-degree fits on equally spaced points can oscillate wildly (Runge).

$$P(x)=\sum_{i=0}^nf_i\prod_{j\ne i}\frac{x-x_j}{x_i-x_j},\qquad f(x)-P(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}\prod_{i=0}^n(x-x_i)$$

Explanation

Uniqueness follows because the difference of two such polynomials has $n+1$ roots (equivalently, the Vandermonde determinant is non-zero). Newton's divided-difference form gives the same polynomial but lets nodes be added one at a time.

The node product grows near the ends of an equally spaced grid, so high degree is dangerous; Chebyshev nodes minimize it, and piecewise low-degree fits (cubic splines, continuous through the second derivative) are usually preferred. Linear interpolation has error at most $\frac{h^2}8\max|f''|$. Interpolating polynomials underlie quadrature and finite-difference formulas.

Example 1

Interpolate $\sqrt x$ through $x=1,4,9$ and estimate $\sqrt5$.

Solution

At $x=5$ the Lagrange weights are $-\frac16$, $\frac{16}{15}$, $\frac1{10}$: $P(5)=-\frac16+\frac{32}{15}+\frac3{10}=2.267$ (true 2.236).

Example 2

Table values of $\sin x$ are given every $0.1$ rad. Bound the error of linear interpolation.

Solution

$|f-P|\le\frac{h^2}8\max|f''|=\frac{0.01}8\times1=1.25\times10^{-3}$.

Related entries