Interpolation polynomial of degree at most n

957 Views Asked by At

I came across to this type of a question and I don't know how to solve it

let's say

f(x) = cosx and we are given x0 = 0, x1 = 0.6 and x2 = 0.9

In the question it is asked to construct interpolation polynomials of degree at most one and at most two.

The part I do not understand is that which points I am to choose out of these 3 points to construct a polynomial of degree 1. Thanks

2

There are 2 best solutions below

2
On

$$f(x_0)=\cos(0)=1 \\ f(x_1)=\cos(0.6) \\ f(x_2)=\cos(0.9) $$

Now, it is easy to show that there exists a polynomial $g(x)=aX^2+bX+c$ which is not constant such that $$g(x_0)=f(x_0) \\ g(x_1)=f(x_1) \\ g(x_2)=f(x_2) \\$$

All you have to do to find $g$ is solve the following system for $a,b,c$ $$c=1 \\ a (0.6)^2+b(0.6)+c=\cos(0.6) \\ a (0.9)^2+b(0.9)+c=\cos(0.9) $$

This is what interpolation polynomial usually means.

0
On

In general, the idea with linear approximation is that every differentiable function is roughly linear, on a local scale anyway. You can obtain a line between any two points, and in general the approximation is better when you choose points closest to the point you want to approximate - in your case, the best choice will be the points $(0,1)$ and $(0.6, \cos(0.6))$. Linear approximation methods will let you find the line between these points, then you just plug in $0.45$ to find the approximation.

The answer given by N.S. is pretty perfect for the quadratic polynomial section of the question.

As to why locality improves the approximation, the intuition is that a differentiable function can only change so much over a small interval, and as the interval gets smaller, the amount the function is allowed to "misbehave" becomes smaller as well. As to why a higher order approximation (usually) provides better results, the intuition is that an arbitrary smooth function likely has non-negligible curvature, and higher order polynomials are (usually) better able to fit that curvature.

The error bound for a degree $n$ polynomial approximation is $$\left|f(x)-p_n(x)\right| \leq \dfrac{\max \left|f^{(n+1)}(t)\right|}{(n+1)!}\prod_{i=0}^n \left|x-x_i\right|$$ So, if we want to minimize the potential error, we choose points that are closer to the $x$ we want to approximate, since this reduces the product-of-distances portion. Since we are working with $\cos(x)$, I'm going to be lazy and say the magnitude of every derivative is bounded by $1$, so the error is bounded by $$\dfrac{1}{(n+1)!}\prod_{i=0}^n \left|x-x_i\right|$$ Thus, we see that as $n$ increases, our error decreases approximately as $n!$, as long as we continue choosing close test points. Numerically, the error of the linear approximation is bounded by $\frac{1}{2}(0.45)(0.15) = 0.03375$, and the quadratic by $\frac{1}{6}(0.45)(0.15)(0.45) = 0.0050625$.

Helpful Wikipedia reference: https://en.wikipedia.org/wiki/Polynomial_interpolation