Mathematica Mathematica: Im[z] = 0 if z is real?

  • Thread starter Thread starter leastaction
  • Start date Start date
  • Tags Tags
    Mathematica
AI Thread Summary
The discussion revolves around an issue with Mathematica where the imaginary part of a real variable, specified as Element[z, Reals], does not evaluate to zero as expected. Initially, attempts to use Simplify, FullSimplify, and Evaluate did not yield the desired result, with Im[z] returning unchanged. However, it was later confirmed that using the command Simplify[Im[z], Assumptions -> {Element[z, Reals]}] successfully evaluates to 0 in Mathematica version 6 and above. The user expressed confusion over the initial failure, but ultimately found that the assumptions feature worked as intended.
leastaction
Messages
5
Reaction score
0
Hi there!

A stupid question maybe but I've found this issue neither in the Mathematica documentation nor in the web:

I specified Element[z, Reals] but if I want to evaluate Im[z], Mathematica just says Im[z] again instead of 0. I tried Simplify, FullSimplify and Evaluate but nothing worked. I also tried Simplify[Im[z], Assumptions->{Element[z, Reals]}] but this didn't work either. Any ideas?

Thanks!
 
Physics news on Phys.org
if its mathematica 6 or above

$Assumptions = z \[Element] Reals;
Im[z]
Refine[Im[z]]
FullSimplify[Im[z]]
 
and
"Simplify[Im[x], Assumptions -> {Element[x, Reals]}]"

works on my version. says 0.
 
Thanks! Simplify[Im[z], Assumptions -> {Element[z, Reals]}] now works fine... I don't know what I did yesterday...
 

Similar threads

Replies
1
Views
2K
Replies
3
Views
6K
Replies
5
Views
2K
Replies
2
Views
2K
Replies
5
Views
3K
Replies
1
Views
2K
Replies
1
Views
3K
Back
Top