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

  • Thread starter architect
  • Start date
  • Tags
    Integration
In summary, Alex is trying to integrate x^2+2x+p+y, but has had no success. He has found a webpage that has a similar function, but is stumped on how to solve for the second function. He asks if integration by parts is faster than integrating the function directly. It appears that using the form mentioned can improve efficiency, but he is not sure if this is necessary or not. He asks if integration is inevitable for this problem.
  • #1
architect
31
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:

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

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 [tex]a=1/\sigma^2[/tex],[tex]b=p/\sigma^2[/tex] and [tex]c=0[/tex] we get equation (1), apart from the the first term [tex]x^2[/tex]. 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 [tex]u = x^2[/tex] and then solving for the second function
[tex]dv=e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx[/tex],

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

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
  • #2
First of all, if you do the substitution:

[tex]
x = \sigma \, y
[/tex]

your integral becomes:

[tex]
I = \sigma^{3} \, \int_{0}^{\infty}{y^{2} \, e^{-\frac{y^{2}}{2} - \frac{p}{\sigma} \, y} \, dy}
[/tex]

and the remaining integral is only a function of the combination [itex]p/\sigma[/itex]. 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 [itex]p \rightarrow p/\sigma[/itex]. Notice the appearance of the complementary error function!
 
  • #3
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
 
  • #4
try it and see what happens.
 
  • #5
Hi,

using Mathematica (1) results in the following:

[tex]\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][/tex]

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

[tex]\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])[/tex]

and we need to substitute p/sigma where p. These two equations are not identical, they differ by 1/2. Notice the [tex]\sqrt{2\pi}[/tex] in the first equation, and the [tex]\sqrt{\frac{\pi}{2}}[/tex] 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
 
  • #6
They don't just differ by a factor of 1/2, but also by one extra factor of [itex]\sigma[/itex]. 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 [itex]\Re\mathrm{e}{\left[\sigma^{2}\right]} > 0[/itex]. When can this condition not be fulfilled?
 
  • #7
Apologies,

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

[tex]\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)[/tex]

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
 
  • #8
It is not fulfilled if [itex]\sigma[/itex] is a complex number such that:

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

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:

[tex]
\mathrm{erfc}(x) = 1 - \mathrm{erf}(x)
[/tex]

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: 446
Last edited by a moderator:

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

What is the purpose of integrating x^2e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx?

The purpose of integrating x^2e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx is to find the area under the curve of the given function. This is useful in various fields of science, such as physics and chemistry, where calculating the area under a curve can provide important information about the system being studied.

How do I solve the integral of x^2e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx?

To solve this integral, you can use the technique of integration by parts. First, let u = x^2 and dv = e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx. Then, using the integration by parts formula, you can find the integral of x^2e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx.

What are the limits of integration for x^2e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx?

The limits of integration for this integral will depend on the specific problem or context in which it is being used. In general, the limits will be determined by the range of values of x that are relevant to the system being studied.

Can I use a calculator to solve the integral of x^2e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx?

Yes, there are many online calculators or computer programs that can solve integrals for you. However, it is important to understand the process and concepts behind integration in order to effectively use these tools and interpret the results.

What are some real-world applications of integrating x^2e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx?

Integrals are commonly used in fields such as physics, engineering, and economics to calculate quantities such as work, energy, and probability. Specifically, the integral of x^2e^{-\frac{\left(x^2+2 x p\right)}{2\sigma ^2}}dx can be used to calculate the area under the Gaussian distribution curve, which is important in statistics and data analysis.

Back
Top