How is integral calculated?
$$\int_ 0^\infty e^{-x^2}~dx $$
The standard way to do this integral is to evaluate its square. That is, let
$$I = \int_0^{\infty} dx \: e^{-x^2}$$
Then
$$I^2 = \int_0^{\infty} dx \: e^{-x^2} \int_0^{\infty} dy \: e^{-y^2} = \int_0^{\infty} dx \:\int_0^{\infty} dy \: e^{-(x^2+y^2)}$$
Now the trick is to convert to polar coordinates: $dx dy = r dr d\theta$, $r \in [0,\infty)$, $\theta \in [0, 2 \pi)$:
$$I^2 = \int_0^{\infty} dr \,r\, e^{-r^2} \int_0^{2 \pi} d\theta = 2 \pi \frac{1}{2} = \pi$$
Therefore
$$I = \sqrt{\pi}$$
Neither. The function has no antiderivative that can be expressed in terms of elementary functions, so both those methods fall down.
If you wish to evaluate the definite integral over a particular interval, though, you've got a shot.
See Gaussian integral and Error function. It is $\sqrt \pi $ on $(- \infty, +\infty) $ . Indefinite could not be expressed in elementary functions.