# Math Help - Integral of Gaussian multiplied by cos(x)

1. ## Integral of Gaussian multiplied by cos(x)

Hey I have a problem that was in quantum mechanics, but is basically a math problem.
I need to solve the following integral:

How do you achieve this result analytically?
I do know how to solve for the integral of the plain Gaussian by converting to polar coordinates, but I have no idea how to achieve this result.

Any Help would be appreciated!
[IMG]file:///C:/DOCUME%7E1/AllanB/LOCALS%7E1/Temp/moz-screenshot.jpg[/IMG][IMG]file:///C:/DOCUME%7E1/AllanB/LOCALS%7E1/Temp/moz-screenshot-1.jpg[/IMG]

2. Originally Posted by all_an88
Hey I have a problem that was in quantum mechanics, but is basically a math problem.
I need to solve the following integral:

How do you achieve this result analytically?
I do know how to solve for the integral of the plain Gaussian by converting to polar coordinates, but I have no idea how to achieve this result.

Any Help would be appreciated!
[IMG]file:///C:/DOCUME%7E1/AllanB/LOCALS%7E1/Temp/moz-screenshot.jpg[/IMG][IMG]file:///C:/DOCUME%7E1/AllanB/LOCALS%7E1/Temp/moz-screenshot-1.jpg[/IMG]
I have never done this one...and I am not completely sure how to do this, but I have a few quick notions that you may want to follow

A) Use Leibniz's rule of differentiation and see if this turns into a simple ODE

B) This looks like prime countour integral to me

C) Rewrite it as

$\int_{-\infty}^{\infty}e^{-ax^2}\cos(kx)~dx=\text{Re}\left[\int_{-\infty}^{\infty}e^{-ax^2}e^{ikx}~dx\right]$

and complete the square. I will try this if I get time and get back to you if none of the other members do.

Best of luck

3. Originally Posted by Mathstud28
I have never done this one...and I am not completely sure how to do this, but I have a few quick notions that you may want to follow

A) Use Leibniz's rule of differentiation and see if this turns into a simple ODE

B) This looks like prime countour integral to me

C) Rewrite it as

$\int_{-\infty}^{\infty}e^{-ax^2}\cos(kx)~dx=\text{Re}\left[\int_{-\infty}^{\infty}e^{-ax^2}e^{ikx}~dx\right]$

and complete the square. I will try this if I get time and get back to you if none of the other members do.

Best of luck

C works like a charm!
Thank you very much!

4. Originally Posted by Mathstud28
I have never done this one...and I am not completely sure how to do this, but I have a few quick notions that you may want to follow

A) Use Leibniz's rule of differentiation and see if this turns into a simple ODE

B) This looks like prime countour integral to me

C) Rewrite it as

$\int_{-\infty}^{\infty}e^{-ax^2}\cos(kx)~dx=\text{Re}\left[\int_{-\infty}^{\infty}e^{-ax^2}e^{ikx}~dx\right]$

and complete the square. I will try this if I get time and get back to you if none of the other members do.

Best of luck
I like method (A) if we let

$I(k) = \int_{-\infty}^{\infty}e^{-ax^2}\cos(kx)~dx$

then

$I' (k) = - \int_{-\infty}^{\infty}xe^{-ax^2}\sin(kx)~dx$

this can be integrated by parts giving

$I' (k) = - \left. \frac{e^{-a x^2} \sin kx}{2a} \right|_{-\infty}^{\infty}- \frac{k}{2a} \int_{-\infty}^{\infty}e^{-ax^2}\cos(kx)~dx$

so the first term is zero and the second involve I. Thus,

$I'(k) = - \frac{k}{2a} I(k)$

which integrates giving $I(k) = c\,e^{-\frac{k^2}{4a}}$

Now $I(0) = c \;\;\text{and}\;\;\; I(0) = \int_{-\infty}^{\infty}e^{-ax^2}~dx$ so $c = \sqrt{\frac{\pi}{a}}$ giving

$I(k) = \sqrt{\frac{\pi}{a}} \,e^{-\frac{k^2}{4a}}$

5. Originally Posted by danny arrigo
I like method (A) if we let

$I(k) = \int_{-\infty}^{\infty}e^{-ax^2}\cos(kx)~dx$

then

$I' (k) = - \int_{-\infty}^{\infty}xe^{-ax^2}\sin(kx)~dx$

this can be integrated by parts giving

$I' (k) = - \left. \frac{e^{-a x^2} \sin kx}{2a} \right|_{-\infty}^{\infty}- \frac{k}{2a} \int_{-\infty}^{\infty}e^{-ax^2}\cos(kx)~dx$

so the first term is zero and the second involve I. Thus,

$I'(k) = - \frac{k}{2a} I(k)$

which integrates giving $I(k) = c\,e^{-\frac{k^2}{4a}}$

Now $I(0) = c \;\;\text{and}\;\;\; I(0) = \int_{-\infty}^{\infty}e^{-ax^2}~dx$ so $c = \sqrt{\frac{\pi}{a}}$ giving

$I(k) = \sqrt{\frac{\pi}{a}} \,e^{-\frac{k^2}{4a}}$

Wow that's a really nice way to do it to, i had no idea what Leibniz's rule was....

6. Originally Posted by all_an88
Wow that's a really nice way to do it to, i had no idea what Leibniz's rule was....
Yes...its a nice little rule that says that if $\int_a^b f(x,\theta)~dx$ satisfies certain conditions $\frac{d}{d\theta}\int_a^b f(x,\theta)~dx=\int_a^b \frac{\partial}{\partial \theta}f(x,\theta)~dx$

Leibniz integral rule - Wikipedia, the free encyclopedia

Prof. Arrigo: Thank you, I was fairly sure that method would work but was not sure how simple the computation would be...thanks again

7. Originally Posted by all_an88
Hey I have a problem that was in quantum mechanics, but is basically a math problem.
I need to solve the following integral:

How do you achieve this result analytically?
I do know how to solve for the integral of the plain Gaussian by converting to polar coordinates, but I have no idea how to achieve this result.
Here is a solution through complex analysis.

First by letting $t = \frac{x}{\sqrt{a}}$ the integral can be brought to the form $\int \limits_{-\infty}^{\infty} e^{-x^2} \cos bx dx,b>0$.
Also, it is sufficient to solve, $\int \limits_0^{\infty} e^{-x^2} \cos bx ~ dx$ because $e^{-x^2}\cos bx$ is an even function.

Let $f(z) = e^{-z^2}$ and $\Gamma$ be the rectangular contour with verticles at $0,R,R+i\tfrac{b}{2}, i\tfrac{b}{2}$.
Since the function $f$ is entire it means $\oint_{\Gamma} f(z) dz = 0$.
Writing the integral by definition we get,
$\int_0^R e^{-x^2} dx - \int_0^R e^{-(x+ib/2)^2} dx+ \int_0^{b/2} e^{-(R+it)^2} i dt - \int_0^{b/2} e^{t^2} i dt = 0$ ... [1]

Notice that,
$\int_0^R e^{-(x+ib/2)^2} dx = \int_0^R e^{-x^2 - bix + b^2/4} dx = e^{b^2/4} \int_0^R e^{-x^2} \left( \cos bx - i \sin bx\right) dx$

Also,
$\left| \int_0^{b/2} e^{-(R+it)^2} i dt \right| = e^{-R^2} \left| \int_0^{b/2} e^{-2iRt} e^{t^2} dt\right|$ $\leq e^{-R^2} \int_0^{b/2} \left| e^{-2iRt} e^{t^2} \right| dt \leq \frac{b}{2}e^{-R^2} e^{b^2/4}\to 0 \text{ as }R\to \text{ Me }$

Now if we take the limit as $R\to \infty$ in [1] and take the real part we get:
$\int_0^{\infty} e^{-x^2} dx - e^{b^2/4} \int_0^{\infty} e^{-t^2} \cos bx ~ dx = 0$

Thus, $\int_0^{\infty} e^{-t^2}\cos bx ~ dx = e^{-b^2/4}\int_0^{\infty} e^{-x^2} dx = \tfrac{1}{2}\sqrt{\pi}e^{-b^2/4}$