TITLE: Proving the identity $\sum_{n=-\infty}^\infty e^{-\pi n^2x}=x^{-1/2}\sum_{n=-\infty}^\infty e^{-\pi n^2/x}.$
QUESTION [19 upvotes]: Can you help prove the functional equation: $$\sum_{n=-\infty}^\infty e^{-\pi n^2x}=x^{-1/2}\sum_{n=-\infty}^\infty e^{-\pi n^2/x}.$$  
Specifically, I am looking for a solution using complex analysis, but I am interested in any solutions.
Thanks!

REPLY [4 votes]: Answers have already been accepted but you wanted an approach based on complex analysis. You can derive the transformation properties of the theta functions directly from the residue theorem.
Let $C$ be the rectangle whose corners are $\pm(N+\frac12)\pm i$. We have from the residue theorem
$$\oint_C\frac{e^{-\pi tz^2}}{e^{2\pi iz}-1}dz=\sum_{n=-N}^{N}e^{-n^2\pi t}$$
I put $t$ as the variable in the series so as not to confuse it with $z=x+iy.$ The vertical parts of the contour integral decay as $N\to\infty$ so we will have
$$\sum_{n=-\infty}^{\infty}e^{-n^2\pi t}=\int^{\infty-i}_{-\infty-i}\frac{e^{-\pi tz^2}}{e^{2\pi iz}-1}dz+\int^{\infty+i}_{-\infty+i}\frac{e^{-\pi tz^2}}{1-e^{2\pi iz}}dz.$$
After some algebra, expanding the denominators as geometric series, I claim that the sum of these two integrals can be written as
$$e^{\pi t}\int^{\infty}_{-\infty}e^{-\pi tx^2}\sum_{n=-\infty}^{\infty}e^{2n\pi}\cos2\pi(n+t)xdx.$$
This class of integral can also be evaluated by the residue theorem. Since this is not the point of this answer, I will skip this working and just state that it can be shown without much labour that for all $t>0,$
$$\int^\infty_{-\infty}e^{-\pi tx^2}\cos2\pi(n+t)xdx=\frac{e^{-\pi t-2n\pi-n^2\pi/t}}{\sqrt{t}}.$$
After cancellation, it follows immediately that
$$\sum_{n=-\infty}^{\infty}e^{-n^2\pi t}=\frac{1}{\sqrt{t}}\sum_{n=-\infty}^{\infty}e^{-n^2\pi /t}$$
for all $t>0$, and this completes the proof, using only basic complex analysis, as required.
Even though this question was asked 9 years ago I hope this is illustrating to someone.