The integration result for

 Integrate[1/(r^2 Sqrt[x/r^(4 - 2 γ) + 1]), r]  


-((Sqrt[1 + r^(4 - 2 γ)/x]Hypergeometric2F1[1/2, (-1 + γ)/(2 (-2 + γ)), 1 + (-1 + γ)/(2 (-2 + γ)), -(r^(4 - 2 γ)/x)])/(r Sqrt[1 + r^(-4 + 2 γ) x] (-1 + γ)))

first Case: If I put x -> 2 and γ -> 3 in the result, I get:

-((Sqrt[1 + 1/(2 r^2)] (-2 r^2 + Sqrt[2] r^2 Sqrt[(1 + 2 r^2)/r^2]))/(r Sqrt[1 + 2 r^2]))     

Second case: On the other hand, the answer for

Integrate[1/(r^2 Sqrt[2/r^(4 - 6) + 1]), r]    


-(Sqrt[1 + 2 r^2]/r)

which is different from the previous answer. Why?

The second part of my question is that Maple gives:

 -(Hypergeometric2F1[1/2, -(1/(2 (-2 + γ))), 1 - 1/(2 (-2 + γ)), -r^(-4 + 2 γ) x]/r)    

as the result of the above integration. Why the answers of Mathematica and Maple are different? If I draw the integration results versus r, it is obvious that they are different. Did I miss some thing?

Edit 1: In the first case the result for r=1 is : -0.0857864 and in the second case the result for r=1 is : -1.5

Edit 2: The results of Mathematica and Maple: enter image description here

Edit 3 (Solution): With the help of Vašek Potoček, it seems that the difference between Mathematica and Maple outputs and also Case 1 and Case 2, is a constant value. Also one can uses the following relation to convert Maple output to Mathematica one:

enter image description here

In our case, the second term is a constant value.

  • $\begingroup$ It seems to do with a branch cut. The first Integrate did not know the value(s) that y can take, so it made a decision, and the second example, y was known, so this problem did not show up. By the time the integrate was finished, it was too late. Hence the substitution of same value for y did not give the same answer as the second Integrate. Adding Assumptions did not seem to help. $\endgroup$
    – Nasser
    Commented Nov 11, 2013 at 7:50
  • $\begingroup$ @Nasser: Thanks for your help. The problem is that I want to expand the integration result in terms of r and as you can see the difference between Mathematica and Maple answers, makes the expansion different. So it seems that if I put numerical values for x and \gamma, and then integrate, I get the same answers in Mathematica and Maple. $\endgroup$
    – Kheeyal
    Commented Nov 11, 2013 at 8:00
  • $\begingroup$ For my project, I need to have integration result in terms of x and \gamma. So can I trust the result? $\endgroup$
    – Kheeyal
    Commented Nov 11, 2013 at 8:11
  • $\begingroup$ "So can I trust the result?", well, I would not myself until I make sure I know what is going on. Since Maple gives different result, and since substitution gives different result than expected, this needs to be resolved first. I just tried it on Maple 17 for some values, Maple gave -1.73, and M gave -0.317. Screen shot: !Mathematica graphics So wait until someone knows more about these special functions and can suggest something? Notice how Maple used the csgn() function in its answer. I am no expert in these special functions and branch cuts..good luck $\endgroup$
    – Nasser
    Commented Nov 11, 2013 at 8:40

1 Answer 1


Actually, your two results only differ by a constant of $\pm\sqrt2$. This is perfectly OK as you are dealing with indefinite integration. Try:

Integrate[1/(r^2 Sqrt[x/r^(4 - 2 \[Gamma]) + 1]), r];
a = FullSimplify[% /. {x -> 2, \[Gamma] -> 3}]
b = Integrate[1/(r^2 Sqrt[2/r^(4 - 6) + 1]), r]
Assuming[r \[Element] Reals, FullSimplify[a - b]]
  • $\begingroup$ Thanks. But it is not the case for other values of \gamma and x. Try x=3 and \gamma=4. $\endgroup$
    – Kheeyal
    Commented Nov 11, 2013 at 12:42
  • $\begingroup$ Also the argument of Hypergeometric2F1 is -(r^(4 - 2 [Gamma])/x) for Mathematica and -r^(-4 + 2 [Gamma]) x for Maple. $\endgroup$
    – Kheeyal
    Commented Nov 11, 2013 at 12:44
  • $\begingroup$ It does (with a different constant), just that Mathematica is unable to simplify the expression. Try plotting the difference as a function of $r$. $\endgroup$
    – The Vee
    Commented Nov 11, 2013 at 12:46
  • 1
    $\begingroup$ The different arguments can be attributed to various identities holding for $_2F_1$. There's a LOAD of those: functions.wolfram.com/HypergeometricFunctions/Hypergeometric2F1/… $\endgroup$
    – The Vee
    Commented Nov 11, 2013 at 12:49
  • $\begingroup$ Thanks a lot. So the difference is a constant value, not necessarily Sqrt[2]. $\endgroup$
    – Kheeyal
    Commented Nov 11, 2013 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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