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

  • Context: Mathematica 
  • Thread starter Thread starter leastaction
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Discussion Overview

The discussion revolves around the behavior of Mathematica when evaluating the imaginary part of a variable under the assumption that it is real. Participants explore methods to simplify the expression Im[z] when z is constrained to real values.

Discussion Character

  • Technical explanation

Main Points Raised

  • One participant questions why Mathematica does not return 0 for Im[z] when z is specified as a real number, despite using various functions like Simplify and FullSimplify.
  • Another participant suggests using the global assumption $Assumptions = z ∈ Reals; and then applying Refine and FullSimplify to Im[z].
  • A third participant mentions that in their version of Mathematica, using Simplify[Im[x], Assumptions -> {Element[x, Reals]}] successfully returns 0.
  • A later reply indicates that the original participant found that Simplify[Im[z], Assumptions -> {Element[z, Reals]}] worked after some attempts, though they are unsure what changed.

Areas of Agreement / Disagreement

There appears to be some disagreement or uncertainty regarding the functionality of Mathematica across different versions, as well as the effectiveness of various commands to achieve the desired simplification.

Contextual Notes

Limitations include potential differences in Mathematica versions affecting command outcomes, and the specific conditions under which the assumptions are applied may not be fully resolved.

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 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K