How do you integrate Gaussian integral with contour integration method?

How do you integrate $$\int^{\infty}_{-\infty} e^{-x^2} dx$$ with contour integration method?

I do not even know how to setup the problem.

Solutions Collecting From Web of "How do you integrate Gaussian integral with contour integration method?"

Sine the integrand is an even function then we have

$$ I = \int_{-\infty}^{\infty} e^{-x^2} dx = {2}\int_{0}^{\infty} e^{-x^2} dx. $$

Making the change of variables $u=x^2$ the integral under consideration becomes

$$ I = \int_{0}^{\infty} \frac{e^{-u}}{\sqrt{u}} du.$$

So we can consider the complex integral

$$ \int_{C}\frac{e^{-z}}{\sqrt{z}} dz $$

Now you need to choose the right contour, noting that we have $z=0$ as a branch point.