Complex Analytic Proof of the Gaussian Integral $\int_{-\infty}^{\infty}e^{-z^2}dz=\sqrt{\pi}$ Prove that $\int_{-\infty}^{\infty}e^{-z^2}dz=\sqrt{\pi}$.
Here is my attempted solution:
Define $a:=\sqrt{\pi}e^{\frac{\pi i}{4}}$ and let $f(z) = \frac{e^{-z^2}}{1+e^{-2az}}$.  
Note that $a^2=\pi i$.
Now $f(z)$ has poles of order 1 at $(k+\frac{1}{2})a$ for all $k\in\mathbb{Z}$.  Thus using the Residue Theorem and l'Hôpital's Rule:
$$\lim_{z\rightarrow (k+\frac{1}{2})a}\frac{(z-(k+\frac{1}{2})a)e^{-z^2}}{1+e^{-2az}}=\lim_{z\rightarrow (k+\frac{1}{2})a}\frac{\frac{d}{dz}(z-(k+\frac{1}{2})a)e^{-z^2}}{\frac{d}{dz}1+e^{-2az}}=\frac{e^{-(k+\frac{1}{2})^2a^2}}{-2ae^{-2(k+\frac{1}{2})a^2}}=\frac{e^{-k^2a^2-ka^2-\frac{a^2}{4}}}{-2ae^{-2ka^2-a^2}}=\frac{e^{-\pi ik^2-\pi ik-\frac{\pi i}{4}}}{-2ae^{-2\pi ik-\pi i}}=\frac{e^{\frac{-\pi i}{4}}}{2\sqrt{\pi}e^{\frac{\pi i}{4}}}=\frac{1}{2\sqrt{\pi}i}$$
It can be shown that $f(z)-f(z+a)=e^{-z^2}$ (I wont prove this but it's most definitely true).  I'm going to integrate this function around the contour which is a rhombus slanting to the right whose bottom two corners lie at $-R$ and $R$.  Thus we have:
$$\lim_{R\rightarrow\infty}\bigg[\int_{-R}^{R}f+\int_{R+at}f+\int_{R+a}^{-R+a}f+\int_{R+a(1-t)}f\bigg]=\sum_{k\geq 0}\sqrt{\pi}$$ for $0\leq t\leq 1$.
Making the substitutions $u=z-a$ for the third integral and then $v=1-t$ for the fourth, and then taking $R\rightarrow\infty$, we obtain:
$$\int_{-\infty}^{\infty}e^{-z^2}dz=\sum_{k\geq 0}\sqrt{\pi}$$
Whew! Ok so clearly all I really want is just one $\sqrt{\pi}$, not an infinite number of them.  But when I take $R\rightarrow\infty$ my rhombus contains all the poles in the upper-half plane.  Can anyone tell where I went wrong?
 A: Ok everyone you can stop furiously scribbling to check all my calculations.  Byron Schmuland sent me to a post which has this same solution and it made me realize my mistake:
Taking $R\rightarrow\infty$ only extends this rhombus in the horizontal directions!  So I don't pick up anymore singularities in the limit.  So there it is.
A: This is a proof which is not at all 'Complex Analytic' but is very elementary so I thought of sharing it as an answer to this question.
Let $\int_{-\infty}^{\infty}e^{-x^2}dx=z$. Clearly $z=2\int_{0}^{\infty}e^{-x^2}dx$. Now as exponential function is positive so we have, $z\geq 0$(It is rather strict) 
Then we have $\int_{-\infty}^{\infty}e^{-x^2}dx.\int_{-\infty}^{\infty}e^{-y^2}dy=z^2$
We have,
$$z^2=\int_{-\infty}^{\infty}e^{-x^2}dx.\int_{-\infty}^{\infty}e^{-y^2}dy=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-x^2}e^{-y^2}dxdy=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-(x+y)^2}dxdy$$
Changing into the polar co-ordinates we have,
$$x=r\cos \theta,y=r \sin \theta$$
$$\Rightarrow dxdy=rdrd\theta$$
Replacing in the above integral we have,
$$\int_{-\pi}^{\pi}\int_{0}^{\infty}e^{-r^2}rdrd\theta$$
$$= \frac{1}{2}\int_{-\pi}^{\pi}\int_{0}^{\infty}e^{-y}dyd\theta$$
$$= \frac{1}{2}\int_{-\pi}^{\pi}d\theta$$
$$=\pi$$
So we have ,
$$z^2=\pi$$
$$\Rightarrow z=\sqrt{\pi}$$
