Message Boards Message Boards

0
|
4934 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

[?] Get the imaginary part of an equation?

Posted 5 years ago

So I have an expression called "y" in the form X+i*Y. I need to get X and Y respectively as separate expressions. Obviously, Re[y]=X and Im[y]=Y. But for some reason functions Re[] and Im[] do not return what I expect. Even though I explicitly defined my variables "a" and "w" as Real numbers. Why is that?

theproblem

POSTED BY: Daniel Voloshin

You assumed w to be real in the previous input, but Mathematica does not remember that. There are various ways to get what you want:

Im[x + I*y]
ComplexExpand[Im[x + I*y]]
Simplify[Im[x + I*y], Element[x | y, Reals]]
Assuming[Element[x | y, Reals], Refine[Im[x + I*y]]]
$Assumptions = Element[x | y, Reals]
Refine[Im[x + I*y]]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract