# Inconsistent results for Integrate depending on irrelevant assumptions

I stumbled across this amusing issue today when doing some definite integrals:

integrand[x_] := Sqrt[1 + a (-1 + x)]
Integrate[integrand[x], {x, -1, 1}, Assumptions -> True]
Integrate[integrand[x], {x, -1, 1}, Assumptions -> sky == "blue"]


which then gives the results

(2 (1 - (1 - 2 a)^(3/2)))/(3 a)


and

ConditionalExpression[(2 - 2 Sqrt[1 - 2 a] + 4 Sqrt[1 - 2 a] a)/( 3 a),
Re[1/a] == 1 || Re[1/a] >= 2 || Re[1/a] <= 0 || 1/a \[NotElement] Reals)
&& Re[a] < 1]


As you can see, the results appear quite different, even though the input varied only by adding an utterly irrelevant assumption. The latter result is the same as the former, within its limited domain of applicability. But is the former result generally correct?

I'm using Mathematica 9.0.1, if that makes any difference. The above was performed on a freshly restarted kernel.

• looks like perhaps changing the assumptions is impacting the default generateconditions behavior. see what you get if you explicitly set that. – george2079 Dec 10 '14 at 13:53
• Are you asking "why this happens?" or "is the former result generally correct?" ? – Dr. belisarius Dec 10 '14 at 15:06
• What happens when pigs fly? :) – Michael E2 Dec 10 '14 at 16:20
• @MichaelE2 Then they start playing good music – Dr. belisarius Dec 10 '14 at 17:58

confirming my comment..

   Integrate[ Sqrt[ 1 + a (x - 1) ] , {x, -1, 1}],
Integrate[ Sqrt[ 1 + a (x - 1) ] , {x, -1, 1}, Assumptions -> True]
Integrate[ Sqrt[ 1 + a (x - 1) ] , {x, -1, 1}, GenerateConditions -> True]
Integrate[ Sqrt[ 1 + a (x - 1) ] , {x, -1, 1}, Assumptions -> {y == 3}]
Integrate[ Sqrt[ 1 + a (x - 1) ] , {x, -1, 1}, Assumptions -> {Re[1/a] != 1}]
Integrate[ Sqrt[ 1 + a (x - 1) ] , {x, -1, 1}, Assumptions -> {Element[a, Reals]}] Pretty much any non-default Assumption sets GenerateConditions->True. (why it defaults to False in this case is a fair question)

Looking at another example:

Integrate[ 1/(1 - a x) , {x, -1, 1}]
Integrate[ 1/(1 - a x) , {x, -1, 1}, Assumptions -> True]
Integrate[ 1/(1 - a x) , {x, -1, 1}, GenerateConditions -> True]
Integrate[ 1/(1 - a x) , {x, -1, 1}, Assumptions -> {y == 3}]
Integrate[ 1/(1 - a x) , {x, -1, 1}, Assumptions -> {Element[a, Reals]}] We see again the superfluous assumption has evidently set GenerateConditions->True. Oddly the default here gives a different conditional expression.

• +1 I've seen GenerateConditions default to False when there is only one conditional before – Dr. belisarius Dec 10 '14 at 15:52
• Thanks for the answer. I never realised that GenerateConditions defaulted to False - that seems quite dangerous. I suppose it could be because generating conditions is quite slow. – Widjet Dec 11 '14 at 0:14