Let’s assume I input
Assuming[x > 0, expression]
Is it assumed by Mathematica that $x$ is a real number? Or that the real part of $x$ is positive? Something else?
A simple Mathematica illustration would be welcome.
|
Let’s assume I input
Is it assumed by Mathematica that $x$ is a real number? Or that the real part of $x$ is positive? Something else? A simple Mathematica illustration would be welcome. |
||||
|
The most direct way to test this is probably the following:
So $x>0$ seems to imply that $x$ is real. |
|||||||||||||||
|
|
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
If you now say that $x \geq 0$ should hold you get
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 general the situation is much more subtle than the other answers suggest. For example this issue is present in version 8 while not in version 7 :
The identical integrand (not depending on One may encounter certain inconsequences working with these examples :
For example assuming in (III) weaker conditions we get
|
|||||||||||||
|
|
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
Mathematica will assume that both x and y are real. If you do not want this assumption you need to tell
|
||||
|
|
The most direct hint that
|
|||
|
xinside your function is greater than zero (i.e., $x \in \mathbb{N}$)? – night owl Mar 26 '12 at 8:57