There are several ways to compute the classical integral $$ \int_{\mathbb R}e^{-x^2}dx=\sqrt{\pi}. $$ Probably, best known are

(1) squaring the integral with subsequent change of (now two) variables to the polar form, and

(2) the reducing to the Gamma-function at $1/2$.

I am interested though in a "complex" analysis method (namely, a use
of the residue theorem) to do the job. The reason is that several integrals like
$$
\int_0^\infty e^{-x^2}\cos ax\ dx
\qquad\text{or}\qquad
\int_0^\infty\sin x^2\ dx
$$
can be computed via the residue theorem *and* the above integral,
so I would like to avoid any reference to real analysis. Is there such
a complex evaluation though?!

1more comment