Euler's Formula and Trig Identities
====
###### tags: `trig` `complex` `features`
[TOC]
## Statement and Application to Trig Identities
Euler's formula relates complex algebraic operations and trig functions in a beautiful way. Very simply it says;
$$
e^{it} = \cos(t) + i\sin(t)
$$
This allows the quick derivation of trig identities using only complex addition and multiplication.
### Example 1: Sum of angle formulas
\begin{align*}
\cos(a+b)+i\sin(a+b)&=e^{i(a+b)}\\
&=e^{ia}e^{ib}\\
&=(\cos(a)+i\sin(a))(\cos(b)+i\sin(b))\\
&=(\cos^2(a)-\sin^2(b))+i(\cos(a)\sin(b)+\sin(a)\cos(b))
\end{align*}
Since $u+iv=u'+iv'$ iff $u=u'$ and $v=v'$ it follows that
\begin{align*}
\cos(a+b)&=\cos^2(a)-\sin^2(b)\\
\sin(a+b)&=\cos(a)\sin(b)+\sin(a)\cos(b)
\end{align*}
### Exercise1 : Derive the difference formula in the same way.
**Note**: It is also trivial to derive the difference formul directly from the sum formula, but try it as done above.
Similarly, all all double-angle and half-angle formulas can be derived.
## Geometric Implications
Any point in the complex plain can be written as $z=a+ib=|z|(a/|z| + ib/|z|)=|z|(\cos(\theta(z))+i\sin(\theta(z)))=|z|e^{i\theta(z)}$ where $|z|=\sqrt{a^2+b^2}$ is the modulus of $z$ and $\theta(z)$ is the angle of $z$.
From this it is clear how to decompose complex multiplication into a "stretch" and a "rotation", if $z_i=r_1e^{i\theta_1}$ and $z_2=r_2e^{i\theta_2}$, then $z_1z_2=(r_1e^{i\theta_1})(r_2e^{i\theta_2})=(r_1r_2)e^{i(\theta_1+\theta_2)}$. Using the notation above we have $z_iz_2=|z_1||z_2|e^{i(\theta(z_1)+\theta(z_2))}$.
Some of the best illustrations of this (and much more are from [3Brown1Blue](https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw)). Particularly, this video
{%youtube mvmuCPvRoWQ%}
## Justification of Euler's formula
A typical verification comes from calculus where you study the generalization of polynomials called Power Series. Many transcendental functions including $e^x$, $\sin(x)$, etc., have nice power series expansions. In particular
\begin{align*}
e^x &= 1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\cdots=\sum_{i=0}^\infty \frac{x^i}{i!}\\
\sin(x) &= x-\frac{x^3}{3!}+\frac{x^5}{5!}+\cdots = \sum_{i=0}^\infty (-1)^n\frac{x^{2n+1}}{(2n+1)!}\\
\cos(x) &= 1 - \frac{x^2}{2!} + \frac{x^4}{4!}\cdots =\sum_{i=0}^\infty (-1)^n\frac{x^{2n}}{(2n)!}
\end{align*}
Replacing $x$ with $it$ in the series for $e^x$ gives:
\begin{align*}
e^{it} &= 1 + (it) + \frac{(it)^2}{2!} + \frac{(it)^3}{3!} + \frac{(it)^4}{4!}+\frac{(it)^5}{5!} +\cdots\\
&= 1 + it + i^2\frac{t^2}{2!} + i^3\frac{t^3}{3!} + i^4\frac{t^4}{4!}+i^5\frac{t^5}{5!} +\cdots\\
&= 1 +it - \frac{t^2}{2!} - i\frac{t^3}{3!} + \frac{t^4}{4!} + i\frac{t^5}{5!} +\cdots\\
&= \left(1 - \frac{t^2}{2!} + \frac{t^4}{4!} + \cdots\right) + i\left(1 - \frac{t^3}{3!} + \frac{t^5}{5!}\cdots\right)\\
&= \cos(t)+i\sin(t)
\end{align*}
The series for $e^x$ you can derive almost from algebra. When learning exponential growth you learn the formula $Q_n(t) = Q_0(1 + r/n)^{(nt)} = Q_0\left((1 + r/n)^n\right)^t=Q_0b_n^t$ where a quantity $Q$ has a growth rate $r$ and is "compounded" $n$-times per year. The part $b_n=(1 + r/n)^n$ is the "base" of the exponential. If you let $n\to\infty$, then $b_n\to e^r$ where $e$ is Euler's constant. To derive the expansion of $e^r$ expand first $b_n$ using the standard binomial expansion $(x + y)^n=\sum_{i=0}^n {n \choose i} x^iy^{n-i}$:
\begin{align*}
b_n &= (1 + r/n)^n = \sum_{i=0}^n {n \choose i} (r/n)^i \\
&= \sum_{i=0}^n \frac{n!}{(n-i)!i!n^i}r^i\\
&= \sum_{i=0}^n \frac{r^i}{i!}\left(\frac{n}{n}\cdot\frac{n-1}{n}\cdots\frac{n-i+1}{n}\right)\\
&\to \sum_{i=0}^\infty \frac{r^i}{i!}\text{ as }n\to\infty
\end{align*}
The last bit is true since $\frac{n}{n}\cdot\frac{n-1}{n}\cdots\frac{n-i+1}{n}\to 1$ as $n\to\infty$ for any fixed $i$.
Below is a Differential Equations motivated explanation and the video above provides an algebraic justification. So here you have three justifications coming from three different directions.
{%youtube v0YEaeIClKY%}