# trig_to_exp function

Rewrite trigonometric functions as complex exponentials.

## How to write it

### trig_to_exp(expr)

**expr**

Any expression: a number, a formula, a list or a matrix. Takes an expression.

## Examples

- $\displaystyle \cos(x) = \frac{e^{i x}+e^{-i x}}{2}$

  `trig_to_exp(cos(x))`

  In the solver, `trig_to_exp(cos(x))` gives `(e^(i*x) + e^(-i*x))/2`.

  [Open in the solver](https://hilberon.com/?q=trig_to_exp%28cos%28x%29%29)

## Functions its examples use

- [cos](https://hilberon.com/library/cos)

  Cosine of an angle in radians.

## Related functions

- [exp_to_trig](https://hilberon.com/library/exp_to_trig)

  Rewrite complex exponentials as trigonometric functions.
- [trig_reduce](https://hilberon.com/library/trig_reduce)

  Rewrite powers and products of trigonometric functions as functions of multiple angles.
- [trig_expand](https://hilberon.com/library/trig_expand)

  Expand trigonometric functions of sums and multiples of angles.
- [arccos](https://hilberon.com/library/arccos)

  Inverse cosine: the angle in radians whose cosine is a number.
- [arccosh](https://hilberon.com/library/arccosh)

  Inverse hyperbolic cosine.
- [arccot](https://hilberon.com/library/arccot)

  Inverse cotangent, in radians.

---
Source: https://hilberon.com/library/trig_to_exp
