I know that to calculate the gaussian integral $$\int_{-\infty}^\infty e^{-x^2}dx$$ you consider $\pmb I^2$, change to polar coordinates and it works out to $\sqrt\pi$. We do this because $e^{-x^2}$ doesn't have an indefinite integral. However I don't understand why $e^{-x^2}$ doesn't have an indefinite integral, and why we can't just integrate by substituion. Can anybody explain to me why this is?
Edit: I meant to say whitout an elementary indefinite integral.
The function is integrable. The value of the indefinite integral is $\sqrt{\pi}$. However, there is no elementary function whose derivative $e^{-x^2}$. To see why this is true, first observe that the antiderivative of $e^{-x^2}$ (up to a constant) is the error function. The error function is defined by
$$\operatorname{erf}(x)=\frac 2 {\sqrt \pi}\int_{0}^x e^{-t^2}dt$$
and is not an elementary function. If we take the derivative with respect to $x$ on both sides we get
$$\frac{d}{dx}\left(\operatorname{erf}(x)\right)=\frac{2}{\sqrt \pi}e^{-x^2}$$
by the first part of the fundamental theorem of calculus. Then, rearranging and taking the antiderivative forms
$$\int e^{-x^2}\,dx=\frac{\sqrt \pi}{2}\operatorname{erf}(x)-c$$
which differs by a constant from the error function. Since the error function cannot be expressed in terms of elementary functions, it is clear that the error function minus a constant also cannot be expressed in terms of elementary functions.
Therefore, you cannot represent the antiderivative of $e^{-x^2}$ by elementary functions. Instead, the antiderivative is represented by the error function.