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

  • Context: Mathematica 
  • Thread starter Thread starter leastaction
  • Start date Start date
  • Tags Tags
    Mathematica
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 5K views
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...