[Math] How to evaluate $\int_0^1 \mathrm e^{-x^2} \,\mathrm dx$ using power series

calculusdefinite integralsintegrationpower series

I'm trying to evaluate
$$\int_0^1 \mathrm e^{-x^2} \, \mathrm dx$$
using power series.

I know I can substitute $x^2$ for $x$ in the power series for $\mathrm e^x$:
$$1-x^2+ \frac{x^4}{2}-\frac{x^6}{6}+ \cdots$$
and when I calculate the antiderivative of this I get
$$x-\frac{x^3}{3}+ \frac{x^5}{5\cdot2}-\frac{x^7}{7\cdot6}+ \cdots$$

How do I evaluate this from $0$ to $1$?

Best Answer

Just collecting the material in the comments and converting it into answer. We have $$ e^{-x^2}=\sum_{n\geq 0}\frac{(-1)^n x^{2n}}{n!} $$ where the series in the RHS is absolutely convergent for any $x\in\mathbb{R}$, since $e^{-x^2}$ is an entire function. If we apply $\int_{0}^{1}(\ldots)\,dx$ to both sides we get $$ \int_{0}^{1}e^{-x^2}\,dx = \sum_{n\geq 0}\frac{(-1)^n}{n!(2n+1)} $$ since the absolute convergence is more than enough to ensure we are allowed to exchange $\int$ and $\sum$. The last series has terms with alternating signs which are decreasing in absolute value, hence the numerical value of such series is between any two consecutive partial sums. For instance, by considering the partial sums up to $n=1$ and $n=2$ we get $$ I=\int_{0}^{1}e^{-x^2}\,dx \in \left(\frac{2}{3},\frac{2}{3}+\frac{1}{10}\right).$$


Can we improve such approximation in a slick way? Yes, of course. For instance, through integration by parts and a bit of patience we may check that $$ \int_{0}^{1}\underbrace{\left(\frac{16}{93}x^4(1-x)^4+\frac{8}{9}x^3(1-x)^3\right)}_{\in\left[0,\frac{1}{68}\right]\text{ for any }x\in[0,1]}e^{-x^2}\,dx = \frac{100}{279}-\frac{44}{93} I $$ hence the actual value of $I$ is quite close to $\frac{100}{279}\cdot\frac{93}{44}=\color{blue}{\large\frac{25}{33}}$. Actually the error function has a well-known continued fraction expansion from which it is simple to derive the more accurate approximation $\color{blue}{\large\frac{56}{75}}$. $I\geq e^{-1/3}$ is a straightforward consequence of Jensen's inequality. By replacing the polynomials $x^3(1-x)^3$ and $x^4(1-x)^4$ with suitable multiples of the shifted Legendre polynomials $P_4(2x-1)$ and $P_5(2x-1)$ we get the remarkable approximation $I\approx\color{blue}{\large\frac{6171}{8263}}$ which differs from the exact value by less than $10^{-6}$, but the best rational approximation with such accuracy is $\color{blue}{\large\frac{823}{1102}}$.

Related Question