I am suppose to approximate it in two different ways. one by just using one taylor series at one point and the other way by breaking it down into segments and integrating. Which is suppose to be more accurate. The second way is supposed to be better by the wording of the problem but it is way off?? which way is better??
I want to edit the rest of the bottom out at some point.
Using third order Taylor series to approximate around $x_0$ to find an approximation to the integral
$$ \int^{1}_{0} e^{-x^2} dx$$
Will first find the derivatives of $f(x)=e^{-x^2}$
$$ \begin{aligned} f^0 (x)&=e^{-x^2} \\ f^1(x)&= -2 xe^{-x^2} \\ f^2(x)&= e^{-x^2}(4x^2-2) \\ f^3(x) &= -4 e^{-x^2} x (2x^2-3) \end{aligned} $$
We will try to find a better approximation
$$\int^{1}_0 e^{-x^2} dx =\int^{1/4} _0 e^{-x^2} dx +\int^{1/2} _{1/4} e^{-x^2} dx +\int^{3/4} _{1/2} e^{-x^2} dx +\int^{1} _{3/4} e^{-x^2} dx $$
First evaluating from interval starting at $0$ to $1/4$ at $x_0=0$ $$ \begin{aligned} \int^{1/4}_0 T_3(x)dx &= \int^{1/4}_0 (1-x^2)dx =47/192 \approx .24479 \end{aligned} $$
Finding Taylor polynomial at $x_0=1$
$$ \begin{aligned} T_3(x;x_0=1) &= e^{-1} -2e^{-1}(x-1)^1 +\frac{1}{2!}e^{-1}(4-2)(x-1)^2 -\frac{1}{3!}4 e^{-1}(2-3)(x-1)^3 \\ &=e^{-1} -2e^{-1}(x-1)^1 + e^{-1}(x-1)^2 -\frac{1}{2*3}*4 e^{-1}*(-1)(x-1)^3 \\&= e^{-1}-2e^{-1}(x-1)+e^{-1}(x-1)^2+\frac{2}{3}e^{-1}(x-1)^3 \end{aligned} $$
Let us use a brainless computer to find the integral and save energy
$$\int^{1/2} _{1/4} T(x:x_0=1)dx= \frac{317}{512 e} \approx .22777 $$
Finding $T_3(x:x_0=-1)$
$$ \begin{aligned} T_3(x:x_0=-1) &=e^{-1} -2(-1)e^{-1}(x-(-1))^1 +\frac{1}{2!}e^{-1}(4-2)(x-(-1))^2 -\frac{1}{3!}4^{-1}(-1)(2(-1)-3)(x-(-1))^3 \\&= e^{-1}+2e^{-1}(x+1) + e^{-1} (x+1)^2 -\frac{1}{3!}4 e^{-1}(x+1)^3 \end{aligned} $$
Again from Wolfram alpha integrating for us
$$ \begin{aligned} \int^{3/4} _{1/2} T_3(x:x_0=-1) =\frac{1543}{1536*e}\approx .36956 \end{aligned} $$
Finding $T_3(x:x_0=2)$
$$ \begin{aligned} T_3(x:x_0=2) &= e^{-(2^2)}- 2 (2) e^{-(2^2)}(x-2)^1 +\frac{1}{2!} e^{-(2^2)}(4(2)^2-2)(x-2)^2 -\frac{1}{3!}4 e^{-(2^2)}(2)(2(2)^2-3)(x-2)^3 \\ &= e^{-4}-4e^{-4}(x-2) +e^{-4}6*(x-2)^2-e^{-4}\frac{20}{3}(x-2)^3 \end{aligned} $$
integrating $T_3(x:x_0=2)$ from $3/4$ to $1$ we get that
$$\int^1_{3/4} T_3(x:x_0=2)dx=\frac{1481}{1536e} $$
Adding everything together we get together
$$ \frac{47}{192}+\frac{317}{512e}+\frac{1543}{1536*e}+\frac{1481}{1536e}=1.1968$$
Matlab says that
$$ \int^{1}_{0} e^{-x^2}dx=.746824\dots $$
Which is better ?
The Maclaurin series is better
why?
Because it is way less work and it is more elegant simple and accurate. THATS WHY!


