Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am hoping to evaluate the following integral

Integrate[((r^3 - 7)^(2/3)*(1 - (r^3 - 7)^(2/3)/r^2))/r^3, {r, 2, Infinity}]

but Mathematica informs me that this integral "does not converge on {2,$\infty$}." However, the numerical integration command

NIntegrate[((r^3 - 7)^(2/3)*(1 - (r^3 - 7)^(2/3)/r^2))/r^3, {r, 2, Infinity}]

yields 0.139837 without mention of any difficulties. Which should I believe?

share|improve this question
1  
Looking into it. It does appear to be a strangeness with Limit or perhaps Series. –  Daniel Lichtblau Jul 30 '13 at 20:17
add comment

2 Answers

up vote 12 down vote accepted

You can do the analytic integral in Mathematica too, by telling it to perform the upper integration limit as follows:

With[
 {
  i = 
   Integrate[((r^3 - 7)^(2/3)*(1 - (r^3 - 7)^(2/3)/r^2))/r^3, r]
 },
 Simplify[
   Limit[i, r -> Infinity] - i /. r -> 2
  ]
 ]

(*
==> 23/64 + Pi/(3 Sqrt[3]) - 
 2 (-(1/7))^(1/3) Hypergeometric2F1[1/3, 1/3, 4/3, 8/7] + 
 2 (-(1/7))^(2/3) Hypergeometric2F1[2/3, 2/3, 5/3, 8/7]
*)

N[%]//Chop

(* ==> 0.139837 *)
share|improve this answer
add comment

Believe the numerical one. Mathematica simply could not do the symbolic integration. Symbolic integration will travel via a different code path. Here the symbolic integration done using Maple, and it agrees with the numerical solution given by Mathematica's NIntegrate

Mathematica graphics

The analytical answer is

 (7/18)*hypergeom([-1/3, 1, 1], [2, 2], 7/8)-(7/36)*hypergeom([1/3, 1, 1], [2, 2], 7/8)

You can do it in Mathematica like this:

z = Integrate[((r^3 - 7)^(2/3)*(1 - (r^3 - 7)^(2/3)/r^2))/r^3, r];
r1 = Limit[z, r -> Infinity]
(* 3/4 + Pi/(3*Sqrt[3]) *)
r2 = Limit[z, r -> 2]
(r1 - r2) // N
Out[6]= 0.139837 + 0. I

Update:

There is some strange kernel buffering issue here. The integral will work, but it depends on order of thing. On a new FRESH kernel, I found the following: If I run the integral once (but the indefinite version), and then run it again, but use the definite integral now, it work ! Here is screen shot

enter image description here

I think what happens is that some definitions get loaded first time which did not exist before. Once these are loaded, then the next time it works.

share|improve this answer
    
Wow, we posted the analytical result simultaneously... (+1) –  Jens Jul 28 '13 at 6:44
1  
seems to be a bug? –  Quonux Jul 28 '13 at 11:43
1  
Nice analysis! I always suspect there's a bug in Integrate but can't tell exactly what the bug is... –  Leo Fang Jul 28 '13 at 14:04
add comment

Your Answer

 
discard

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

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