2

How to do this integral

$$\int_{-\infty}^{\infty}{\rm e}^{-x^{2}}\cos\left(\,kx\,\right)\,{\rm d}x$$

for any $k > 0$ ?.

I tried to use gamma function, but sometimes the series doesn't converge.

Felix Marin
  • 89,464
Doris
  • 848
  • 4
  • 14

3 Answers3

10

We assume $$F(k)=\int_{-\infty}^{\infty}e^{-x^2}\cos kxdx$$ Consider $F'(k)$, we have $$F'(k)=\int_{-\infty}^{\infty}-xe^{-x^2}\sin kxdx$$ $$=\frac{1}{2}(e^{-x^2}\sin kx|_{-\infty}^{\infty}-\int_{-\infty}^{\infty}ke^{-x^2}\cos kxdx)$$ $$=-\frac{1}{2}kF(k)$$ Then we solve the ordinary differential equation with $F(0)=\sqrt\pi$, and we get $$F(k)=\sqrt\pi e^{\frac{-k^2}{4}}$$

gaoxinge
  • 4,434
  • That is pretty. Well played. – msteve Sep 04 '14 at 01:45
  • @msteve Thank you. But we must take care of the exchange of integral and derivative. – gaoxinge Sep 04 '14 at 01:47
  • 1
    Is it not just differentiation under the integral sign, since the integrand is $C^1$ in both $x$ and $k$? Regardless though, just wanted to point out that I thought it was a neat trick to apply here. – msteve Sep 04 '14 at 01:50
2

The integral equals $\sqrt{\pi}e^{-k^2/4}$. To show this, just consider that: $$ I =\Re\int_{-\infty}^{+\infty}e^{ikx-x^2}\,dx = e^{-k^2/4}\cdot \Re\int_{-\infty}^{+\infty}e^{-(x-ik/2)^2}\,dx $$ and prove that the complex shift does not affect the value of the integral: $$\int_{-\infty}^{+\infty}e^{-(x-ik/2)^2}\,dx = \int_{-\infty-ik/2}^{+\infty-ik/2}e^{-x^2}\,dx = \int_{-\infty}^{+\infty}e^{-x^2}\,dx = \sqrt{\pi}.$$ This happens because $e^{-z^2}$ is an entire function whose absolute value when $|\Re(z)|\to +\infty$ and $\Im(z)$ stays bounded goes to zero really fast.

Jack D'Aurizio
  • 353,855
1

Write $$\cos kx = \frac{e^{ikx}+e^{-ikx}}{2}.$$ Using the identity that for $a>0$ and $b\in\mathbb{R}$, $$\int_{-\infty}^{\infty}e^{-ax^2+ibx}dx=\sqrt{\frac{\pi}{a}}e^{-\frac{b^2}{4a}},$$that can be obtained completing squares, we find for $a=1$ and $b=k$ that $$\int_{-\infty}^{\infty}e^{-x^2}\cos kx dx=\int_{-\infty}^{\infty}e^{-x^2} \frac{e^{ikx}+e^{-ikx}}{2} dx=\sqrt{\pi}e^{-\frac{k^2}{4}}.$$