# Simplifying Complex Numbers that contain physical units

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:

a

One solution:

As suggested by rcollyer, use ComplexExpand:

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

which gives

 a 

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

-
Have you tried ComplexExpand? – rcollyer Apr 2 '13 at 3:26
thanks rcollyer! ComplexExpand works. – Sunil Sandhu Apr 2 '13 at 3:32
Please use the code markup, as per my edits, to display code. $\TeX$, while pretty, does not copy well. – rcollyer Apr 2 '13 at 3:41

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


a

As a side note: in v9, the MiscellaneousUnits 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]

-