# infinite integral does not yield the correct answer

I would like to perform the following integration:

$$\int\limits_0^{\infty } \frac{1}{r \sqrt{\left(r^2-m\right) \left(\frac{r^2}{\text{r0}^2}-1\right)}} \, dr$$

(m and r0 are constants) and get the below simplified answer $$\frac{\log \left(\frac{\sqrt{m}+\text{r0}}{\text{r0}-\sqrt{m}}\right)}{\sqrt{m}}$$

I can't get the above answer. The Integrate commands yield a complicated answer which has no similarity to the simplified answer.

The Code for its definite integral is

Integrate[1/(r Sqrt[(r^2 - m) (r^2/r0^2 - 1)]), r]

• Can you please post your code ? – Lotus Jul 10 '17 at 13:07
• I added the definite integral code but its indefinite one say that the integral does converge on specified interval. – PhysicsExams Jul 10 '17 at 13:16
• You can use Assumptions as an option to Integrate to give it more information about your parameters/variables. E.g. Assumptions->{r0>0,r>r0,r>m} to get possibly simpler answers. – Thies Heidecke Jul 10 '17 at 13:18
• Also with your current code example, you are asking Mathematica for an indefinite integral, whereas in your original formula you are interested in a definite integral with infinite limits, which can be much easier to compute in many cases. You can use Integrate[1/(r Sqrt[(r^2 - m) (r^2/r0^2 - 1)]), {r,0,Infinity}] to get the equivalent in Mathematica. – Thies Heidecke Jul 10 '17 at 13:22

If you change some parameters, you get the desired result.

Integrating von 0 to Infinity gives you the message, that it doesn't converge.

int0[r0_, m_] =
Integrate[1/(r Sqrt[(r^2 - m) (r^2/r0^2 - 1)]), {r, 0, Infinity},
Assumptions -> 0 < r0 && m < r0]

(*     Integrate::idiv: Integral of 1/(r Sqrt[(-m+r^2) (-1+r^2/r0^2)])
does not converge on {0,\[Infinity]}. >>     *)


Numerical integration begining from r0 gives a good result

nint[r0_, m_] :=
NIntegrate[1/(r Sqrt[(r^2 - m) (r^2/r0^2 - 1)]), {r, r0, Infinity},
MaxRecursion -> 200] // Quiet

Plot[nint[1, m], {m, -5, 2}]


If you correct your simplified answer by a factor of 1/2, you get the same picture (not shown here)

simAnswer[r0_, m_] = Log[(Sqrt[m] + r0)/(-Sqrt[m] + r0)]/(2 Sqrt[m])



Both imply that m has to be m < r0

Integrate with this assumptions

int[r0_, m_] =
Integrate[1/(r Sqrt[(r^2 - m) (r^2/r0^2 - 1)]), {r, r0, Infinity},
Assumptions -> 0 < r0 && m < r0]

(*     (-ArcTanh[1 - (2 m)/r0^2] + 2 ArcTanh[r0/Sqrt[m]] +
Log[-(Sqrt[-m + r0^2]/Sqrt[m])])/(2 Sqrt[m])     *)


Plot again gives the same result (not shown here)

Plot[int[1, m], {m, -5, 2}]


Unfortunately MMA doesn't manage to show the difference is zero

fs[r0_, m_] =
FullSimplify[int[r0, m] - simAnswer[r0, m] // ExpToTrig,
0 < r0 && m < r0]

(*     -(1/(2 Sqrt[m]))(ArcTanh[1 - (2 m)/r0^2] - 2 ArcTanh[r0/Sqrt[m]] +
Log[(Sqrt[m] + r0)/(-Sqrt[m] + r0)] -
Log[-(Sqrt[-m + r0^2]/Sqrt[m])])     *)


But a grafik shows both results are equal

Plot[int[1, m] - simAnswer[1, m], {m, -5, .99}, MaxRecursion -> 8,
PlotPoints -> 500, Exclusions -> {0}, PlotRange -> 10^-14]