3
$\begingroup$

This question already has an answer here:

I was in need to urgently solve this integral. I already know the result in the closed form, does anybody know how to solve it? \begin{equation} \int_{\mathbb{R}}e^{-\frac{x^{2}}{2}}\left(\cos\left(\pi nx\right)\right)dx=\sqrt{2\pi}e^{-\frac{n^{2}\pi^{2}}{2}}, \end{equation} If anybody already knows it is welcome, otherwise I guess I will have to look tomorrow with more calm

$\endgroup$

marked as duplicate by T. Bongers, user147263, Silvia Ghinassi, user228113, colormegone Feb 11 '16 at 2:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ math.stackexchange.com/a/1644885/54122 $\endgroup$ – vnd Feb 9 '16 at 13:42
  • $\begingroup$ That integrand looks like the real part of $z^n e^\frac{z^2}{2}$, which suggests converting to an integral over the complex plane which might be simpler. $\endgroup$ – John Hughes Feb 9 '16 at 13:42
8
$\begingroup$

Here's a funny one:

Define the function $f$ as $$f:\mathbb{R}\longrightarrow\mathbb{R},\ a\longmapsto\int_{-\infty}^{+\infty}\mathrm{e}^{-x^2/2}\cos(a x)\,\mathrm{d}x.$$ It is well-known that the improper integral defining $f$ is convergent. We can apply the differentiation theorem to differentiate this improper integral (proof left to the reader) and we obtain: $$\forall a\in\mathbb{R},\ f'(a)=-\int_{-\infty}^{+\infty}x\mathrm{e}^{-x^2/2}\sin(ax)\,\mathrm{d}x.$$ Using an integration by parts yields $$\forall a\in\mathbb{R},\ f'(a)=-a\int_{-\infty}^{+\infty}\mathrm{e}^{-x^2/2}\cos(a x)\,\mathrm{d}x=-af(a).$$ Hence $f$ is a solution of the differential equation $$f'(a)+af(a)=0,$$ the general solution of which is $$f(a)=C\mathrm{e}^{-a^2/2}.$$ Now it is well-known that: $$f(0)=\int_{-\infty}^{+\infty}\mathrm{e}^{-x^2/2}\,\mathrm{d}x=\sqrt{2\pi},$$ hence $$\forall a\in\mathbb{R},\ f(a)=\sqrt{2\pi}\mathrm{e}^{-a^2/2}.$$ In particular, $$\int_{-\infty}^{+\infty}\mathrm{e}^{-x^2/2}\cos(\pi nx)\,\mathrm{d}x=f(\pi n)=\sqrt{2\pi}\mathrm{e}^{-n^2\pi^2/2}.$$

$\endgroup$
3
$\begingroup$

Another chance is given by the expansion of $\cos(\pi n x)$ as a Taylor series: $$ \cos(\pi n x) = \sum_{m\geq 0}\frac{(-1)^m (\pi n)^{2m} x^{2m}}{(2m)!}\tag{1} $$ together with the fact that: $$ \int_{\mathbb{R}} x^{2m} e^{-x^2/2}\,dx = \int_{0}^{+\infty} x^{m-1/2} e^{-x/2}\,dx = 2^{m+1/2}\cdot\Gamma\left(m-\frac{1}{2}\right).\tag{2} $$ These identities give: $$\begin{eqnarray*} \int_{\mathbb{R}}e^{-x^2/2}\cos(\pi n x)\,dx &=& \sum_{m\geq 0}\frac{(-1)^m (\pi n)^{2m}\, 2^{m+1/2}\,\Gamma(m+1/2)}{\Gamma(2m+1)} \\ &\color{red}{=}&\sqrt{2\pi}\cdot \sum_{m\geq 0}\frac{(-1)^m (\pi n)^{2m}\, 2^{m}\,\Gamma(m+1/2)}{2^{2m}\,\Gamma(m+1/2)\,\Gamma(m+1)}\\&=&\sqrt{2\pi}\sum_{m\geq 0}\frac{(-1)^m (\pi^2 n^2/2)^m}{m!}\\&\color{blue}{=}&\sqrt{2\pi}\cdot e^{-\pi^2 n^2/2}\tag{3}\end{eqnarray*} $$ where the equality in red follows from the Legendre duplication formula and the equality in blue from the Taylor series of the exponential function.

$\endgroup$
2
$\begingroup$

HINT: $$ \int_{\mathbb{R}}e^{-\frac{x^{2}}{2}}\left(\cos\left(\pi nx\right)\right)dx= \Re\left[ \int_{\mathbb{R}}e^{-\frac{x^{2}}{2}}e^{i\pi nx}dx\right] $$ Then observe that $$ -\frac{x^2}2+i\pi nx=-\left(\frac x{\sqrt2}-\sqrt2i\pi n\right)^2+2\pi^2 n^2 $$ and use the well known integral

$$ \int_{\Bbb R}e^{-s^2}\,ds=\sqrt{\pi}\;\; $$

with a suitable change of variable.

$\endgroup$
  • 1
    $\begingroup$ The "suitable change of variable" is not the part to dismiss lightly. The new limits are not on the real axis and one must invoke Cauchy's Integral Theorem to deform the new integration contour back onto the real axis and show that the contributions from the "end pieces" vanish. $\endgroup$ – Mark Viola Feb 9 '16 at 18:52
  • $\begingroup$ I know that. That's why I wrote HINT before. $\endgroup$ – Joe Feb 9 '16 at 19:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.