# Separating the real and imaginary parts [closed]

if i have a complex variable z=x+iy, is there an inbuilt Mathematica function that extracts the real or imaginary parts of z. Something like Re[z] which would give Re[z]=x or Im[z]=y. Obviously this is a simple example that I wish to apply to a more complex situation.

I have a variable (which I would like to define as 1/qo but it is tag protected)

qoInv = (-1 + I*f/zi)/(f - d + f*d*I/zi)


I would like to extract the real and imaginary parts of qoInv so I can solve a simultaneous equation by equating Re[qoInv]= 1/Ro and Im[qoInv]=1/zo, how do I go about doing this?

## closed as off-topic by J. M. will be back soon♦Oct 2 '16 at 12:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – J. M. will be back soon
If this question can be reworded to fit the rules in the help center, please edit the question.

• Am I missing something? Re and Im are built-ins that do just that... – ciao Aug 22 '16 at 7:13
• That's odd.. I tried to use them and it didn't work. Maybe I did something wrong. I'll try again. – NormalsNotFar Aug 22 '16 at 7:13
• I updated my post to show my result.. Is this supposed to be how it works? – NormalsNotFar Aug 22 '16 at 7:18
• Per my comment, that's the expected output. You can either specify the domains, like FullSimplify[Re[x + I*y], {x, y} \[Element] Reals], or make a function to do the work and/or pattern transform for you. – ciao Aug 22 '16 at 7:24
• Or use ComplexExpand – Simon Rochester Aug 22 '16 at 7:29