The documentation for Simplify states "Quantities that appear algebraically in inequalities are always assumed to be real."
–
Andrew MacFieMar 26 '12 at 12:21

Ok, so it is obviously true for Simplify. The question is, is it true for everything else? I still think the answer is generally yes, but there might be some exceptions (and bugs) of course...
–
sebhoferMar 26 '12 at 12:37

It is assumed that $x$ is a real number. Everything else would mathematically not make sense because on complex numbers there does not exist an ordering relation.

An example would be to take the expression $\sqrt{x^2}$ and to imagine that this is not equal $x$ for $x=-\mathbb{i}$. Therefore the expression is in a general form not simplified

In[37]:= Sqrt[x^2]
(* Out[37]= Sqrt[x^2] *)

If you now say that $x \geq 0$ should hold you get

In[33]:= Assuming[x >= 0, Refine[Sqrt[x^2]]]
(* Out[33]= x *)

Note that if $x \geq 0$ would mean the real part is non-negative, the value $x=-\mathbb{i}$ would still be possible. Therefore, it can be assumed, that using an ordering does automatically force the variable to be real.

In all your examples when have assumed x>0 it is not necessary to assume Element[x,Reals]. In other words, if x>0&&Element[x,Reals] is equivalent to just x>0. This was, I think, the point of the question.
–
Andrzej KozlowskiMar 26 '12 at 10:24

This should be like you said, but it seems that Mathematica sometimes cannot distinguish differences. I mean it could be nice if Mathematica had returned in the second example that x was implicitly assumed to be real. In that case the difference between the second and the third examples would not be inconvenient. I think it is important to point out when some assumptions are important, becaue that would be really helpful.
–
ArtesMar 26 '12 at 10:48

Your second example is exactly the same as Assuming[y > 0 && Re[x] > 0, Integrate[1/Sqrt[z^2 + y^2], {z, -x, x}]]. In other words, most of your assumptions are not needed. Your third example is exactly equivalent to Assuming[y > 0, Integrate[1/Sqrt[z^2 + y^2], {z, -x, x}]]. Again, you have unneeded assumptions. You also seem to be misunderstanding the meaning of Conditional. It means that Mathematica returns an answer which is valid only when the condition is satisfied and may be invalid otherwise. To see the point try Integrate[1/Sqrt[z^2 + y^2], {z, -x, x}].
–
Andrzej KozlowskiMar 26 '12 at 11:08

I think I missed your point. Sorry. I now think there is actually a bug involved in your second example: Mathematica does assume that x is real even though this assumption is not specified. One can see this by evaluating Assuming[y > 0 && Im[x] != 0, Integrate[1/Sqrt[z^2 + y^2], {z, -x, x}]]. I don't think that in this example Mathematica's behaviour is intentionally misleading.
–
Andrzej KozlowskiMar 26 '12 at 11:20

1

@AndrzejKozlowski I could give a more complete explaining of what I meant, but I haven't time right now. I think these examples are good to describe a general statement that M sometimes implicitly assumes variables to be real although we assumed them to be complex. I disagree with that I don't understant ConditionalExpression.
–
ArtesMar 26 '12 at 12:12

Mathematica will always assume that all the arguments of an inequality relation are real but there are situations the presence of an inequality will lead to a stronger assumption. This is the case with Reduce. If you evaluate:

Reduce[x^2 + y^2 <= 1, {x, y}]

Mathematica will assume that both x and y are real. If you do not want this assumption you need to tell Reduce explicitly:

As you can see in my second example Mathematica implicitly assumes x is real although I assumed x to be complex. I mean it should be ConditionalExpression[2 Log[(x + Sqrt[x^2 + y^2])/y], x > 0] as in the third example.
–
ArtesMar 26 '12 at 10:53

Really, there is no need for "hints". This is indeed so, full stop. It is to ask people who have programmed these functions and they have already answered such questions in great detail, more then once (on MathGroup).
–
Andrzej KozlowskiMar 26 '12 at 16:45

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.