# Inconsistent Integrate behavior?

Evaluating the following integral with Mathematica

Integrate[q0/(-1 + q0^2), {q0, 0, A}]


gives a conditional expression

ConditionalExpression[
-((I π)/2) + 1/2 Log[-1 + A^2], -1 < Re[A] <= 1 || A ∉ Reals]


However, evaluating

Integrate[q0/(-1 + 12 q0^2), {q0, 0, A}]


Mathematica returns

-(1/24) I (π + I Log[-1 + 12 A^2])


Is this a bug or is there a reason for this behavior?

(Mathematica Ver.10.3.1)

• And why do you think it is inconsistent? Commented Apr 26, 2016 at 11:51
• shouldn't I get a conditional expr. in the second example? Commented Apr 26, 2016 at 11:53
• Use 12. A^2 and you will see it. Commented Apr 26, 2016 at 12:00
• @Sumit: This makes no sense: I would like to do the integration analytically, thus, why should I use here "12."? Commented Apr 26, 2016 at 12:05
• you can do this: Integrate[q0/(-1 + b q0^2), {q0, 0, A}] /. b -> 12 to get your conditional expression. I agree this is an inconsistency. You can also see the issue if you do Integrate[q0/(-1 + 12 q0^2), {q0, 0, 1}] you get a correct message that the integral does not converge while Integrate[q0/(-1 + 12 q0^2), {q0, 0, A}] /. A -> 1 gives an erroneous result. Commented Apr 26, 2016 at 14:45

Integrate[q0/(-1 + a q^2), q]


$\frac{\log \left(1-a \text{q}^2\right)}{2 a}$

When you put limit [0,A], it has no problem with q=0. But it is not defined when $aA^2>1$. So you always have to obey that condition. You can check that by

Integrate[q0/(-1 + a q0^2), {q0, 0, A}]


In your second case Integrate[q0/(-1 + 12. q0^2), {q0, 0, A}] does not show the condition but you can see it in the answer. To avoid this you can use floating number like

Integrate[q0/(-1 + 12. q0^2), {q0, 0, A}]


ConditionalExpression[ 0.103538 + 0.0416667 Log[0.288675 - 1. A] + 0.0416667 Log[0.288675 + 1. A], -0.288675 < Re[A] <= 0.288675 || A [NotElement] Reals]

If you want to see the condition, then you might want to give mathematica a heads up with an Assumption like

Integrate[q0/(-1 + 12 q0^2), {q0, 0, A},Assumptions -> A \[Element] Reals]


$\text{ConditionalExpression}\left[\frac{1}{24} \log \left(1-12 A^2\right),A>0 ~ \&\& ~ 6 A\leq \sqrt{3}\right]$

Otherwise you may not get a condition, specially while dealing with exact numbers.

• My problem is: Following your example: Using a=1 leads to a result which includes the conditional expression. Using a=12 does NOT return the conditional expression, but it should to have a consistent behavior. Commented Apr 26, 2016 at 12:13
• I get your point. Sometimes it happen specially when you work with exact number. It will also happen with 2 or 3. Commented Apr 26, 2016 at 12:45