# A calculus of the absurd

##### 14.7.2 Writing complex numbers in terms of the exponential function

Using Euler’s formula, it is possible to write both $$\cos (\theta )$$ and $$\sin (\theta )$$ in terms of $$e^{x}$$. As $$e^{i\theta } = \cos (\theta ) + i\sin (\theta )$$, and $$e^{-ix} = \cos (-\theta ) + i\sin (-\theta ) = \cos (\theta ) - i\sin (\theta )$$ we can either add or subtract these two quantities in order to write both trigonometric functions in terms of $$e$$.

For $$\cos (x)$$, we can add $$e^{ix}$$ and $$e^{-ix}$$.

\begin{align} e^{ix} + e^{-ix} & = \cos (\theta ) - i\sin (\theta ) + \cos (\theta ) + i\sin (\theta ) \\ & = 2\cos (\theta ) \end{align}

Thus we can say that

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

for all values of x. 108108 Which looks remarkably like a hyperbolic function!.

We can do a similar thing for $$\sin (x)$$.

\begin{align} e^{ix} - e^{-ix} & = \cos (\theta ) - i\sin (\theta ) - (\cos (\theta ) + i\sin (\theta )) \\ & = -2i\sin (\theta ) \end{align}

Which means that

$$\sin (x) = \frac {e^{ix} - e^{-ix}}{-2i}$$