I'm an engineering student who's been tasked with a maths problem slightly outside my field of study. It involves the evaluating the Gaussian integral
$$\int_{0}^{\infty} e^{-x^2} dx$$
After doing some research online (because the lectures sure as hell didn't prepare us for this), I now know that this can be re-expressed as
$$\frac{1}{2} \int_{-\infty}^{\infty}\int_{-\infty}^{\infty} e^{-(x^2 + y^2)} dx dy$$
such that $y=x$, but when converting from rectangular coordinates to polar coordinates I'm confused as to why the limits for $\theta$ are $0$ and $2\pi$. I tried proving this using L'Hopital's rule as follows:
Since $\theta = \tan^{-1} (y/x)$ and $y=x$, $\theta = \tan^{-1} (x/x)$. When evaluating the limit $x \rightarrow \infty$, we notice that
$$\lim_{x \rightarrow \infty} \tan^{-1} \bigg(\frac{x}{x}\bigg) = \tan^{-1} \bigg(\lim_{x \rightarrow \infty} \frac{x}{x} \bigg)$$
Using L'Hopital's rule, the limit equals $1/1$, which is obviously $1$. Ergo, the upper limit is $\tan^{-1}(1) = \pi/4$. Similarly, an identical approach can be used to (quote fingers) "demonstrate" (unquote fingers) that
$$\lim_{x \rightarrow -\infty} \tan^{-1} \bigg(\frac{x}{x}\bigg) = \pi/4$$
Therefore, the limits for $\theta$ are the same, meaning that the integral equals $0$. A visual inspection of $e^{-x^2}$ for $x \in \mathbb{R}$ shows this is wrong.
Please help.
EDIT: I now know why my usage of L'Hoptial's rule deosn't work. It's because I'm treating $y = e^{-x^2}$, which contradicts my definition of $y = x$.
Your double integral has some missing parts. Let $$I= \int_{0}^{\infty} e^{-x^2} dx $$
We know that $$\int_{0}^{\infty} e^{-x^2} dx =\int_{0}^{\infty} e^{-y^2} dy $$
Therefore we have $$ I^2 = \int_{0}^{\infty} e^{-x^2} dx\int_{0}^{\infty} e^{-y^2} dy= \int_{0}^{\infty}\int_{0}^{\infty} e^{-(x^2 + y^2)} dydx$$
Note that the region of integration is the first quadrant, which in polar form is $$ 0<\theta <\pi/2$$ and $$0< r <\infty$$
Solving for $I$ is straight forward because you can evaluate the integral in polar coordinates.