(4)Use Error estimate for Taylor series, composite trapezoidal and composite Simpsons rule
Use Error estimate for Taylor series, composite trapezoidal and composite Simpson's rule to find n such that
and compare to numerical results.
![{\displaystyle I=\int _{0}^{1}{\frac {e^{x}-1}{x}}dx}](https://wikimedia.org/api/rest_v1/media/math/render/svg/6f84d720f5e25c6f5c7be74b38ff0ec0631227db)
Taylor Series
![{\displaystyle e^{x}=\sum _{j=0}^{\infty }{\frac {x^{j}}{j!}}\Rightarrow {\frac {e^{x}-1}{x}}=\sum _{j=1}^{\infty }{\frac {x^{j-1}}{j!}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0908fed0a55a12ecb2bc601fe8528a84dcd58570)
![{\displaystyle I_{n}=\int _{0}^{1}f_{n}(x)dx=\int _{0}^{1}\sum _{j=1}^{\infty }{\frac {x^{j-1}}{j!}}dx=\sum _{j=1}^{n}{\frac {x^{j}}{j!j}}|_{0}^{1}=\sum _{j=1}^{n}{\frac {1}{j!j}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/38331e6199ed6e5a5352cb43af8419fb0616feb3)
with
and ![{\displaystyle x_{0}=0\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/3fdb0c6300b00fbb3b9df2ac9fdc77d27f79263d)
![{\displaystyle \Rightarrow f(x)-f_{n}(x)={\frac {x^{n}}{(n+1)!}}f^{(n+1)}(\xi )}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d9d9ce030a8993559bbbcc95fb1781bdf23256f1)
![{\displaystyle E_{n}=I-I_{n}=\int _{0}^{1}\left[f(x)-f_{n}(x)\right]dx=\int _{0}^{1}\underbrace {\frac {x^{n}}{(n+1)!}} _{w(x)}\underbrace {f^{(n+1)}\left(\xi (x)\right)} _{g(x)}dx}](https://wikimedia.org/api/rest_v1/media/math/render/svg/2859777faca43e27a6683904deab21eaf49d4b78)
for ![{\displaystyle \alpha \in [0,1]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/daf3c62599ea71319c85f715c9e590d2bab2d036)
![{\displaystyle E_{n}=\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/9f44d832d9072df1156a123885d50755258e0e87)
, ![{\displaystyle \alpha ={\frac {e}{(n+1)!(n+1)}}\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0881a1b15ddf3fc824c92d842d49e7144112453f)
, ![{\displaystyle \alpha ={\frac {1}{(n+1)!(n+1)}}\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/727c7f1c1344cf538dd0f77a7dc759b37f0e14e8)
![{\displaystyle n=2,E_{2}\leq .151016\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f112bb39c35f5d1a10ef142eab48d200fb246663)
![{\displaystyle n=4,E_{5}\leq .00453\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/379363f4c2acf074ad92135e1ff00d0496feea47)
![{\displaystyle n=6,E_{6}\leq 6.2792X10^{-4}\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/11f0ed3d6485a5d02a61385a648fab118e5282ce)
![{\displaystyle n=8,E_{8}\leq 8.42X10^{-6}\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7cffb7025006810109facc293d8b8ade360d8e16)
Below are the values from Numerical Analysis of Taylor series from HW_1
![{\displaystyle n=2,E_{2}\leq .151016\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f112bb39c35f5d1a10ef142eab48d200fb246663)
![{\displaystyle n=4,E_{5}\leq .00453\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/379363f4c2acf074ad92135e1ff00d0496feea47)
![{\displaystyle n=6,E_{6}\leq 6.2792X10^{-4}\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/11f0ed3d6485a5d02a61385a648fab118e5282ce)
![{\displaystyle n=8,E_{8}\leq 8.42X10^{-6}\,}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7cffb7025006810109facc293d8b8ade360d8e16)
We are getting same values from both analysis for Taylor series
Trapazoidal Rule
Error for Composite Trapazoidal rule is given by
where
for
For the given function
, we have
For the given interval [0,1] the maximum value of function
is achieved at
Below are the results from Numerical analysis from HW 1
We can see that we are getting order
at n=128 from both the analysis.
Composite Simpsons Rule
The error estimate of the Composite Simpson's rule is given as
where
for
For the given function
, we have
The function
has maximum value at
Below are the results from Numerical analysis from HW 1
We can see that we are getting order
at n=4 from both the analysis.