TITLE: Gaussian-like integral : $\int_0^{\infty} e^{-x^2} \cos( a x) \ \mathrm{d}x$
QUESTION [22 upvotes]: Prove that :
$$ \frac{\sqrt{\pi}}{2} e^{-\frac{a^2}{4} } =\int_0^{\infty} e^{-x^2} \cos( a x) \ \mathrm{d}x$$

the only thing I can think of is differentiating the RHS and trying to get :
$$ -2 f'(a) =a f(a) $$
But I couldn't do it. 
Can anyone show me how to do this ?

REPLY [2 votes]: You can integrate
$$f(z)=e^{-z^2},z\in\mathbb{C}$$
On the boundary of the rectangle
$$\{z\in\mathbb{C}:\Re(z)\in[-R,R]\wedge \Im(z)\in[0,a/2]\}$$
Given $a>0,R>a/2.$
Being $f$ entire, this integral is equal to zero.
Using the fact that
$$\int_0^\infty{e^{-x^2}dx}=\frac{\sqrt\pi}{2}$$
And observing that on the two vertical sides the integral approaches zero as $R \to \infty$, you will deduce that
$$\int_{-\infty}^\infty{e^{-x^2}\cos(ax)dx}=\sqrt{\pi}\cdot e^{-\frac{a^2}{4}},$$
And also
$$\int_{-\infty}^\infty{e^{-x^2}\sin(ax)dx}=0.$$
Therefore, by the fact that the function is even, we have that
$$\int_{0}^\infty{e^{-x^2}\cos(ax)dx}=\frac{\sqrt{\pi}}{2}\cdot e^{-\frac{a^2}{4}}.$$