Prove $ \int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$.

Here is some guidelines (from Freitag - Complex Analysis) to prove that $$\int_{-\infty}^\infty e^{-t^2} = \sqrt{\pi}$$ using the complex Residue theorem. If you want more details just ask.

Define $$f(z) = \frac{\exp(-z^2)}{1 + \exp(- 2 a z)}$$ where $a = e^{2 \pi i/4}\sqrt{\pi}$. We will perform contour integration on the parallelogram with vertices $[-R, R, R+a, -R+a]$ and let $R \to \infty$.

(A) Derive the functional identity $$f(z) - f(z + a) = \exp(-z^2)$$

(B) Find the poles of $f(z)$.

Check $a/2$. That is the only one.

(C) Use the ML inequality to estimate away the diagonal edges. Using the functional identity to match up the bottom and reverse of the top edge.

(D) Use Residue theorem to conclude.

The residue of the pole is $\tfrac{1}{2} i \sqrt{\pi}$


Edit: Just to amplify one of the comments above. My first time seeing this but it can also be done over a rectangle via the function $$f(z) = \frac{e^{-z^2/2}}{1 - e^{- \sqrt{\pi} (1 + i) z}}$$ page 8 of https://kconrad.math.uconn.edu/blurbs/analysis/gaussianintegral.pdf