Transforming complex exponentials into sin and cos

### 10.2.13 Transforming complex exponentials into sin and cos

The sincos or exp2trig command uses the identity ei x=cos(x)+isin(x) to rewrite complex exponentials in terms of sine and cosine.

- sincos takes expr, an expression containing complex exponentials.
- sincos(expr) rewrites expr in terms of sin and cos.

#### Examples

sincos(exp(i*x))

cosx+i sinx |  |  |  |  |  |  |  |  |  |

exp2trig(exp(-i*x))

cosx−i sinx |  |  |  |  |  |  |  |  |  |

simplify(sincos(((i)*(exp((i)*x))^2-i)/(2*exp((i)*x))))

or:

simplify(exp2trig(((i)*(exp((i)*x))^2-i)/(2*exp((i)*x))))

−sinx |  |  |  |  |  |  |  |  |  |