# Rationalize complex numbers

What is the best way to rationalize complex numbers, if not both the real and imaginary part are actually rational?

According to the documentation, Rationalize works on complex numbers, but apparently only when both the real and the imaginary part can be rationalized, for example

Rationalize[N[4/3 + I 2/3]]
(*4/3 + I 2/3*)


However, Rationalize[N[4/3 + I Sqrt[2]/3]] is not simplified, whereas I would like it to return 4/3 + I 0.471405.

Thanks.

• Seeing as 4/3 + I N[ Sqrt[2]/3] is immediately and automatically converted to 1.33333 + 0.471405 I, I don't see how it can be done. Oct 18, 2014 at 23:00
• Thanks for this observation. I suppose, using HoldForm will do for me. Oct 18, 2014 at 23:20

## 1 Answer

It's not the exact output you requested but in case you are not aware of the second parameter of Rationalize:

Rationalize[N[4/3 + I Sqrt[2]/3], 1*^-6]

4/3 + (272 I)/577


If your hybrid output really is desired then perhaps building on m_goldberg's deleted answer:

# + Defer[#2 I] & @@ Rationalize /@ {Re@#, Im@#} & @ N[4/3 + I Sqrt[2]/3]

4/3 + 0.471405 I