Complex evaluation of a classical (real) integral 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?!
 A: If you take $$g(z)=\sum_{r=0}^{m-1}e^{\pi i a (z+r)^2/m}$$ and integrate $f(z)=\frac{g(z)}{e^{2\pi iz}-1}$ around the same  parallelogram, you will get reciprocity law for quadratic Gauss 
sums: if the product $ma$ is even then
$$S(a, m)= \sqrt{\frac ma}\frac{1+i}{\sqrt{2}}\overline{ S(m, a)}, $$ 
where $$S(a,m)=\sum_{r=0}^{m-1}e^{\pi i a r^2/m}.$$
In particular this observation allows to calculate quadratic Gauss 
sum (just take $a=2$).
This example is taken from Apostol, T. M. Introduction to analytic number theory Springer-Verlag, 1976, section 9.10.
A: It seems it was Polya, not Mirsky, who gave the first published evaluation of the probability integral via contour integration in 1945: https://projecteuclid.org/euclid.bsmsp/1166219199 (George Polya, Remarks on Computing the Probability Integral in One and Two Dimensions - see chapter 5). Polya's paper was published only in 1949, so Mirsky was not aware of it.
This story is told in the book D. Mitrinovic and J.D. Keckic,  The Cauchy Method of Residues: Theory and Applications, Volume 1, pp. 158-168. Interestingly, the authors write: 
"Some books even state that its value cannot be found by contour methods (see, for example [1] or [2]).
In fact, this is not so. We did our best to find the earliest proof of (1) by contour methods, but we did not arrive at a decisive conclusion. In a private communication dated 3 June, 1971, Professor Copson informed us that immediately after the publication of [2] (in 1935) somebody evaluated the integral (1) by the method of residues, but that he forgot who that was".
Is it possible to find this 1935 publication, if it existed?
For one more recent variant of such a calculation, see http://ijmsa.yolasite.com/resources/60--sepp.pdf (A simplified contour integration for the Probability integral, by P.W. Gwanyama)
A: Yes!  For a long time that was thought impossible, but then it was found how to do it using a parallelogram as a contour.  
Desbrow, Darrell
On evaluating $\int_{-\infty}^\infty e^{ax(x-2b)}dx$ by contour integration round a parallelogram.
Amer. Math. Monthly 105 (1998), no. 8, 726–731.   
According to Desbrow, the parallelogram integral evaluation for the probability integral is due to Mirsky, 1949.
A: In the Portuguese book Variável Complexa by Maria A. Carreira and Maria
S. M. de Nápoles, McGraw-Hill, 1997, this is evaluated in chapter 6,
exercise 23. The function
$$\begin{equation*}
f(z)=\frac{e^{i\pi z^{2}}}{\sin \left( \pi z\right) }
\end{equation*}$$
is integrated around the following paralellogram
$$\gamma _{1,3}(t) =te^{i\pi /4}\pm 1/2\qquad -r\leq t\leq r$$
$$\gamma _{2,4}(t) =\mp re^{i\pi /4}+t\qquad -1/2\leq t\leq 1/2.
$$
The computation shows that
$$\begin{equation*}
2\pi i\text{ }\mathrm{res}(f,0)=2i=\lim_{r\rightarrow +\infty }\frac{4i}{
\sqrt{\pi }}\int_{0}^{r/\sqrt{\pi }}e^{-x^{2}}dx.
\end{equation*}$$
