It depends on the limits of the integration. If the limits are ±infinity then the integral can be done analytically - see below. However, if at least one of the limits is finite then the integral can only be done numerically (an exception is if one of the limits is zero, then the integral from zero to infinity is just half of the integral from -infinity to infinity).
Here is a brief derivation of the integral of e-x^2 from - infinity to infinity:
$$Let $$I=\int_{-\infty}^{\infty}e^{-x^2}dx$$
Because x is a dummy variable we can also write this as $$I=\int_{-\infty}^{\infty}e^{-y^2}dy$$
Multiply the two together to get $$I^2=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-(x^2+y^2}dxdy$$
Now if we think of x and y as being axes on a standard Cartesian graph, then the right-hand side is just the integral over the whole plane of $e^{-(x^2+y^2)}$. Change to polar coordinates, $r,\theta$ where $$x = r.cos\theta, y = r.sin\theta$$.\\
The limits of the integration become $0$ to $\infty$ for $r$ and $0$ to $2\pi$ for $\theta$. $dxdy$ becomes $r.drd\theta$. So:\\$$
$$I^2=\int_{0}^{2\pi}\int_{0}^{\infty}e^{-r^2}r.drd\theta$$\\
$$I^2=2\pi\int_{0}^{\infty}e^{-r^2}r.dr$$\\
$$I^2=2\pi\int_{0}^{\infty}e^{-r^2}\frac{1}{2}dr^2$$\\
$$I^2=\pi\int_{0}^{\infty}e^{-z}dz$$\\
where I've substituted $z$ for $r^2$ in that last integral. So:
$$I^2=\pi$$
as $\int_{0}^{\infty}e^{-z}dz=1$
Finally, $I=\sqrt\pi$ or
$$\int_{-\infty}^{\infty}e^{-x^2}dx=\sqrt\pi$$$$
.