a) Calculate the Lagrange Interpolationpolynomial $p$ for the function $f(x) = \sin (\pi x)$ for the points $x_0 = 0, \ x_1 = 0.5 , \ x_2 = 1$.
b) Then estimate the maximum interpolation error on the interval $[0,1]$ with the help of the error function $f(x)-p(x)=\frac{f^{(n+1)}(\xi_x)}{3!}\prod_{j=0}^n(x-x_j)$ from above. To do this, determine the extremes of the node polynomial exactly.
c) The below picture represents the explicit error function $h(x):= | f(x)− p(x)|$ in the interval $[0,1]$. Interpret this graphic. Is the limit calculated above is a sharp boundary, i.e. there is an $x \in [0,1]$ so that $h(x)$ is equal to the boubdary?
d) How does the interpolation error behave with a steady increase in the number of points?
$$$$
$$$$
I have done the following :
a) We have \begin{align*}&f(x_0)=f(0)=\sin (\pi\cdot 0)=0 \\ & f(x_1)=f(0.5)=\sin (\pi\cdot 0.5)=1\\ & f(x_2)=f(1)=\sin (\pi\cdot 1)=0\end{align*} so we get \begin{align*}&p_2(x)=f(x_0)L_0(x)+f(x_1)L_1(x)+f(x_2)L_2(x) \\ & =0\cdot L_0(x)+1\cdot L_1(x)+0\cdot L_2(x)\\ & = L_1(x)\\ & = 4 x - 4 x^2 \end{align*}
b) We have that \begin{align*}f(x)-p_2(x)&=\frac{f^{(3)}(\xi_x)}{3!}\prod_{j=0}^2(x-x_j)\\ & = \frac{1}{6}\cdot \left (\sin (\pi \xi_x)\right )'''\cdot (x-x_0)(x-x_1)(x-x_2) \\ & = \frac{1}{6}\cdot \left (-\pi^3\cos (\pi \xi_x)\right )\cdot (x-0)(x-0.5)(x-1) \\ & = -\frac{\pi^3}{6}\cdot \cos (\pi \xi_x)\cdot (0.5 x - 1.5 x^2 + x^3)\\ & \leq -\frac{\pi^3}{6}\cdot \max_{\xi_x\in [0.1]}\cos (\pi \xi_x)\cdot \max_{x\in[0,1]}(0.5 x - 1.5 x^2 + x^3)\end{align*}
It holds that $\max_{\xi_x\in [0.1]}\cos (\pi \xi_x)=1$ since the maximum is at $\xi_x=0$.
It holds that $\max_{x\in[0,1]}(0.5 x - 1.5 x^2 + x^3)=0.5 \cdot \left (\frac{3-\sqrt{3}}{6}\right ) - 1.5 \left (\frac{3-\sqrt{3}}{6}\right )^2 + \left (\frac{3-\sqrt{3}}{6}\right )^3=\frac{1}{12\sqrt{3}}$.
So we get \begin{align*}f(x)-p_2(x)& \leq -\frac{\pi^3}{6}\cdot \max_{\xi_x\in [0.1]}\cos (\pi \xi_x)\cdot \max_{x\in[0,1]}(0.5 x - 1.5 x^2 + x^3)\\ & \leq -\frac{\pi^3}{6}\cdot 1\cdot \frac{1}{12\sqrt{3}}\\ & = -\frac{\pi^3 \sqrt{3}}{216}\end{align*} is this correct? Or do we ha to take the absolute value?
c) The picture is the function that I got before I calculated the maximum with the absolute value, right? The boundary that I got is just a line above the function which is not sharp since there is no $x$ so that $h(x)$ to get this value, right?
d) Could you give me a hint? Would we get a better boundary if we had more points in question (a) ?
