Is there a trick to solving this definite integral?

In summary: So, for the example above,\int_{-\infty}^{\infty} dx~e^{-\alpha x^2} = \sqrt{\frac{\pi}{\alpha}}and\int_{-\infty}^{\infty} dx~x^{2n} e^{-\alpha x^2} = \frac{\sqrt{\alpha}}{2n}.
  • #1
CuppoJava
24
0
Hi,
For evaluating the entropy of a gaussian distribution, I need to evaluate this integral:
[tex]\int^{\infty}_{-\infty}exp(x^2)x^2dx[/tex]
There is no analytical solution for the indefinite integral, but is there a trick for evaluating this particular definite one?

Thanks a lot
-Patrick
 
Physics news on Phys.org
  • #2
It looks like that definite integral never converges . . .
 
  • #3
As jgens said, that integral does not converge. Since you are talking about a Gaussian distribution I suspect you actually meant
[tex]\int_{-\infty}^\infty x^2e^{-x^2} dx[/tex]

[itex]e^{-x^2}[/itex] is [itex]\sqrt{2}[/itex] times the Gaussian distribution with mean 0 and standard deviation 1. The square of the standard deviation of any probability density function, f(x), is [itex]\int (x-\mu)^2 f(x)dx[/itex] and, with [itex]\mu= 0[/itex], [itex]\sigma= 1[/itex], as here, [itex]\int x^2f(x)dx= 1[/itex]. That is,
[tex]\frac{1}{\sqrt{2}}\int_{-\infty}^\infty x^2e^{-x^2}dx= 1[/tex]
so
[tex]\int_{-\infty}^\infty x^2e^{-x^2}dx= \sqrt{2}[/itex]
 
Last edited by a moderator:
  • #4
HallsofIvy said:
[itex]e^{-x^2}[/itex] is [itex]\sqrt{2}[/itex] times the Gaussian distribution with mean 0 and standard deviation 1. ... so
[tex]\int_{-\infty}^\infty x^2e^{-x^2}dx= \sqrt{2}[/itex]
You forgot the normalization factor, Halls.

The "trick" (not much of a trick) is to integrate by parts using [itex]u=x[/itex], [itex]dv=x\exp(-x^2)\;dx[/itex], from which [itex]du=dx[/itex], [itex]v=-1/2\exp(-x^2)[/itex]. Then

[tex]\int_{-\infty}^{\infty} x^2\exp(-x^2)\,dx =
\left.-\,\frac 1 2 x \exp(-x^2)\right|_{-\infty}^{\infty} \,\,+\quad
\frac 1 2 \int_{-\infty}^{\infty} \exp(-x^2)\,dx[/tex]

The first term vanishes at the integration limits. The second term is just half the Gaussian integral. Thus

[tex]\int_{-\infty}^{\infty} x^2\exp(-x^2)\,dx = \frac{\sqrt \pi}{2}[/tex]OR one could use Hall's approach and look at this as the expected value of x2 for some normal distribution. The normal distribution is

[tex]f(x;\mu,\sigma) = \frac 1 {\sigma\sqrt{2\pi}} \exp\left(-\,\frac 1 2 \left(\frac {x-\mu}{\sigma}\right)^2\right)[/tex]

While the given function is not in the form of a Gaussian pdf, it is very close. By inspection, the given function is the Gaussian pdf for a mean of zero and a variance of 1/2, but without the normalization factor:

[tex]g(x) = \surd{\pi} \,f(x;0,1/\surd 2)[/tex]

Using the fact that the expected value of x2 for a normal distribution is the variance [itex]\sigma^2[/itex],

[tex]\int_{-\infty}^{\infty} x^2\exp(-x^2)\,dx = \frac{\sqrt \pi}{2}[/tex]
 
  • #5
Thank you very much for the help. You guys interpreted my mistake correctly. I did mean to have exp(-x^2) not exp(x^2).

The tip on properly using integration by parts helped very much. Thank you DH. I've tried integration by parts, but failed to find the right u and dv to use. Clearly I haven't done enough exercises in Calculus I.

Thanks again
-Patrick
 
  • #6
For Gaussian integrals like that I like to use the following trick: consider the integral

[tex]\int_{-\infty}^\infty dx~e^{-\alpha x^2} = \sqrt{\frac{\pi}{\alpha}};[/tex]

any integral of the form

[tex]\int_{-\infty}^\infty dx~x^{2n} e^{-\alpha x^2}[/tex]

can then be computed by taking derivatives of the first integral with respect to [itex]\alpha[/itex], then at the end of the calculation set [itex]\alpha[/itex] to whatever it actually is in the problem.
 

1. How do I know if there is a trick to solving a definite integral?

There is no definitive way to know if there is a trick to solving a definite integral. However, some integrals may have certain patterns or properties that can make them easier to solve using specific techniques.

2. What are some common tricks for solving definite integrals?

Some common tricks for solving definite integrals include using substitution, integration by parts, and trigonometric identities. It is important to practice and familiarize yourself with these techniques to recognize when they can be applied.

3. Can I solve a definite integral without using a trick?

Yes, it is possible to solve a definite integral without using any specific tricks. This usually involves breaking the integral into smaller parts or using basic integration rules.

4. How do I know which trick to use for a specific definite integral?

The best way to determine which trick to use for a specific definite integral is by looking at the integrand and identifying any patterns or properties that may be present. It may also be helpful to try different techniques and see which one yields the desired result.

5. Are there any tips for solving definite integrals more efficiently?

Some tips for solving definite integrals more efficiently include practicing regularly, familiarizing yourself with common integration techniques, and breaking the integral into smaller, manageable parts. It is also helpful to have a good understanding of algebra and trigonometry to simplify the integrand before attempting to integrate.

Similar threads

Replies
3
Views
1K
Replies
14
Views
1K
  • Calculus
Replies
6
Views
1K
  • Calculus
Replies
25
Views
1K
Replies
16
Views
1K
Replies
8
Views
307
  • Calculus
Replies
1
Views
1K
Replies
3
Views
1K
Replies
2
Views
942
Back
Top