How does $\cos x=\frac12(e^{ix}+e^{-ix})$? I have seen the following definition many times:
$$\cos x=\frac12(e^{ix}+e^{-ix})$$ However, it makes little sense to me as it appears far from obvious. Please help me understand this definition, either a derivation or explanation of how the values on the right equal $\cos x$.
 A: Euler's formula states that
$$e^{ix}=\cos x+i\sin x$$
By replacing $x$ with $-x$ and using the parities of the trigonometric functions (the sine is odd and the cosine even) we get
$$e^{-ix}=\cos x-i\sin x$$
Adding these two equations together we get
$$e^{ix}+e^{-ix}=2\cos x$$
and finally
$$\frac{e^{ix}+e^{-ix}}2=\cos x.$$
A: By Euler's formula,
$e^{ix}=\cos x+i \sin x$
$e^{-ix}=\cos x-i\sin x$
then,
$e^{ix}+e^{-ix}=2\cos x \Rightarrow \cos x=\frac{1}{2}(e^{ix}+e^{-ix})$.
A: Use $e^{ix}=\cos (x)+i\sin (x)$ and $-\sin (x)=\sin (-x) $
A: $e^{ix}=\cos x+i \sin x$, so $e^{-ix}=\cos(-x)+i\sin(-x)=\cos x-i\sin x$. Adding these two equations you get the required formula.
A: Taylor series of $\cos(x)$:
$$\begin{align}
\cos(x)&=\color{green}{1-\frac{x^2}{2!}+\frac{x4}{4!}-\cdots}
\end{align}$$

Taylor series of $e^x$:
$$e^x=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\cdots$$
Taylor series of $e^{ix}$:
$$\begin{align}
e^{ix}&=1+ix+\frac{(ix)^2}{2!}+\frac{(ix)^3}{3!}+\frac{(ix)^4}{4!}\cdots\\
&=\color{green}{1}+ix\color{green}{-\frac{x^2}{2!}}-\frac{ix^3}{3!}\color{green}{+\frac{x^4}{4!}}\cdots
\end{align}$$
Taylor series of $e^{-ix}$:
$$\begin{align}
e^{-ix}&=1-ix+\frac{(-ix)^2}{2!}+\frac{(-ix)^3}{3!}+\frac{(-ix)^4}{4!}\cdots\\
&=\color{green}{1}-ix\color{green}{-\frac{x^2}{2!}}+\frac{ix^3}{3!}\color{green}{+\frac{x^4}{4!}}\cdots
\end{align}$$
So adding the above two together, the imaginary parts cancel out each other and the real parts are twice those in $\cos(x)$.
A: Let $f(x)=\frac 12 (e^{ix}+e^{-ix})$. 
Then it is easy to show that $y=f(x)$ is a solution to 
$$y''+y=0 \,;\, y(0)=1, y'(0)=0 $$
But this equation has unique solution, and $\cos(x)$ is also a solution to this.
