Revision history [back]

Note that if you indent you code by 4 spaces, then it will be displayed nicely.

That said, i do not know how to to the conversion automatically. What is clear is that Maxima "knows" that those two quantities are equal:

sage: th = var('th')
sage: f = cos(th) + I*sin(th)
sage: g = e^(I*th)
sage: f == g
cos(th) + I*sin(th) == e^(I*th)
sage: bool(f == g)
True


I do not know how to do the conversion automatically. The best i can is:

sage: g.real_part().full_simplify()
cos(th)
sage: g.imag_part().full_simplify()
sin(th)