How to find $\int_{-\infty}^\infty \exp(-x^2) \, dx$ with contour integration? Contour integration is a very powerful tool.
But what if a function has no poles or zero's ?
For instance :
How to find $\int_{-\infty}^\infty \exp(-x^2) \, dx$ with contour integration?
 A: You can perform an integration of certain functions that have no poles by performing a contour integration of another function that may have poles (or a branch cut) in order to transform the contour integral into the sought-after integral.  In this case, one may consider
$$\oint_C dz \frac{e^{-\pi z^2}}{\sin{\pi z}} $$
where $C$ is a parallelogram in the complex plane, where $C= C_1+C_2+C_3+C_4$:
Along $C_1$, $z=-1/2 + e^{i \pi/4} t$, $t \in [R,-R]$.
Along $C_2$, $z=x-i (R/\sqrt{2})$, $x \in \left [-1/2-R/\sqrt{2},1/2-R/\sqrt{2} \right ]$.
Along $C_3$, $z=1/2 + e^{i \pi/4} t$, $t \in [-R,R]$.
Along $C_4$, $z=x+i (R/\sqrt{2})$, $x \in \left [-1/2+R/\sqrt{2},1/2+R/\sqrt{2} \right ]$.
One then completes the evaluation by taking the limit as $R \to \infty$. By adding the integrals along $C_1$ and $C_3$, the gaussian integral is reproduced.  One then shows that the integrals about $C_2$ and $C_4$ vanish in the limit as $R \to \infty$. For details of the evaluation, see this solution.
A: It can be found by using a rectangular contour and the function
 $$
\frac{e^{-z^2/2}}{1-e^{-\sqrt{\pi}(1+i)z}}.
$$
See the eighth proof in here for the motivation and analysis.
