Interpolation
Interpolation
Given $n+1$ data points $(x_0,y_0), \ldots, (x_n,y_n)$ with distinct $x_i$, there is a unique polynomial of degree $\leq n$ passing through all points.
$$P(x) = \sum_{i=0}^{n} y_i \prod_{\substack{j=0 \\ j\neq i}}^{n} \frac{x-x_j}{x_i-x_j}$$
$$P(x) = f[x_0] + f[x_0,x_1](x-x_0) + f[x_0,x_1,x_2](x-x_0)(x-x_1) + \cdots$$
where $f[x_i,x_{i+1}] = \frac{f[x_{i+1}]-f[x_i]}{x_{i+1}-x_i}$.
Find the Lagrange polynomial through $(1,1)$, $(2,4)$, $(3,9)$.
$P(x) = 1\cdot\frac{(x-2)(x-3)}{(1-2)(1-3)} + 4\cdot\frac{(x-1)(x-3)}{(2-1)(2-3)} + 9\cdot\frac{(x-1)(x-2)}{(3-1)(3-2)}$
$= \frac{(x-2)(x-3)}{2} - 4(x-1)(x-3) + \frac{9(x-1)(x-2)}{2} = x^2$.
Compute divided differences for $(0,1)$, $(1,3)$, $(2,7)$.
$f[x_0,x_1] = (3-1)/(1-0)=2$. $f[x_1,x_2]=(7-3)/(2-1)=4$.
$f[x_0,x_1,x_2]=(4-2)/(2-0)=1$.
$P(x) = 1 + 2x + 1 \cdot x(x-1) = x^2+x+1$.
Use the polynomial from Ex. 2 to estimate $f(1.5)$.
$P(1.5) = 2.25+1.5+1 = 4.75$.
Practice Problems
Show Answer Key
1. $P(x) = 2+3(x-1)$; $P(2) = 5$
2. $P(x) = 1-x$
3. At most 3
4. $f[0,1]=1$, $f[1,2]=7$, $f[0,1,2]=3$. $P(x)=x+3x(x-1)=3x^2-2x$
5. Oscillation at edges with high-degree polynomials on equally spaced points
6. $P(x) = 1-\frac{x(x-2)}{2}+5\cdot\frac{x(x-1)}{2}$; compute $P(1.5) \approx 3.25$
7. Easier to add new points without recomputing everything
8. The $(n+1)$th derivative of $f$
9. Slope $= 9/3 = 3$. $f(3) \approx 4+3(1) = 7$
10. No — interpolation passes through all points; curve fitting minimizes error
11. Many data points or need smoothness without high-degree oscillation
12. $1$ (the leading coefficient)