Why can’t I convert to polar for $\int_0^1 e^{-x^2}dx$

74 Views Asked by At

I tried to apply the common technique for the Gaussian integral but I changed a bound: \begin{align} I &= \int_0^1 e^{-x^2}dx \\[2mm] I^2 &= \left( \int_0^1 e^{-x^2}dx\right) \cdot \left( \int_0^1 e^{-y^2}dy \right) \\[2mm] &= \int_0^1\int_0^1 e^{-(x^2+y^2}dxdy \\[2mm] \textrm{Changing to polar:}& \, x^2 + y^2 = r^2 \, ,\, \,\textrm{and} \,\, \, , dydx=dA = rdrd\theta \\[2mm] e^{-r^2} \,\textrm{ has circular symmetry}& \textrm{meaning that I can integrate it from} \, 0 \to 2\pi \\[2mm] &= \int_0^{2\pi}d\theta\int_0^1 re^{-r^2}dr \\[2mm] &= \pi\left(1-\frac{1}{e} \right) \\[2mm] I &= \sqrt{\pi-\frac{\pi}{e}} \end{align} Which turns out to be wrong. Where did I go wrong. thanks

5

There are 5 best solutions below

0
On BEST ANSWER

I'll focus on three issues: why your reasoning was wrong, what a corrected version of your idea obtains, and why you'll still need a numerical method at some point.

The region $0\le x\le1,\,0\le y\le1$ is not equivalent to $0\le\theta\le2\pi,\,0\le r\le1$. It's actually equivalent to $0\le r\le\sqrt{2},\,\theta_\min(r)\le\theta\le\tfrac12\pi-\theta_\min(r)$ with $\theta_\min(r):=\arccos\min\{1,\,\tfrac1r\}$. So$$\begin{align}I^2&=\int_0^1re^{-r^2}dr\int_0^{\pi/2}d\theta+\int_1^2re^{-r^2}dr\int_{\arccos\tfrac1r}^{\pi/2-\arccos\tfrac1r}d\\&=\tfrac12\pi\int_1^2re^{-r^2}+\int_1^2re^{-r^2}(\tfrac12\pi-2\arccos\tfrac1r)dr\\&=\tfrac12\pi\int_0^2re^{-r^2}+2\int_1^2re^{-r^2}\arccos\tfrac1rdr\\&=\tfrac14\pi(1-e^{-2})+2\int_1^2re^{-r^2}\arccos\tfrac1rdr.\end{align}$$The last integral is the challenge! One way or another, we need numerical methods, as per e.g. @DMcMor or @Turing's answer.

4
On

You cannot use polar coordinates, for your integration range is a rectangle, as @Joshua Wang told you in a comment.

In this situation, a good way to attack the problem is to consider that, since you're bounded between $0$ and $1$, you can use Taylor series:

$$\int_0^1 \sum_{k = 0}^{+\infty} \frac{(-x^2)^k}{k!}\ \text{d}x = \sum_{k = 0}^{+\infty} \frac{(-1)^k}{k!} \int_0^1 x^{2k}\ \text{d}x = \sum_{k = 0}^{+\infty} \frac{(-1)^k}{k!} \frac{1}{2 k+1}$$

Now this series is well known in literature, and you get:

$$\sum_{k = 0}^{+\infty} \frac{(-1)^k}{k!} \frac{1}{2 k+1} = \frac{1}{2} \sqrt{\pi } \text{erf}(1)$$

Where $\text{erf}(\cdot)$ denotes the Error Function (special function): https://en.wikipedia.org/wiki/Error_function

($\text{erf}(1) \approx 0.842701(...)$)

0
On

The error is in the line:

$e^{-r^2}$ has circular symmetry, meaning that I can integrate it from $0$ to $2\pi$

Using the same (incorrect) argument, you would get $$ 1=\int_0^1\int_0^1 1 dxdy= \int_0^{2\pi}d\theta \int_0^1rdr=\pi $$

In general, you have $$ \iint_{\color{red}{x^2+y^2\le 1}}f(x^2+y^2)dxdy=\int_0^{2\pi}d\theta\left(\int_0^1f(r)rdr\right) $$ but $$ \iint_{\color{red}{[0,1]\times[0,1]}}f(x^2+y^2)dxdy\ne\int_0^{2\pi}d\theta\left(\int_0^1f(r)rdr\right) $$

1
On

Accounting for the shape of the domain, and using symmetry

$$\int_0^1\int_0^1e^{-(x^2+y^2)}dx\,dy=2\int_0^{\pi/4}\int_0^{1/\cos\theta}re^{-r^2}dr\,d\theta=\int_0^{\pi/4}\left(1-e^{-1/\cos^2\theta}\right)d\theta$$ and you are stuck.

0
On

Just to provide another straightforward solution to the integral in question, taking advantage of the fact that $$\frac{d}{dx}\operatorname{erfi}(x) = \frac{2}{\sqrt{\pi}}e^{-x^{2}}.$$ We have then $$\int_0^1 e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2}\left(\operatorname{erfi}(1) - \operatorname{erfi}(0)\right) = \frac{\sqrt{\pi}}{2}\operatorname{erfi}(1).$$