# How to evaluate the following integral involving a gaussian?

I want to evaluate the following integral:

$$\int\limits_0 ^\infty {x \sin{px} \exp{(-a^2x^2})} dx$$

Now I am unsure how to proceed. I know that this is an even function so I can extend the limit terms to $$-\infty, \infty$$ and then divide by 2. I have tried to evaluate this on Wolfram Alpha, but it only shows the answer while I am interested in the procedure.

• Have you tried differentiating wrt $p$ or $a$ – Henry Lee May 24 at 23:02
• i think the integral is indeed divergent??? – logo May 24 at 23:04
• Should the last term be $\exp(-cx^2)$ for some constant $c$? In its current form, the integral diverges. – VHarisop May 24 at 23:07
• @VHarishop Sorry, I made a mistake the exponential term should be $\exp{(-a^2x^2})$ and not $\exp{(\frac{-a^2}{x^2}})$ – daljit97 May 24 at 23:08

Start with: $$I\left( p \right)=\int_{0}^{\infty }{\cos \left( px \right)\exp (-{{a}^{2}}{{x}^{2}})dx}$$ We can use differentiation under the integral sign:

$${I}'\left( p \right)=-\int_{0}^{\infty }{x\sin \left( px \right)\exp (-{{a}^{2}}{{x}^{2}})dx}$$ Integration by parts using $$u=\sin \left( px \right)\quad and\quad dv=-x\exp \left( -{{a}^{2}}{{x}^{2}} \right)dx$$ $${I}'\left( p \right)=\left. \sin \left( px \right)\frac{\exp \left( -{{a}^{2}}{{x}^{2}} \right)}{2{{a}^{2}}} \right|_{0}^{\infty }-\frac{p}{2{{a}^{2}}}\int_{0}^{\infty }{\cos \left( px \right)\exp \left( -{{a}^{2}}{{x}^{2}} \right)dx}$$ The first term on the right vanishes, and we have the first-order differential equation: $$\frac{{I}'\left( p \right)}{I\left( p \right)}=-\frac{p}{2{{a}^{2}}}\Rightarrow \ln \left( I\left( p \right) \right)=-\frac{{{p}^{2}}}{4{{a}^{2}}}+C$$ Using $$I\left( 0 \right)=\frac{\sqrt{\pi }}{a}$$ We can find $$C=\ln \left( \frac{\sqrt{\pi }}{a} \right)$$ hence $$\ln \left( I\left( p \right) \right)=-\frac{{{p}^{2}}}{4{{a}^{2}}}+\ln \left( \frac{\sqrt{\pi }}{a} \right)$$ So $$I\left( p \right)=\frac{\sqrt{\pi }}{a}\exp \left( -\frac{{{p}^{2}}}{4{{a}^{2}}} \right)$$ Finally the integral in question equals $$-{I}'\left( p \right)=-\frac{d}{dp}\left( \frac{\sqrt{\pi }}{a}\exp \left( -\frac{{{p}^{2}}}{4{{a}^{2}}} \right) \right)$$

• How is $I(0)= \int_0 ^ \infty {cos(0)} = \sqrt{\pi}/a$? – daljit97 May 25 at 0:42
• $I\left( 0 \right)=\int_{0}^{\infty }{\cos \left( 0 \right)\exp (-{{a}^{2}}{{x}^{2}})dx}=\int_{0}^{\infty }{\exp (-{{a}^{2}}{{x}^{2}})dx}$ – logo May 25 at 1:45

Integrating by parts we get $$-\frac 1 {2a^{2}} e^{-a^{2}x^{2}} \sin(px)|_0^{\infty}+ \frac p {2a^{2}}\int_0^{\infty} e^{-a^{2}x^{2}} cos(px)dx$$. The first term is $$0$$ and the second term is the real part of a Gaussian characteristic function up to a constant factor.

The answer is $$\frac {p\sqrt{\pi}} {4a^{3}} e^{-p^{2}/2a^{2}}$$

\begin{align} \int_0^\infty x\sin{px}\exp{(-a^2x^2)}\ dx & =\int_0^\infty x\sum_{n\geq0}\dfrac{(-1)^n(px)^{2n+1}}{(2n+1)!}\exp{(-a^2x^2)}\ dx \\ & =\sum_{n\geq0}\dfrac{(-1)^np^{2n+1}}{(2n+1)!}\int_0^\infty x^{2n+2}\exp{(-a^2x^2)}\ dx \\ & =\sum_{n\geq0}\dfrac{(-1)^np^{2n+1}}{(2n+1)!}\dfrac{1}{2a^{2n+3}}\int_0^\infty u^{n+\frac12}e^{-u}\ du ~~~;~~~{a^2x^2=u}\\ & =\sum_{n\geq0}\dfrac{(-1)^np^{2n+1}(2n+2)}{\Gamma(2n+3)}\dfrac{1}{2a^{2n+3}}\Gamma(n+\frac32)\\ & =\sum_{n\geq0}\dfrac{(-1)^np^{2n+1}(2n+2)}{2^{2n+2}\sqrt{\pi}^{-1}\Gamma(n+2)\Gamma(n+\frac32)}\dfrac{1}{2a^{2n+3}}\Gamma(n+\frac32)\\ & =\sqrt{\pi}\sum_{n\geq0}\dfrac{(-1)^np^{2n+1}}{2^{2n+2}}\dfrac{1}{2a^{2n+3}}\\ & =\sqrt{\pi}\dfrac{p}{4a^3}\sum_{n\geq0}\left(\dfrac{-p^2}{4a^2}\right)^n\dfrac{1}{n!}\\ & =\sqrt{\pi}\dfrac{p}{4a^3}\exp\left(\dfrac{-p^2}{4a^2}\right) \end{align}

• Oh my goodness... so much work for such a simple integral (done by parts)! Obviously a technical solution with a different approach! – David G. Stork May 25 at 1:22
• @DavidG.Stork This is a technical solution with different approach. – Nosrati May 25 at 1:25