# Conversion of $\cos(x)$ to $\frac{\exp(ix)+\exp(-ix)}{2}$

just out of fun I started playing around with the sums to derive $\cos(x)$ from $\frac{\exp(ix)+\exp(-ix)}{2}$

$\frac{\exp(ix)+\exp(-ix)}{2}=\frac{1}{2}\sum_{k=0}^\infty \frac{(ix)^k+(-ix)^k}{k!}$

$=\frac{1}{2}\sum_{k=0}^\infty \frac{i^k x^k+(-1)^k i^k x^k}{k!}$

$=\frac{i^k}{2} \sum_{k=0}^\infty \frac{ (1+(-1)^k) x^k}{k!}$

$=i^k \sum_{k=0}^\infty \frac{ x^2k}{k!}$

Now I'm stuck. I might have made a mistake but I can't spot it or do I miss something. Thanks for the help!

I should get: $\sum_{k=0}^\infty \frac{ (-1)^k x^2k}{(2k)!}$

EDIT: Forgot that the $2$ of $2x^k$ and $\frac{1}{2}$ cancel each other out (sorry for the missedit, I'm in a hurry right now

• $1+(-1)^k = 0$ when $k$ is odd so only the even terms in the sum survive. Also you cannot take $i^k$ outside the sum. – Winther Jan 25 '16 at 4:05

Note that $(1+(-1))^k=0$ when $k=2n+1$. while $(1+(-1))^k=2$ when $k=2n$.
Hence, $$\cos x=\frac{1}{2}\sum_{n=0}^{\infty} \frac{i^{2n} 2x^{2n}}{(2n)!}=\sum_{n=0}^{\infty}\frac{(-1)^nx^{2n}}{(2n)!}$$ This is done by substituting $k=2n$
You did a mistake, $i^k$ is inside the sum. The steps to show what you want are the following
$\displaystyle\frac{e^{ix}+e^{-ix}}{2}=\displaystyle\frac{1}{2}\displaystyle\sum_{k=0}^\infty\displaystyle\frac{(ix)^k+(-ix^k)}{k!}=\displaystyle\frac{1}{2}\displaystyle\sum_{k=0}^\infty\displaystyle\frac{(1+(-1)^k)\,(ix)^k}{k!}=\displaystyle\frac{1}{2}\displaystyle\sum_{k=0}^\infty\displaystyle\frac{2\,(ix)^{2k}}{(2k)!}=\displaystyle\sum_{k=0}^\infty\displaystyle\frac{(-1)^{k}x^{2k}}{(2k)!}$
• Typo: $(ix^k)$ in the third term should be $(ix)^k$. – Winther Jan 25 '16 at 4:11