Interpolation: Function Approximation
Given a function \(f\colon [a,b] \to \mathbb{R}\), we want to find a polynomial of degree at most \(n\) that will approximate \(f\).
Theorem (Weierstrass): Given \(f\in \mathcal{C}([a,b])\), then for every \(\varepsilon > 0\) there exists a polynomial \(p\) such that \[\left\lvert f(x) - p(x)\right\rvert < \varepsilon\] for every \(x \in [a,b]\).
Problem: we do not know what the degree of \(p\) is.
Idea: Pick \(n+1\) points \(x_0, x_1, \dots, x_n\) in the interval \([a,b]\), define \(y_i = f(x_i)\) for \(i = 0, 1, \dots, n\), and interpolate this data using a Newton’s polynomial \(p\).
Then the degree of \(p\) is at most \(n\), and \(p(x_i) = f(x_i)\) for each \(i = 0, 1, 2, \dots, n\).
Question: How close is \(p(x)\) to \(f(x)\) if \(x \in [a,b]\) is not one of the \(x_i\)’s?
Theorem: Let \(x_0, x_1, \dots, x_n\) be distinct numbers in the interval \([a,b]\), and let \(f\in \mathcal{C}^{n+1}([a,b])\). Let \(p\) be the unique polynomial of degree at most \(n\) that interpolates the data \(\{(x_i, f(x_i))\mid i = 0, 1, \dots, n\}\). Then for each \(x \in [a,b]\), there is a \(\xi \in (a,b)\) such that \[f(x) - p(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!}\prod_{i=0}^n (x - x_i).\]
Proof:
\[f(x) - p(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!}{\color{red}{\prod_{i=0}^n (x - x_i)}}.\]
How large can \(\displaystyle \prod_{i=0}^n (x - x_i)\) be?
Let \(h = \frac{b-a}{n}\), and define \(x_i = a + ih\) for \(i = 0, 1, \dots, n\). Then for any \(x \in [a,b]\),
\[\prod_{i=0}^n \left\lvert x - x_i\right\rvert \le \frac{1}{4}h^{n+1} n!\]
Proof: The inequality is true if \(x = x_j\) for some \(j\).
Otherwise, there must be \(j\) such that \(x_j < x < x_{j+1}\).
We will use the following estimates:
What is the maximum of \((x - x_j)(x_{j+1} - x)\) on \([x_j, x_{j+1}]\)?
\[\begin{aligned} \prod_{i=0}^n \left\lvert x - x_i\right\rvert &< \prod_{i=0}^{j-1}(j - i + 1)h \cdot \frac{h^2}{4}\cdot\prod_{i=j+2}^n(i - j)h\\ &= \frac{1}{4}h^{j + 2 + n - j - 1}\prod_{i=0}^{j-1}(j - i + 1)\cdot \prod_{i=j+2}^n(i - j)\\ &= \frac{1}{4}h^{n+1}\prod_{k=2}^{j+1}k\cdot\prod_{k=2}^{n-j}k\\ &= \frac{1}{4}h^{n+1}(j+1)!(n-j)!\\ &= \frac{1}{4}h^{n+1}{\color{green}1\cdot 2\cdot 3 \cdots (j+1)}{\color{blue}\cdot 2\cdot 3 \cdots(n-j)}\\ &\le \frac{1}{4}h^{n+1}{\color{green}1\cdot 2\cdot 3 \cdots (j+1)}{\color{blue}\cdot (j+2)\cdot(j + 3)\cdots(j + n-j)}\\ &= \frac{1}{4}h^{n+1}n! \end{aligned}\]
\[\begin{aligned} \left\lvert f(x) - p(x)\right\rvert &= \frac{\left\lvert f^{(n+1)}(\xi)\right\rvert}{(n+1)!}{\color{red}{\prod_{i=0}^n \left\lvert x - x_i\right\rvert}}\\ &\le \frac{\left\lvert f^{(n+1)}(\xi)\right\rvert}{(n+1)!}{\color{red}{\frac{1}{4}h^{n+1}n!}}\\ &= \frac{\left\lvert f^{(n+1)}(\xi)\right\rvert}{4(n+1)}\left(\frac{b-a}{n}\right)^{n+1} \end{aligned}\]