2
$\begingroup$

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)

$\endgroup$
5
  • $\begingroup$ And why do you think it is inconsistent? $\endgroup$
    – Sumit
    Apr 26, 2016 at 11:51
  • $\begingroup$ shouldn't I get a conditional expr. in the second example? $\endgroup$ Apr 26, 2016 at 11:53
  • $\begingroup$ Use 12. A^2 and you will see it. $\endgroup$
    – Sumit
    Apr 26, 2016 at 12:00
  • $\begingroup$ @Sumit: This makes no sense: I would like to do the integration analytically, thus, why should I use here "12."? $\endgroup$ Apr 26, 2016 at 12:05
  • 1
    $\begingroup$ 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. $\endgroup$
    – george2079
    Apr 26, 2016 at 14:45

1 Answer 1

2
$\begingroup$

Lets start with a simpler case

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.

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$ Apr 26, 2016 at 12:13
  • $\begingroup$ I get your point. Sometimes it happen specially when you work with exact number. It will also happen with 2 or 3. $\endgroup$
    – Sumit
    Apr 26, 2016 at 12:45

Your Answer

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

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