User:Egm6341.s10.Team4.yunseok/HW2

= Problem 5: Comparison of Error between Taylor series and Newton-Cotes formula =

Given
Refer Lecture slide 11-1 for problem statement
 * {| style="width:100%" border="0" align="left"

f(x) = \sin(x) $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle x \in [0,\pi] $$
 * $$\displaystyle \longrightarrow (1)


 * }.
 * }.

Find
'''Find n at
 * {| style="width:100%" border="0" align="left"

\left | f^T_n\Big(\frac{7\pi}{8}\Big)-f\Big(\frac{7\pi}{8}\Big) \right | \le \underbrace{\left | f^L_4\Big(\frac{7\pi}{8}\Big)-f\Big(\frac{7\pi}{8}\Big) \right |}_{\left | E^L_4(\frac{7\pi}{8})\right |} \le \frac{\left | q_5(\frac{7\pi}{8}) \right |}{5!} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (2)


 * }.
 * }.

Solution
$$\displaystyle f^L_4\Big(\frac{7\pi}{8}\Big)$$, $$\displaystyle \left | E^L_4(\frac{7\pi}{8})\right |$$, $$\displaystyle \frac{\left | q_5(\frac{7\pi}{8}) \right |}{5!}$$, is claculated using Matlab.


 * $$\displaystyle f^L_4\Big(\frac{7\pi}{8}\Big) = \sum_{i=0}^4 l_{i,4}\Big(\frac{7\pi}{8}\Big)\sin(x_i)= 0.3812$$
 * $$\displaystyle \left | E^L_4(\frac{7\pi}{8})\right | = 0.0014808$$
 * $$\displaystyle \frac{\left | q_5(\frac{7\pi}{8}) \right |}{5!} = 0.0081716$$

At first, we can confirm that the seconde inequality of Equation(2)


 * {| style="width:100%" border="0" align="left"

\left | E^L_4(\frac{7\pi}{8})\right | = 0.0014808 \le \displaystyle \frac{\left | q_5(\frac{7\pi}{8}) \right |}{5!} = 0.0081716 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (3)


 * }.
 * }.

Then, the Taylor series were calculated until the Error or taylor become smaller than that of Newton-Cotes formula at n=4. the result is like that

$$ \begin{array}\hline{|c||c|c|} n & E^T_n(t) & E^T_n(t) - E^L_4(t) \\ \hline 1&1.7128&1.7113\\ 2&0.34976&0.3483\\	3&0.54236&0.5409\\ 4&0.10444&0.1030\\ 5&0.067533&0.0661\\	6&0.011256&0.0098\\	7&0.0045295&0.0030\\	8&0.00065513&-0.0008\\ \hline \end{array} $$