# Revision history [back]

### How to convert "cos(th)+i*sin(th)" to "e^(i*th)"?

This question is perhaps trivial but annoying. I don't expect a quick answer.

sage: th = var('th') sage: th.simplif th.simplify th.simplify_factorial th.simplify_log th.simplify_rational th.simplify_exp th.simplify_full th.simplify_radical th.simplify_trig

sage: e^(Ith).simplify_trig() e^(Ith) sage: e^(Ith).simplify_exp() e^(Ith) sage: e^(Ith).simplify_full() e^(Ith) sage: th.simplif th.simplify th.simplify_factorial th.simplify_log th.simplify_rational th.simplify_exp th.simplify_full th.simplify_radical th.simplify_trig

sage: f = cos(th) + Isin(th) sage: f.simp f.simplify f.simplify_factorial f.simplify_log f.simplify_rational f.simplify_exp f.simplify_full f.simplify_radical f.simplify_trig sage: f.simplify_trig() Isin(th) + cos(th) sage: f.simplify_exp() Isin(th) + cos(th) sage: f.simplify_full() Isin(th) + cos(th)

That is all I have tried.

### How to convert "cos(th)+i*sin(th)" to "e^(i*th)"?

This question is perhaps trivial but annoying. I don't expect a quick answer.

The following are all I have tried.

sage: th = var('th') sage: th.simplif var('th')

sage: th.simplif

th.simplify th.simplify_factorial th.simplify_log th.simplify_rational th.simplify_exp th.simplify_full th.simplify_radical th.simplify_trig

sage: e^(Ith).simplify_trig() e^(Ith) sage: e^(Ith).simplify_exp() e^(Ith) sage: e^(Ith).simplify_full() e^(Ith) sage: th.simplif e^(I*th).simplify_trig()

e^(I*th)

sage: e^(I*th).simplify_exp()

e^(I*th)

sage: e^(I*th).simplify_full()

e^(I*th)

sage: th.simplif

th.simplify th.simplify_factorial th.simplify_log th.simplify_rational th.simplify_exp th.simplify_full th.simplify_radical th.simplify_trig

sage: f = cos(th) + Isin(th) sage: f.simp I*sin(th)

sage: f.simp

f.simplify f.simplify_factorial f.simplify_log f.simplify_rational f.simplify_exp f.simplify_full f.simplify_radical f.simplify_trig sage: f.simplify_trig() Isin(th) + cos(th) sage: f.simplify_exp() Isin(th) + cos(th) sage: f.simplify_full() Isin(th) f.simplify_trig

sage: f.simplify_trig()

I*sin(th) + cos(th)

sage: f.simplify_exp()

I*sin(th) + cos(th)

sage: f.simplify_full()

I*sin(th) + cos(th)

That is all I have tried.

### How to convert "cos(th)+i*sin(th)" to "e^(i*th)"?

This question is perhaps trivial but annoying. I don't expect a quick answer.

The following are all I have tried.

sage: th = var('th') sage: th.simplif var('th')

sage: th.simplif

th.simplify            th.simplify_factorial  th.simplify_log        th.simplify_rational
th.simplify_exp        th.simplify_full       th.simplify_radical    th.simplify_trig  sage: e^(I*th).simplify_trig() e^(I*th) sage: e^(I*th).simplify_exp() e^(I*th) sage: e^(I*th).simplify_full() e^(I*th) sage: th.simplif th.simplify_trig

----------

sage: e^(I*th).simplify_trig()

e^(I*th)

sage: e^(I*th).simplify_exp()

e^(I*th)

sage: e^(I*th).simplify_full()

e^(I*th)

sage: th.simplif

th.simplify            th.simplify_factorial  th.simplify_log        th.simplify_rational

----------

sage: f = cos(th) + I*sin(th) sage: f.simp I*sin(th)

sage: f.simp

f.simplify            f.simplify_factorial  f.simplify_log        f.simplify_rational
f.simplify_exp        f.simplify_full       f.simplify_radical    f.simplify_trig sage: f.simplify_trig() f.simplify_trig

sage: f.simplify_trig()

I*sin(th) + cos(th) sage: f.simplify_exp() cos(th)

sage: f.simplify_exp()

I*sin(th) + cos(th) sage: f.simplify_full() cos(th)

sage: f.simplify_full()

I*sin(th) + cos(th)cos(th)


### How to convert "cos(th)+i*sin(th)" to "e^(i*th)"?

This question is perhaps trivial but annoying. I don't expect a quick answer.

The following are all I have tried.

sage: th = var('th')

----------

sage: th.simplif
e^(I*th).simplify_trig()     th.simplify e^(I*th)
sage: e^(I*th).simplify_exp()
e^(I*th)
sage: e^(I*th).simplify_full()
e^(I*th)      th.simplify_factorial  th.simplify_log        th.simplify_rational

----------

sage: e^(I*th).simplify_trig()

e^(I*th)

sage: e^(I*th).simplify_exp()

e^(I*th)

sage: e^(I*th).simplify_full()

e^(I*th)

sage: th.simplif

th.simplify            th.simplify_factorial  th.simplify_log        th.simplify_rational

----------

sage: f = cos(th) + I*sin(th)

sage: f.simp

f.simplify I*sin(th)
sage: f.simplify_trig()
I*sin(th) + cos(th)    f.simplify_factorial  f.simplify_log
sage: f.simplify_exp()
I*sin(th) + cos(th)   f.simplify_rational
f.simplify_exp

sage: f.simplify_trig()

I*sin(th) + cos(th)

sage: f.simplify_exp()

I*sin(th) + cos(th)

sage: f.simplify_full()

I*sin(th) + cos(th)