# Using contour integrals to show this relationship

By integrating $f(z)=e^{-z^2}$ around the boundary of a rectangle with corners $a,a+ib,-a+ib$ and $-a$, where $b>0$, show

$$\int_{-\infty}^\infty e^{-x^2}\cos 2bx \ dx = e^{-b^2}\int_{-\infty}^\infty e^{-x^2} \ dx.$$ This is my attempt:

First I'll parametrize the boundaries.
$\gamma_1(t) = t$ for $-a\leq t \leq a$,
$\gamma_2(t) = a+it$ for $0\leq t \leq b$,
$\gamma_3(t) = t+ib$ for $-a\leq t \leq a$,
$\gamma_4(t) = -a + it$ for $0 \leq t \leq b$.

Noting that the closed contour integral evaluates to zero by Cauchy-Goursat's Theorem, I split up the integral in four parts.
\begin{align}\int_{\gamma_1(t)} f(z) \ dz &= \int_{-a}^a e^{-t^2} \ dt \\\int_{\gamma_2(t)}f(z)\ dz &= i\int_{0}^b e^{-(a+it)^2} \ dt \\ \int_{\gamma_3(t)}f(z)\ dz &= -\int_{-a}^a e^{-(t+ib)^2}\ dt \\ \int_{\gamma_4(t)} f(z) \ dz &= -i\int_{0}^b e^{-(-a+it)^2}\ dt. \end{align}
$$\int_{-a}^a e^{-t^2} \ dt + i\int_{0}^b e^{-(a+it)^2} \ dt - \int_{-a}^a e^{-(t+ib)^2}\ dt -i\int_{0}^b e^{-(-a+it)^2}\ dt = 0$$

Since each integrand is real, then each integral evaluates to a real number. Since the integral equals to zero, then this is only true when
$$\int_{-a}^a e^{-t^2} \ dt- \int_{-a}^a e^{-(t+ib)^2}\ dt = 0$$ and $$i\int_{0}^b e^{-(a+it)^2} \ dt -i\int_{0}^b e^{-(-a+it)^2}\ dt=0$$
I'm stuck here now. When I try to use the first equality, $$\int_{-a}^a e^{-t^2} - e^{-(t+ib)^2}\ dt = 0$$
I feel like this should only hold when the integrand is identically zero...

The integrands are not real, they contain $i$ in the exponent! Expanding the squares gives: \begin{align} 0 &= \int_{[-a,a]} e^{-t^2}\,dt - \int_{[-a,a]} e^{-(t^2+2itb-b^2)}\,dt + i\left(\int_{[0,b]} e^{-(a^2+2ait-t^2)}\,dt + \int_{[0,b]} e^{-(a^2-2ait-t^2)}\,dt\right)\\ &= \int_{[-a,a]} \left(e^{-t^2}-e^{-t^2-b^2}e^{2itb}\right)\,dt + i\left(\int_{[0,b]} e^{t^2-a^2}\underbrace{\left(e^{-2ait}-e^{2ait}\right)}_{-\frac{1}{2i}\sin(2at)}\,dt\right)\\ &= \int_{[-a,a]} \left(e^{-t^2}-e^{-t^2-b^2}e^{2itb}\right)\,dt -2\int_{[0,b]} e^{t^2-a^2}\sin(2at)\,dt \end{align} Thus: $$\int_{[-a,a]} \left(e^{-t^2}-e^{-t^2-b^2}e^{2itb}\right)\,dt = 2\int_{[0,b]} e^{t^2-a^2}\sin(2at)\,dt$$

Now notice that the RHS integrand is real so both the integrals are real. Taking the real part of both sides gives:

$$\int_{[-a,a]} \left(e^{-t^2}-e^{-t^2-b^2}\cos(2bt)\right)\,dt = 2\int_{[0,b]} e^{t^2-a^2}\sin(2at)\,dt$$

Now let $a \to \infty$ and notice that the left integral goes to $0$:

$$\lim_{a\to\infty}\left|\int_{[0,b]} e^{t^2-a^2}\sin(2at)\,dt\right| \le \lim_{a\to\infty} e^{-a^2}\int_{[0,b]} e^{t^2}\underbrace{|\sin(2at)|}_{\le 1}\,dt \le \lim_{a\to\infty} e^{-a^2} \cdot be^{b^2}= 0$$

So we have:

$$0 = \int_{\mathbb{R}} e^{-t^2}-e^{-t^2-b^2}\cos(2bt)\,dt = \int_{\mathbb{R}} e^{-t^2}\,dt - e^{-b^2}\int_{\mathbb{R}} e^{-t^2}\cos(2bt)\,dt$$

Thus:

$$\int_{\mathbb{R}} e^{-t^2}\cos(2bt)\,dt = e^{-b^2}\int_{\mathbb{R}} e^{-t^2}\,dt$$