>>> r, r1, r2 = symbols('r r1 r2', real=True)
>>> g1, g2, h1, h2 = symbols('g1 g2 h1 h2', cls=Function)
>>> g1=exp(I*r)
>>> h1=expand_complex(g1)
>>> h1
I*sin(r) + cos(r)
>>> h1.rewrite(exp)
exp(I*r)
>>> g2=r1*exp(I*r2)
>>> h2=expand_complex(g1)
>>> h2
I*r1*sin(r2) + r1*cos(r2)
>>> h2.rewrite(exp)
r1*(exp(I*r2)/2 + exp(-I*r2)/2) + r1*(exp(I*r2) - exp(-I*r2))/2
>>> h2.rewrite(exp).simplify()
r1*exp(I*r2)