Calculate a definite integral using Maclaurin series to a certain error bound.

662 Views Asked by At

I'm trying to approximate $$\int_0^1 e^{x^2}dx$$ using a Maclaurin series to a certain degree of error, namely less than 0.0005 from the actual value. I've boiled down the calculation of the integral by converting it to the Maclaurin series for $e^{x^2}$ and integrate it which is $$\sum_{n=0}^{\infty}\frac{x^{2n+1}}{(2n+1)n!}$$ to $$\sum_{n=0}^{\infty}\frac{1^{2n+1}}{(2n+1)n!} -\sum_{n=0}^{\infty}\frac{0^{2n+1}}{(2n+1)n!}$$ The above series can be simplified to $$\sum_{n=0}^{\infty}\frac{1^{2n+1}}{(2n+1)n!}$$ So, I don't quite get how to proceed from here on. Most of the materials I've read for calculating the error bound assume that the series is alternating or it can be substituted by a function which then can be integrated. As you can see the series includes the factorial expression which as far as I know can't be integrated.

1

There are 1 best solutions below

2
On

It is not difficult to bound $\sum_{n\geq N}\frac{1}{(2n+1)n!}$, since $$ \frac{1}{(n+1)!}-\frac{1}{(n+2)!} = \frac{1}{(n+2)n!} $$ implies that $\sum_{n\geq N}\frac{1}{(2n+1)n!}$ is roughly $\frac{1}{2(N+1)!}$.
Anyway, an effective technique for approximating $\mathcal{J}=\int_{0}^{1}e^{x^2}\,dx$ is the following one. The function $g(x)=x^4(1-x)^4$ is non-negative and bounded by $\frac{1}{2^8}$ on $[0,1]$, and by integration by parts $$ \int_{0}^{1}x^4(1-x)^4 e^{x^2}\,dx = -8+\frac{81}{16}e-\frac{63}{16}\mathcal{J} $$ hence the error of the approximation $\mathcal{J}\approx \frac{81e-128}{63}=\color{green}{1.46}319\ldots$ is less than $10^{-3}$.
A similar accuracy can be achieved through the composite Simpson's rule, since $e^{x^2}$ has an approximately quadratic behaviour on $[0,1]$: $$ \mathcal{J}\approx \frac{\exp\left(0\right)+4\exp\left(\tfrac{1}{16}\right)+2\exp\left(\tfrac{1}{4}\right)+4\exp\left(\tfrac{9}{16}\right)+\exp\left(1\right)}{12}=\color{green}{1.46}371\ldots $$ On the other hand $$ \mathcal{J}\approx \sum_{n=0}^{6}\frac{1}{(2n+1)n!} = \color{green}{1.4626}369\ldots $$