30

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 ?

Tulip
  • 4,876

7 Answers7

31

Differential Equation Approach

Note that since the integrand is even we have $$ \int_0^\infty e^{-x^2}\cos(ax)\,\mathrm{d}x =\frac12\int_{-\infty}^\infty e^{-x^2}\cos(ax)\,\mathrm{d}x\tag1 $$ Then differentiating with respect to $a$ yields $$ \begin{align} \frac{\mathrm{d}}{\mathrm{d}a}\int_{-\infty}^\infty e^{-x^2}\cos(ax)\,\mathrm{d}x &=-\int_{-\infty}^\infty e^{-x^2}x\sin(ax)\,\mathrm{d}x\tag{2a}\\ &=\frac12\int_{-\infty}^\infty\sin(ax)\,\mathrm{d}e^{-x^2}\tag{2b}\\ &=-\frac12\int_{-\infty}^\infty e^{-x^2}\,\mathrm{d}\sin(ax)\tag{2c}\\ &=-\frac a2\int_{-\infty}^\infty e^{-x^2}\cos(ax)\,\mathrm{d}x\tag{2d}\\ \end{align} $$ $\text{(2a)}$: differentiate
$\text{(2b)}$: prepare to integrate by parts
$\text{(2c)}$: integrate by parts
$\text{(2d)}$: $\mathrm{d}\sin(ax)=a\cos(ax)\,\mathrm{d}x$

Since $f'(a)=-\frac a2f(a)$ has the solution $f(a)=ce^{-a^2/4}$ and $f(0)=\int_0^\infty e^{-x^2}\,\mathrm{d}x=\frac{\sqrt\pi}2$, $$ \int_0^\infty e^{-x^2}\cos(ax)\,\mathrm{d}x=\frac{\sqrt\pi}{2}\,e^{-a^2/4}\tag3 $$


Contour Integral Approach

$$ \begin{align} \int_0^\infty e^{-x^2}\cos(ax)\,\mathrm{d}x &=\frac12\int_{-\infty}^\infty e^{-x^2}\cos(ax)\,\mathrm{d}x\tag{4a}\\ &=\frac12\int_{-\infty}^\infty e^{-x^2}e^{iax}\,\mathrm{d}x\tag{4b}\\ &=\frac12e^{-a^2/4}\int_{-\infty}^\infty e^{-\left(x-ia/2\right)^2}\,\mathrm{d}x\tag{4c}\\[3pt] &=\frac{\sqrt\pi}2\,e^{-a^2/4}\tag{4d} \end{align} $$ $\text{(4a)}$: symmetry
$\text{(4b)}$: $\sin(ax)$ is odd in $x$
$\text{(4c)}$: complete the square
$\text{(4d)}$: Cauchy's Integral Theorem and $\int_{-\infty}^\infty e^{-x^2}\,\mathrm{d}t=\sqrt\pi$

robjohn
  • 345,667
  • How do you get the third equality when you differentiate wrt a? When you go from $d\exp(-x^2)$ to $d\sin(ax)$? – user103341 Apr 05 '18 at 13:13
  • @user103341: the differentiation with respect to $a$ is in the first equality. The extra $x$ is then used in the second equality as $-e^{-x^2}x,\mathrm{d}x=\frac12\mathrm{d}e^{-x^2}$. The third equality is integration by parts. – robjohn Apr 05 '18 at 15:24
  • @robjohn May I ask what is the reasoning for the last equation (the equation after "Thus,")? I follow your argument till that line. I have yet to take a course in complex analysis. Thanks! – finmathstudent Jul 30 '19 at 08:36
  • 1
    @GalvinNg: the solution to the differential equation $\frac{\mathrm{d}}{\mathrm{d}a}f(a)=-\frac a2f(a)$ is $c,e^{-a^2/4}$ (divide both sides by $f(a)$ and integrate). Then we just use the well known $\int_0^\infty e^{-x^2},\mathrm{d}x=\frac{\sqrt\pi}2$ to compute $c$. – robjohn Jul 30 '19 at 11:54
  • @robjohn Why can we take the derivative inside the improper integral as opposed to a bounded interval? – Dude111 Aug 20 '19 at 12:29
  • @Dude111: because the convergence is absolute and uniform over the range of $a$ in which we are interested. – robjohn Aug 20 '19 at 17:24
  • Dear @robjohn can you please explain more how you substituted $cos(ax)$ by $exp(iax)$? (I do know the complex form of the cosine function) – Barreto Mar 20 '22 at 15:14
  • 2
    $e^{iax}=\cos(ax)+i\sin(ax)$ and since $\sin(ax)$ is odd, $\int_{-\infty}^\infty e^{-x^2}\sin(ax),\mathrm{d}x=0$ – robjohn Mar 20 '22 at 16:17
  • Thanks a lot !! – Barreto Mar 20 '22 at 16:26
  • @robjohn Equation (4c) has a misprint, it is supposed to be dx and not dt. – TeX Apprentice Aug 26 '23 at 20:06
  • @TeXApprentice: Indeed, thanks. Fixed. – robjohn Aug 26 '23 at 23:44
12

Instead of cosine, take $e^{iax}$ and complete the square. This thing says that the Fourier transform of the standard normal distribution is itself.

Will Jagy
  • 139,541
  • 2
    Nice observation (if the reader knows Fourier Analysis) (+1) – robjohn Mar 01 '13 at 00:00
  • @robjohn, thanks. It may not be helpful. On the other hand, it shows why this particular integral is important. So, a worthwhile add-on when there are also answers that are easier to follow. – Will Jagy Mar 01 '13 at 01:07
  • No question there. $e^{-\pi x^2}$ is an important function for showing sharp estimates, etc. since it is its own Fourier Transform (variations for other normalizations of the Fourier Transform). Not too long ago, I used this in an answer regarding the Heisenberg Uncertainty Principle. – robjohn Mar 01 '13 at 01:21
11

Notice that $$ a f(a) + 2 f^\prime(a) = \int_0^\infty \exp(-x^2) \left( a \cos(a x) - 2 x \sin(a x) \right) \mathrm{d} x = \int_0^\infty \frac{ \mathrm{d}}{\mathrm{d}x} \left( \mathrm{e}^{-x^2} \sin\left(a x\right) \right) \mathrm{d} x = 0 $$ It now only remains to find $f(0) = \int_0^\infty \exp(-x^2) \mathrm{d}x = \frac{1}{2} \int_{-\infty}^\infty \exp(-x^2) \mathrm{d}x = \frac{\sqrt{\pi}}{2} $.

Sasha
  • 70,631
11

$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ $\ds{\int_{0}^{\infty}\expo{-x^{2}}\cos\pars{ax}\,\dd x:\ {\large ?}}$

\begin{align} &\color{#66f}{\large\int_{0}^{\infty}\expo{-x^{2}}\cos\pars{ax}\,\dd x} =\half\Re\int_{-\infty}^{\infty}\expo{-x^{2}}\expo{\ic\verts{a}x}\,\dd x \\[5mm]&=\half\Re\int_{-\infty}^{\infty} \expo{-\pars{x -\ic\verts{a}/2}^{2} - a^{2}/4}\,\dd x =\half\,\expo{-a^{2}/4} \Re\int_{-\infty - \verts{a}\,\ic/2}^{\infty - \verts{a}\,\ic/2} \expo{-x^{2}}\,\dd x \\[5mm]&=\half\,\expo{-a^{2}/4}\ \underbrace{\int_{-\infty}^{\infty}\expo{-x^{2}}\,\dd x}_{\ds{=\ \color{#c00000}{\root{\pi}}}}\ =\ \color{#66f}{\large{\root{\pi} \over 2}\,\expo{-a^{2}/4}} \end{align}

Felix Marin
  • 89,464
7

One approach is to integrate $e^{-z^2}$ around a rectangle in the complex plane with vertices at $R,R+ia,-R+ia$ and $-R$.

Another approach is to expand $\cos ax$ in a Maclaurin series and then switch the order of integration and summation. You'll end up with a constant times the Maclaurin series of $e^{\frac{-a^{2}}{4}}$.

4

A nice simple, but useful, modification of this is that: $$ \int_{-\infty}^{\infty} \frac{\exp\left(-\frac{x^2}{2\sigma^2}\right)}{\sqrt{2\pi}\sigma}\cos(ax)dx = \exp\left(-\frac{\sigma^2 a^2}{2}\right) $$ which helps for developing the Fourier series of the Gaussian.

Davide Giraudo
  • 172,925
2

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}}.$$

Moli
  • 39