2
$\begingroup$

Bug introduced in 9.0.1 or earlier and persisting through 11.0.1 or later


This integral

$$\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }\int _{-\infty }^{\infty }\frac{\exp \left(\frac{2}{x^2+y^2+z^2+1}-2\right)}{\left(x^2+y^2+z^2+1\right)^4}\,dz\,dy\,dx$$

or

Integrate[
 Exp[2/(x^2 + y^2 + z^2 + 1) - 2]/(x^2 + y^2 + z^2 + 1)^4, 
 {x, -∞, ∞}, 
 {y, -∞, ∞}, 
 {z, -∞, ∞}
 ]

returns the following answer:

$$\text{ConditionalExpression}\left[\frac{\pi \left(\frac{e^{\frac{2}{z^2+1}} \left(z^4+1\right)}{\left(z^2+1\right)^2}-1\right)}{4 e^2},\Im\left(z^2\right)\neq 0\lor \Re\left(z^2\right)>-1\right]$$

Is this a bug?

$\endgroup$
  • 3
    $\begingroup$ People here generally like users to post code as Mathematica code instead of TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. $\endgroup$ – Michael E2 Jan 6 '15 at 16:41
  • $\begingroup$ I would substitute r^2 = x^2 + y^2 + z^2 so your integral becomes over the single variable {r, 0, Infty}. You must incorporate conversions for dx, dy and dz as well--much like the d-dimensional integration that leads to the Bessel function. While your integrand may blow up at r = 0, integrate from {r, a, Infty} and take the limit a -> 0. Might work. $\endgroup$ – David G. Stork Jan 6 '15 at 18:29
  • $\begingroup$ I believe this question should not be put on hold as it relates to the specific functionality of Mathematica's integration routines, gives all the relevant code (in poor format) for reproducing the effect, and ultimately has a clean, instructive answer that will help the poser and others that follow (see below). This answer leads to valuable Mathematica questions, such as how one might automate the conversion of an x-y-z integral into an r integral. Incidentally, it takes a mere two minutes to write the Mathematica code to implement the TeX equation given by the poser. Take off hold. $\endgroup$ – David G. Stork Jan 6 '15 at 22:52
  • $\begingroup$ @DavidG.Stork You can edit the question yourself to include the code. When the edit is approved, the question will go into the review queue to be voted on for reopening. $\endgroup$ – Michael E2 Jan 7 '15 at 0:10
  • 1
    $\begingroup$ Sorry for making my question not clear enough and not giving the mathematica code. My question was not how to do the integral analytically or numerically, which I know. The question was whether mathematica is some how goofing up to do the symbolic integral. $\endgroup$ – Nilanjan Jan 7 '15 at 17:40
3
$\begingroup$

I don't know what version of Mathematica you're using, but...

On V9.0.1, I get the same result as you.

On V10.0.1, I get a similar result, but the conditions are embedded in an If statement and the z-integral has not been forgotten; however, the If statement shows that integrand depends on conditions that should have been resolved, given that the z domain is real:

Integrate[Exp[2/(x^2+y^2+z^2+1)-2]/(x^2+y^2+z^2+1)^4,{x,-∞,∞},{y,-∞,∞},{z, -∞,∞}]

Mathematica graphics

This is certainly a bug, because the user should not expect to see internal local variables such as Integrate`ImproperDump`y$19189 returned to the top level.

Usually, when a ConditionalExpression is generated, one can try the option GenerateConditions -> False. On V9, the z-integral is still dropped, but it remains (unevaluated) in V10:

int= Integrate[
 Exp[2/(x^2 + y^2 + z^2 + 1) - 2]/(x^2 + y^2 + z^2 + 1)^4, {x, -∞, ∞}, {y, -∞, ∞}, {z, -∞, ∞}, 
 GenerateConditions -> False]

enter image description here

Mathematica graphics

It returns unevaluated because Mathematica seems to get stuck on it. I'm not sure why. An obvious substitution to try, to any (brave) calc I student, is u == 1/(1+z^2) or z -> Sqrt[1/u^2 - 1]. Here is the computation, first showing another way to address a result that includes ConditionalExpression, that of explicitly including the obvious assumptions (computation in V10.0.1 -- V9 still loses the z-integral):

int = Assuming[-Infinity < x < Infinity && -Infinity < y < Infinity && -Infinity < z < Infinity,
  Integrate[
   Exp[2/(x^2 + y^2 + z^2 + 1) - 2]/(x^2 + y^2 + z^2 + 1)^4, {x, -∞, ∞}, {y, -∞, ∞}, {z, -∞, ∞}]
  ]

Mathematica graphics

Block[{Integrate},
 -2 Integrate[First[int] Dt[z] /. z -> Sqrt[1/u^2 - 1] /. Dt[u] -> 1, {u, 0, 1}]
 ]

Mathematica graphics

Update: I blocked integration while the integrand is extracted from int, and updated the substitution, which did work before but was typo from what was intended.

Summary: In short, Mathematica losing the outside integral, which it did consistently in V9 under all three conditions, must be considered a bug. The situation is improved in V10.0.1, although not perfect; it is the same in V10.0.2 (thanks @Simon Woods).

$\endgroup$
  • 1
    $\begingroup$ 10.0.2 gives the same result as 10.0.1 $\endgroup$ – Simon Woods Jan 7 '15 at 21:59
  • $\begingroup$ Thanks a lot for checking. I am using Mathematica 9.0.1. $\endgroup$ – Nilanjan Jan 8 '15 at 11:59
  • $\begingroup$ Problem remains in v11.0.0.0 $\endgroup$ – N.J.Evans Oct 26 '16 at 13:29
7
$\begingroup$

Let k^2 = x^2 + y^2 + z^2 + 1. Then substitute and note that the integral of F[x,y,z] over all {dx, dy, dz} space is the integral over G[k] 4 Pi k^2 dk from 0 to Infinity, bring out the constant factors, change the integration limits, and then your integral is:

4 Pi Exp[-2] Integrate[Exp[2/k^2]/k^8 k Sqrt[k^2-1], {k, 1, Infinity}]

which yields

(\[Pi]^2 (BesselI[0, 1] - BesselI[1, 1]))/(4 E)

Its numerical value is:

N@ (\[Pi]^2 (BesselI[0, 1] - BesselI[1, 1]))/(4 E)

0.636217

which of course is a real number, and not variable-dependent.

Here's a graph of the integrand in the one-dimensional k space:

enter image description here

Check the analytic result by numerically integrating the original integrand over x, y and z:

NIntegrate[
Exp[2/(x^2+y^2+z^2+1)-2]/(x^2+y^2+z^2+1)^4, 
{x, -Infinity, +Infinity},
{y, -Infinity, +Infinity},
{z, -Infinity, +Infinity}] 

0.636217

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.