<s>[INST] Taylor series expansion for $e^{-x}$ could anyone show me the Taylor series expansion for $e^{-x}$.I was trying to find out how
$e^{-i\theta}$=$\cos\theta-i\sin\theta$.
More specifically could you show me how $e^{-i\theta}$=$\cos\theta-i\sin\theta$ is obtained from Taylor series.
 [/INST] $$e^x = 1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\frac{x^5}{5!}+\frac{x^6}{6!}+\frac{x^7}{7!}+\cdots$$
So, taking into account the fact that $i^0=1$, $i^1=i$, $i^2=-1$, $i^3=-i$, $i^4=1$, etc., we get
\begin{align}
e^{i\theta} &= 
1+(i\theta)+\frac{(i\theta)^2}{2!}+\frac{(i\theta)^3}{3!}+\frac{(i\theta)^4}{4!}+\frac{(i\theta)^5}{5!}+\frac{(i\theta)^6}{6!}+\frac{(i\theta)^7}{7!}+\cdots \\
 &= 1+i\theta+i^2\frac{\theta^2}{2!}+i^3\frac{\theta^3}{3!}+i^4\frac{\theta^4}{4!}+i^5\frac{\theta^5}{5!}+i^6\frac{\theta^6}{6!}+i^7\frac{\theta^7}{7!}+\cdots \\
 &= 1+i\theta-\frac{\theta^2}{2!}-i\frac{\theta^3}{3!}+\frac{\theta^4}{4!}+i\frac{\theta^5}{5!}-\frac{\theta^6}{6!}-i\frac{\theta^7}{7!}+\cdots \\
 &= \left(1-\frac{\theta^2}{2!}+\frac{\theta^4}{4!}-\frac{\theta^6}{6!} + \cdots\right) 
    +i\left(\theta-\frac{\theta^3}{3!}+\frac{\theta^5}{5!}-\frac{\theta^7}{7!} \cdots\right) \\
 &= \cos(\theta) + i\sin(\theta).
\end{align}
At this point, you can plug $-\theta$ in for $\theta$ to get to
$$e^{-i\theta} = \cos(\theta) - i\sin(\theta).$$
</s>