TITLE: Where does complex exponential come from?
QUESTION [5 upvotes]: The complex exponential function is defined as : $$e^{ix} = \cos x + i\sin x$$ It shares most of its properties with real exponential and it allows a lot of trigonometric calculations such as de Moivre's formula : $$(\cos x+i\sin x)^n = \cos{nx}+i\sin{nx}$$
But where does this definition come from and why does it work ?

REPLY [5 votes]: People have given you some good algebraic answers that show that the equations work out; here's a hand-wavy justification that may make you more comfortable with the idea in general.
The derivative of $f(x)$ is how $f(x)$ changes as you change $x$ a little.
What's the derivative of $f(x) = e^{ix}$? It's $ie^{ix}$, which is $i$ times $f(x)$ itself. So the way in which $f$ changes as you wiggle $x$ by $dx$ is $i \cdot f \cdot dx$.
So what does it mean to multiply something by $i$? It means rotating it 90 degrees counterclockwise in the complex plane. (Try this yourself with some simple complex numbers if you didn't notice this already.)
So when $x=0$, and $f(x)=1$, $f'(0) = i \cdot f(0) = i \cdot 1 = i$; $f(0)$ is changing to the north when its value is to the east. The same argument works for other values of $x$; $f(x)$ will be changing at a 90 degree clockwise angle from the current value of $f(x)$.
The equation of motion that satisfies this rule (velocity is always perpendicular to the direction from the origin to the current point) is a circle. $f(x) = e^{ix}$ moves in a counterclockwise circle around the complex plane, and that's exactly what $\cos x + i \sin x$ does too.