hw4: 1,2,3 done

This commit is contained in:
Claudio Maggioni 2020-05-15 15:19:53 +02:00
parent b881fdd21c
commit 7aa38b7168
2 changed files with 24 additions and 0 deletions

Binary file not shown.

View File

@ -51,4 +51,28 @@ $$\max_{x \in [-1,1]} |f(x) - p(x)| \leq \frac{\max_{x \in [-1,1]} |f^{(n+1)}|}{
The statement above is true so p satisfies the error estimate:
$$\max_{x \in [-1,1]} |f(x) - p(x)| \leq 8$$
\section*{Question 2}
We first use the Lagrange method:
$$L_1(x) = \prod_{j = 0, j \neq 1}^2 \frac{x - x_j}{x_i - x_j} =
\frac{x-0}{1-0} \frac{x-3}{1-3} = -\frac{1}{2}x^2 + \frac{3}{2}x$$
$$L_2(x) = \prod_{j = 0, j \neq 2}^2 \frac{x - x_j}{x_i - x_j} =
\frac{x-0}{3-0} \frac{x-1}{3-1} = \frac{1}{6}x^2 - \frac{1}{6}x $$
$$p(x) = (-3) \cdot \left(-\frac{1}{2}x^2 + \frac{3}{2}x\right) +
1 \cdot \left(\frac{1}{6}x^2 - \frac{1}{6}x\right) =
\frac{5}{3}x^2 - \frac{14}{3}x$$
Then we use the Newtonian method:
$$a_0 = f[0] = 0, \hspace{2cm} f[1] = -3 \hspace{2cm} f[3] = 1$$
$$a_1 = f[0,1] = \frac{-3-0}{1-0} = -3, \hspace{2cm} f[1,3] = \frac{1-(-3)}{3-1} = 2 $$
$$a_2 = f[0,1,3] = \frac{2-(-3)}{3-0} = \frac{5}{3}$$
$$p(x) = \left(\frac{5}{3}(x-1)-3\right) x + 0 = \frac{5}{3}x^2 - \frac{14}{3}x$$
The interpolating polynomials are indeed equal.
\end{document}