# Strange result for the analytic integration leads to Hypergeometric2F1

The integration result for

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


is:

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


first Case: If I put x -> 2 and [Gamma] -> 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]


is:

-(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 + \[Gamma]))), 1 - 1/(2 (-2 + \[Gamma])), -r^(-4 + 2 \[Gamma]) 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:

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:

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

-
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. – Nasser Nov 11 '13 at 7:50
@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. – Soodeh Z. Nov 11 '13 at 8:00
For my project, I need to have integration result in terms of x and \gamma. So can I trust the result? – Soodeh Z. Nov 11 '13 at 8:11
"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 – Nasser Nov 11 '13 at 8:40

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]]

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