I am trying to evaluate the following:

Simplify[Meter Nano Re[(a + I b)/(Meter Nano)], Assumptions -> Element[{a, b}, Reals]]

However, Mathematica returns:

Meter*Nano*Re[(a + I*b)/(Meter*Nano)]

And if I try:

Convert[Meter Nano Re[(a + I b)/(Meter Nano)], 1]

I get the error:

Convert::incomp: "Incompatible units in Meter Nano Re[(a+I b)/(Meter Nano)] and 1."

How can I factor out the "Meter Nano" from within Re[] and simplify the above to:


One solution:

As suggested by rcollyer, use ComplexExpand:

ComplexExpand[Meter Nano Re[(a + I b)/(Meter Nano)]]

which gives


Note: ComplexExpand, as written above, assumes a and b are Reals.

  • 1
    $\begingroup$ Have you tried ComplexExpand? $\endgroup$
    – rcollyer
    Apr 2, 2013 at 3:26
  • $\begingroup$ Please use the code markup, as per my edits, to display code. $\TeX$, while pretty, does not copy well. $\endgroup$
    – rcollyer
    Apr 2, 2013 at 3:41

1 Answer 1

ComplexExpand[Meter Nano Re[(a + I b)/(Meter Nano)]]


As a side note: in v9, the Miscellaneous`Units` package that you are using (and which you don't mention in your question) has been superseded by the new built-in unit system. The above expression would have been simplified without Simplify:

Quantity[1, "Nanometers"]Re[Quantity[a + I*b, "Nanometers"^(-1)]] 

-Im[b] + Re[a]


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.