Integrating x^2e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx: Help Needed

  • Thread starter Thread starter architect
  • Start date Start date
  • Tags Tags
    Integration
architect
Messages
30
Reaction score
0
Hi,

I am interested in integrating the function appearing below. However, I have failed to find something useful so far in any book or internet resource. More specifically, the problem is as follows:

\int _0^{\infty } x^2e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx (1)

Please have a look at the following webpage where a similar integrand form is listed:http://dlmf.nist.gov/7.7#i. I am referring to equation 7.7.6 on this page. We can see that by setting a=1/\sigma^2,b=p/\sigma^2 and c=0 we get equation (1), apart from the the first term x^2. Therefore, would you attempt to solve this using integration by parts?

My attempts so far have failed. For example, I used the integration by parts method by setting u = x^2 and then solving for the second function
dv=e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx,

v=e^{\frac{p^2}{2\sigma ^2}}\sqrt{\frac{\pi}{2}}\sigma Erf(\frac{p+x}{\sqrt{2}\sigma})

I am left with the product of the error function and the variable x inside the integral (when comes to substituting u and v into uv-int{vdu}). As a result, this creates another problem. My attempts to find the result tabulated in a book of Mathematical functions have also failed. Any comments will be appreciated.

Thanks and Regards

Alex
 
Physics news on Phys.org
First of all, if you do the substitution:

<br /> x = \sigma \, y<br />

your integral becomes:

<br /> I = \sigma^{3} \, \int_{0}^{\infty}{y^{2} \, e^{-\frac{y^{2}}{2} - \frac{p}{\sigma} \, y} \, dy}<br />

and the remaining integral is only a function of the combination p/\sigma. Then, use Wolfram Alpha:

http://www.wolframalpha.com/input/?i=Integrate[y^{2}+Exp[-y^2/2+-+p+y],{y,0,Infinity}]

In the above solution you still need to plug in p \rightarrow p/\sigma. Notice the appearance of the complementary error function!
 
Hi,

thanks for your response. What is the benefit of brining the integrand to the form you mentioned instead of inserting (1) directly to Mathematica? Is it only for computational efficiency, since sigma is "removed"? I would preferably like to follow the derivation procedure and Mathematica does not allow me to do this.

Thanks for your response.

Regards

Alex
 
try it and see what happens.
 
Hi,

using Mathematica (1) results in the following:

\int _0^{\infty } x^2e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx=-p\text{ }\sigma ^2+e^{\frac{p^2}{2 \sigma ^2}} \sqrt{2 \pi } \left(p^2+\sigma ^2\right) \text{Erfc}\left[\frac{p \sqrt{\frac{1}{\sigma ^2}}}{\sqrt{2}}\right]

while when we simplify the integral using x=sigma y, we get the following:

\sigma ^3\int _0^{\infty } y^2e^{-\frac{y^2}{2}-\frac{p}{\sigma }y}dy=\sigma^3(-p+e^{\frac{p^2}{2}} \left(1+p^2\right) \sqrt{\frac{\pi }{2}} \text{Erfc}\left[\frac{p}{\sqrt{2}}\right])

and we need to substitute p/sigma where p. These two equations are not identical, they differ by 1/2. Notice the \sqrt{2\pi} in the first equation, and the \sqrt{\frac{\pi}{2}} in the second.

My question perhaps is: Do we bring the integrand in this form in (dependency on p and y) instead of of the form outlined in (1) in order to gain some speed in integration? Not that I noticed any difference but anyway! Also, do you think that integration with e.g. Mathematica is inevitable?

Thanks

Alex
 
They don't just differ by a factor of 1/2, but also by one extra factor of \sigma. Are you sure you did not mistype anything?

http://www.wolframalpha.com/input/?i=Integrate[x^2+Exp[-(x^2+%2b2+p+x)/(2+sigma^2)],{x,0,Infinity}]&incTime=true

The reason why I told you to do the substitution is because it take MUCH more time for Mathematica to do the calculation (in fact, it timed out once on me for the above calculation). This is because of the fact that the end result contains the following condition:

If \Re\mathrm{e}{\left[\sigma^{2}\right]} &gt; 0. When can this condition not be fulfilled?
 
Apologies,

I do not know what I was thinking when pasting the second relationship.

\sigma ^3\int _0^{\infty } y^2e^{-\frac{y^2}{2}-\frac{p}{\sigma }y}dy=\frac{1}{2} \sigma \left(-2 p \sigma +e^{\frac{p^2}{2 \sigma ^2}} \sqrt{2 \pi } \left(p^2+\sigma ^2\right) \text{Erfc}\left[\frac{p}{\sqrt{2} \sigma }\right]\right)

Are you aware of this integral being tabulated in any handbook of special functions/series/integrals? Btw the answer is never with regards to your question on the condition.

Thanks
 
It is not fulfilled if \sigma is a complex number such that:

<br /> \Re\mathrm{e}{[\sigma^{2}]} = [\Re\mathrm{e}{(\sigma)}]^{2} - [\Im\mathrm{m}(\sigma)]^{2} \le 0,<br />

which determines the shaded region:
attachment.php?attachmentid=29491&stc=1&d=1288379779.png

in the complex plane.

It means Wolfram's Mathematica (or WolframAlpha) treats symbols and complex numbers and over complicates things unless explicitly told not to do so. However, I don't know the command to tell this to WolframAlpha, so I chose the scaling I told you.

Regarding your question about the complementary error function, it is connected to the regular error function by:

<br /> \mathrm{erfc}(x) = 1 - \mathrm{erf}(x)<br />

If you don't have a tabulation for the error function, then you might have a tabulation for the cumulative distribution function of a http://en.wikipedia.org/wiki/Normal_distribution#Cumulative_distribution_function". Here is one link:

http://dlmf.nist.gov/7.23"
 

Attachments

  • complex.png
    complex.png
    1.4 KB · Views: 468
Last edited by a moderator:
Back
Top