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

  • Mathematica
  • Thread starter leastaction
  • Start date
  • Tags
    Mathematica
In summary, the conversation discusses an issue with evaluating the imaginary part of a variable with a specified assumption in Mathematica. The solutions suggested include using Simplify, FullSimplify, and Evaluate, as well as setting the assumption using $Assumptions. Ultimately, using Simplify with the assumption {Element[z, Reals]} was found to work.
  • #1
leastaction
5
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
  • #2
if its mathematica 6 or above

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

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

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

1. What is Mathematica?

Mathematica is a software program developed by Wolfram Research for performing mathematical computations, data analysis, and visualization. It is commonly used by scientists, engineers, and mathematicians in a wide range of fields.

2. What does Im[z] = 0 mean in Mathematica?

In Mathematica, Im[z] = 0 means that the imaginary part of the complex number z is equal to 0. This indicates that the number is purely real and has no imaginary component.

3. How do you use Im[z] = 0 in Mathematica?

To use Im[z] = 0 in Mathematica, you can simply type the expression into the input bar or use the Im function with a real number as the argument. For example, Im[2] will return 0.

4. What is the significance of Im[z] = 0 in mathematical equations?

In mathematical equations, Im[z] = 0 indicates that the solution is a real number. This can be useful in solving problems involving real-world quantities and measurements.

5. Can Im[z] = 0 be used to test if a number is real in Mathematica?

Yes, Im[z] = 0 can be used as a test for real numbers in Mathematica. If the expression evaluates to 0, it indicates that the number is real. However, it is important to note that this is not a foolproof test and there may be cases where it does not accurately determine the realness of a number.

Similar threads

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