PDA

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


leastaction
Oct6-09, 05:40 AM
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!!

Hepth
Oct7-09, 01:44 AM
if its mathematica 6 or above

$Assumptions = z \[Element] Reals;
Im[z]
Refine[Im[z]]
FullSimplify[Im[z]]

Hepth
Oct7-09, 01:45 AM
and
"Simplify[Im[x], Assumptions -> {Element[x, Reals]}]"

works on my version. says 0.

leastaction
Oct7-09, 05:07 AM
Thanks!! Simplify[Im[z], Assumptions -> {Element[z, Reals]}] now works fine... I don't know what I did yesterday...