Riemann zeta-function functional equation proof I'm reading through Titchmarch's "The Theory of the Riemann Zeta-Function" and there's a part in the functional equation proof number 3 that I haven't figured out.
He defines a function
$$\psi(x)=\sum_{n=1}^\infty e^{-n^2\pi x}$$
and next, for $x>0$ it is known that
$$
\sum_{n=-\infty}^\infty e^{-n^2\pi x}=\frac1{\sqrt{x}}\sum_{n=-\infty}^\infty e^{-\frac{n^2\pi}x},
$$
or 
$$2\psi(x)+1=\frac1{\sqrt{x}}\left( 2\psi\left(\frac1{x}\right)+1\right).$$
Where does the second equation come from exactly?
 A: It is an application of Poisson summation formula. To verify it you only have to compute the Fourier transform: 
$$\frac{1}{\sqrt{x}}e^{-\frac{n^2\pi}{x}} = \int_{-\infty}^\infty e^{-m^2\pi x -2\pi i m n} dm.$$
A: I spelled this argument out in some detail, so that I could understand it. The argument is based on https://www.youtube.com/watch?v=-GQFljOVZ7I, but elaborated to my tastes.
Define $\theta(x) = 2 \psi(x) + 1 $. Then,
$$\theta(x)=(\sum_{n=-\infty}^1 e^{-n^2\pi x}) + 1 + (\sum_{n=1}^\infty e^{-n^2\pi x}) =\sum_{n=\infty}^\infty e^{-n^2\pi x}$$
The Poisson summation formula. is,
$$ \sum_{n-\infty}^\infty{f(n)} = \sum_{k=-\infty}^\infty \int_{-\infty}^\infty f(y) e^{-2\pi iky} x dy$$
Substituting $ f(n) = e^{-n^2\pi x}$ and $ f(y) = e^{-y^2\pi x}$ gives,
$$ \theta(x) = \sum_{n-\infty}^\infty{e^{-n^2\pi x}} = \sum_{k=-\infty}^\infty \int_{-\infty}^\infty e^{-y^2\pi x} e^{-2\pi iky}  dy = \sum_{k=-\infty}^\infty \int_{-\infty}^\infty e^{-\pi x(y^2 + 2iy \frac{k}{x})} dy$$
Complete the square by adding and subtracting a term $ i^2 \frac{k^2}{x^2} $
$$ \theta(x) =  \sum_{k=-\infty}^\infty \int_{-\infty}^\infty e^{-\pi x(y^2 + 2iy \frac{k}{x} + i^2\frac{k^2}{x^2} - i^2\frac{k^2}{x^2})} dy$$
Substituting $ y^2 + 2iy \frac{k}{x} + i^2 y^2\frac{k^2}{x^2} = (y + i \frac{k}{x})^2 $ and $ i^2\frac{k^2}{x^2} = - \frac{k^2}{x^2}$ gives,
$$ \theta(x) =  \sum_{k=-\infty}^\infty \int_{-\infty}^\infty e^{-\pi x((y + i \frac{k}{x})^2 + \frac{k^2}{x^2})} dy = \sum_{k=-\infty}^\infty e^{-\pi\frac{k^2}{x}} \int_{-\infty}^\infty  e^{-\pi x(y + i \frac{k}{x})^2} dy $$
as $ e^{-\pi\frac{k^2}{x}} $ is not a function of y, and so can be moved outside the integral.
An argument can then be made using path integrals that that follow a rectangle around the complex plain that,
$$ \int_{-\infty}^\infty  e^{-\pi x(y + i \frac{k}{x})^2} dy = \int_{-\infty}^\infty  e^{-\pi x z^2} dz = \frac1{\sqrt{\pi x}} \int_{-\infty}^\infty  e^{-z^2} dz = \frac{\sqrt{\pi}}{\sqrt{\pi x}} = \frac1{\sqrt{x}}$$
The argument uses the fact that a closed integral around no poles is zero, and also relies on terms at infinity going to zero. This is standard complex analysis, but it is not easy to see without a diagram. It really should be proved separately.
Also using, $$\theta(\frac1{x})=\sum_{k=1}^\infty e^{-\frac{k^2\pi}{x}}$$
$$ \theta(x) = \sum_{k=-\infty}^\infty e^{-\pi\frac{k^2}{x}} \int_{-\infty}^\infty  e^{-\pi x(y + i \frac{k}{x})^2} dy = \frac{\theta(\frac1{x})}{\sqrt{x}} $$
Substituting back $ \theta(x) = 2 \psi(x) + 1 $ gives the equation in terms of $\psi$.
$$ 2 \psi(x) + 1 =\frac{2 \psi(\frac1{x}) + 1}{\sqrt{x}} $$

The proof uses a result of the form,
$$ \int_{-\infty}^\infty  e^{-(y + ib)^2} dy = \int_{-\infty}^\infty  e^{-z^2} dz $$
Consider $ \int e^{-z^2} dz $ arround a rectangular path P given by $ -\infty \to \infty \to \infty+ib \to -\infty+ib \to -\infty $. From Cauchy's integral theorem this integral must be zero because it is a closed loop, and $ e^{-z^2} $ has no poles.
$$ \int_{P} e^{-z^2} dz = 0 $$
so,
$$ 0 = \int_{-\infty}^{\infty}  e^{-y^2} dy + \lim_{Y \to \infty} \int_{0}^{b} e^{-(Y + ix)^2} dx + \int_{\infty}^{-\infty}  e^{-(y+ib)^2} dy + \lim_{Y \to -\infty} \int_{b}^{0} e^{-(Y + ix)^2} dx $$
$$ 0 = \int_{-\infty}^{\infty}  e^{-y^2} dy + \lim_{Y \to \infty} \int_{0}^{b} e^{-(Y + ix)^2} dx - \int_{-\infty}^{\infty}  e^{-(y+ib)^2} dy - \lim_{Y \to \infty} \int_{0}^{b} e^{-(Y - ix)^2} dx $$
And I claim that,
$$ \lim_{Y \to \infty} \int_{0}^{b} e^{-(Y + ix)^2} dx = \lim_{Y \to \infty} \int_{0}^{b} e^{-(Y - ix)^2} dx = 0 $$
which gives,
$$ 0 = \int_{-\infty}^{\infty}  e^{-y^2} dy - \int_{-\infty}^{\infty}  e^{-(y+ib)^2} dy $$
To prove the claim, firstly,
$$ \lim_{Y \to \infty} \int_{0}^{b} e^{-(Y \pm ix)^2} dx = \lim_{Y \to \infty} \int_{0}^{b} e^{-(Y^2 \pm 2iYx -x^2)} dx = \lim_{Y \to \infty} \int_{0}^{b} e^{-Y^2} e^{\pm iYx} e^{x^2} dx $$
Consider the complex magnitude,
$$ |\lim_{Y \to \infty} \int_{0}^{b} e^{-Y^2} e^{\pm 2iYx} e^{x^2} dx| \le \lim_{Y \to \infty} \int_{0}^{b} |e^{-Y^2}| |e^{\pm 2iYx}| |e^{x^2}| dx $$
But, $ |e^{\pm 2iYx}| = 1 $ and $ \lim_{Y \to \infty} {|e^{-Y^2}|} = 0 $ and $\int_{0}^{b} |e^{x^2}| dx$ is finite giving,
$$ \lim_{Y \to \infty} \int_{0}^{b} |e^{-Y^2}| |e^{\pm iYx}| |e^{-x^2}| dx = \lim_{Y \to \infty} \int_{0}^{b} |e^{-Y^2}| |e^{-x^2}| dx  =  (\lim_{Y \to \infty} {|e^{-Y^2}|}) \int_{0}^{b} |e^{x^2}| dx = 0$$
So, 
$$ |\lim_{Y \to \infty} \int_{0}^{b} e^{-(Y \pm ix)^2} dy| \le 0 \implies \lim_{Y \to \infty} \int_{0}^{b} e^{-(Y \pm ix)^2} dy = 0 $$
