Integrate (x^2)exp(-x^2)dx from - to + infinity

In summary, The conversation is discussing how to find the expectation value of x^2 given a function ρ(x) and the integral of x^2 times an exponential function. The method of integration by parts is used, and the result can be found using the error function, but the conversation suggests using a different approach by considering the integral as a function of a variable parameter and taking derivatives to find the values of the averages. This is a slick and efficient method for computing Gaussian averages.
  • #1
clope023
992
131
Hello, I'm doing a quantum mechanics problem from Griffiths chapter 1 where I'm trying to find the expectation value of x^2 given the function ρ(x) = Aexp[-λ(x-μ)^2].
The problem is in the title, but I'll rewrite it here simplified:

∫(x^2)exp(-x^2)dx

Subbing u = x^2 <=> x = sqrt(u) => dx = -0.5(u^(-1/2))du which becomes

-0.5∫(u/sqrt(u))exp(u)du = -0.5∫ sqrt(u)exp(u)du

So from here I tried integration by parts, u = sqrt(u), du = -0.5u^(-3/2)du,
dv = exp(u)du, v = exp(u)

uv - ∫vdu = sqrt(u)exp(u) + 0.5∫u^(-3/2)exp(u)du

From here I equatted this with -0.5∫sqrt(u)exp(u)du and noted

u^(-3/2) = (u^(-1/2))*(u^-1) = (u^(-1/2))/u

so then I did the algebra and got:

∫u^(-1/2)exp(u)du = u^(-1/2)(u/(u-1))exp(u) = sqrt(u)exp(u)/(u-1)

Am I on the right track? I am aware I can do this with the complementary error function or the gamma function but I'm trying to avoid using them. Any help is appreciated thank you.
 
Physics news on Phys.org
  • #2
clope023 said:
Hello, I'm doing a quantum mechanics problem from Griffiths chapter 1 where I'm trying to find the expectation value of x^2 given the function ρ(x) = Aexp[-λ(x-μ)^2].
The problem is in the title, but I'll rewrite it here simplified:

∫(x^2)exp(-x^2)dx

Subbing u = x^2 <=> x = sqrt(u) => dx = -0.5(u^(-1/2))du which becomes

-0.5∫(u/sqrt(u))exp(u)du = -0.5∫ sqrt(u)exp(u)du

So from here I tried integration by parts, u = sqrt(u), du = -0.5u^(-3/2)du,
dv = exp(u)du, v = exp(u)

uv - ∫vdu = sqrt(u)exp(u) + 0.5∫u^(-3/2)exp(u)du

From here I equatted this with -0.5∫sqrt(u)exp(u)du and noted

u^(-3/2) = (u^(-1/2))*(u^-1) = (u^(-1/2))/u

so then I did the algebra and got:

∫u^(-1/2)exp(u)du = u^(-1/2)(u/(u-1))exp(u) = sqrt(u)exp(u)/(u-1)

Am I on the right track? I am aware I can do this with the complementary error function or the gamma function but I'm trying to avoid using them. Any help is appreciated thank you.

You cannot avoid the error function, as it occurs in one term of the answer. Put it another way: if you could find a closed-form for the integral, involving only elementary functions, you could also find a closed, elementary form for the error function, and this is provably impossible.

RGV
 
  • #3
Ray Vickson said:
You cannot avoid the error function, as it occurs in one term of the answer.

Sure you can. The definite integral [itex]\int_{-\infty}^{\infty} x^2 e^{-x^2} dx[/itex] (which from the thread title is what is actually desired) can be computed by applying integration by parts once with [itex]u=x[/itex] and [itex]dv=x e^{-x^2} dx[/itex], and then computing [itex]\int_{-\infty}^{\infty} e^{-x^2} dx[/itex] in the usual way (multiplying by [itex]\int_{-\infty}^{\infty} e^{-y^2} dy[/itex] to give the square of the integral, converting this to a 2D integral in polar coordinates to easily compute it, and then taking the square root)
 
  • #4
gabbagabbahey said:
Sure you can. The definite integral [itex]\int_{-\infty}^{\infty} x^2 e^{-x^2} dx[/itex] (which from the thread title is what is actually desired) can be computed by applying integration by parts once with [itex]u=x[/itex] and [itex]dv=x e^{-x^2} dx[/itex], and then computing [itex]\int_{-\infty}^{\infty} e^{-x^2} dx[/itex] in the usual way (multiplying by [itex]\int_{-\infty}^{\infty} e^{-y^2} dy[/itex] to give the square of the integral, converting this to a 2D integral in polar coordinates to easily compute it, and then taking the square root)

Of course the definite integral is doable---but not by the methods the OP posted. In the main body of the post the OP seemed to be wanting the indefinite integral, and I was responding to that.

RGV
 
  • #5
Do you know the result

$$I(\alpha) = \int_{-\infty}^\infty dx~e^{-\alpha x^2} = \sqrt{\frac{\pi}{\alpha}}?$$

If you are allowed to use that result, you can find the values of the averages of ##x^{2n}## by supposing ##\alpha## is actually a variable parameter and taking derivatives with respect to it. e.g.,

$$I'(\alpha) = -\int_{-\infty}^\infty dx~x^2e^{-\alpha x^2} = -\langle x^2 \rangle_\alpha,$$
where I've used a subscript ##\alpha## to denote that it's still a variable, and you have to set ##\alpha## to be whatever it is supposed to be in your original integral.

This is by far the slickest way to get Gaussian averages, in my opinion.
 
  • Like
Likes Octopus Sad

Related to Integrate (x^2)exp(-x^2)dx from - to + infinity

1. What is the purpose of integrating (x^2)exp(-x^2)dx from - to + infinity?

The purpose of this integration is to calculate the area under the curve of the function (x^2)exp(-x^2) and above the x-axis, within the given limits of -infinity to +infinity. This area represents the probability of a random variable following a normal distribution.

2. How do you solve this integral?

This integral can be solved using various methods such as substitution, integration by parts, or using tables of integrals. It can also be solved numerically using computer software or online calculators.

3. What is the general formula for integrating (x^2)exp(-x^2)dx from - to + infinity?

The general formula for this integral is ∫(x^n)exp(-x^2)dx = (-1/2) * (x^n-1) * exp(-x^2) + C. In this case, n = 2, so the formula becomes ∫(x^2)exp(-x^2)dx = (-1/2) * (x^2-1) * exp(-x^2) + C.

4. What is the result of integrating (x^2)exp(-x^2)dx from - to + infinity?

The result of this integral is √π/4, which is approximately equal to 0.8862. This means that the area under the curve of the function (x^2)exp(-x^2) and above the x-axis, within the given limits of -infinity to +infinity, is approximately equal to 0.8862 square units.

5. What is the significance of integrating (x^2)exp(-x^2)dx from - to + infinity?

Integrating (x^2)exp(-x^2)dx from - to + infinity is significant because it is used in statistics to calculate the probability of a random variable following a normal distribution. This integral is also used in various mathematical and scientific fields such as physics, engineering, and economics.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
636
Replies
3
Views
1K
  • Calculus and Beyond Homework Help
Replies
12
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
815
  • Calculus and Beyond Homework Help
Replies
1
Views
546
  • Calculus and Beyond Homework Help
Replies
5
Views
695
  • Calculus and Beyond Homework Help
Replies
15
Views
833
  • Calculus and Beyond Homework Help
Replies
22
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
768
  • Calculus and Beyond Homework Help
Replies
14
Views
512
Back
Top