Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Trying to evaluate an integral. To be specific, I'm trying to find the expectation value of $x^2$ for the ground state of hydrogen. Here is the code I used:

  Integrate[x^2/(Pi*a^3) E^((-2 Sqrt[x^2 + y^2 + z^2])/a), {x,-Infinity, Infinity}]]

The odd part is it worked when I calculated $\left<x\right>$, i.e. just drop an $x$ from the first fraction.

share|improve this question
Did you try letting Mathematica know that $a$ is real, say with Assuming[] ? – Zet Jun 7 '14 at 15:21
Just did, no such luck:( – Sam Jun 7 '14 at 15:26
Then I'd try to convert the integral into spherical coordinates (although it is disappointing that M didn't try it). – Zet Jun 7 '14 at 15:44
Try a change of coordinate cartesian-spherical. – b.gatessucks Jun 7 '14 at 15:44
Yes, that turned out to be the proper way to do the problem anyway. – Sam Jun 7 '14 at 16:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.