I am trying to take the real part of the a complex expression using Refine function. However, the result doesn't come out as expected. The final result still contains Im function.

Does anyone have some idea what is going on here?

expr = x + (I*(y + z))/(m + I*n); 
evar = Variables[expr]; 
Refine[Re[expr], Element[evar, Reals]]


x - (y + z)*Im[1/(m + I*n)]
  • $\begingroup$ Try ComplexExpand[Re[x + (I (y + z))/(m + I n)]]. $\endgroup$ – J. M. will be back soon Mar 13 '18 at 14:36
  • 1
    $\begingroup$ It works but I have read that using Refine is better so I would like to use it. $\endgroup$ – anhnha Mar 13 '18 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.