Why is the MacLaurin series proof for eulers formula $ e^{i\theta} = \cos(\theta) + i\sin(\theta) $ valid? The proof for this $$ e^{i\theta} = \cos(\theta) + i\sin(\theta) $$
using the MacLaurin series is all right for a high school level, but I dont understand why the series that has been derived for the reals should hold for complex numbers too. Could someone give a sufficient reason why it is correct to use complex numbers in the series expansion for $ e^{x} $ ? I'm not completely convinced why you should be allowed to write $ e ^{ix}= 1 + \frac{ix}{1!} + \frac{{(ix)}^2}{2!} ....$ .
 A: That's a good question. There are infinitely many possible ways to extend the definition of the exponential, cos or sin functions from the real numbers to the complex numbers. However, the uniqueness theorem for complex analytic functions tells you that if $f \colon \mathbb{R} \rightarrow \mathbb{R}$ is a function that can be extended to an analytic function $\tilde{f} \colon \mathbb{C} \rightarrow \mathbb{C}$ then the extension $\tilde{f}$ is unique. Thus, if we want to extend a function $f \colon \mathbb{R} \rightarrow \mathbb{R}$ in a way that the resulting extension is analytic, we have (at most) one way to do it. For the exponential, cos and sin functions, the extensions can be obtained by defining the functions using a power series expansion with the same coefficients as in the real case (only the argument and the result can be complex) so for example
$$ e^z := \sum_{n=0}^{\infty} \frac{z^n}{n!}. $$
Once those extensions are chosen, the proof of Euler's identity becomes a calculation using power series rules which are valid for complex power series just as they were valid for real power series.
A: They are not $\textit{derived}$ from real Maclaurin series, they are $\textit{generalized}$ so that for example for complex $z$, $e^z$ is $\textit{defined}$ by
$$e^z=1+z+\frac{z^2}{2!}+\cdots$$.
In this way, they are shown to have nice and useful properties (e.g., the Euler's formula you mentioned), and are consistent with the ancient geometric definitions of the functions.
For example, you don't need to worry whether
$$\sin\frac{\pi}{6}=\frac{1}{2}$$
because from our work in real calculus, we've already proved that
$$\frac{\pi}{6}-\frac{(\pi/6)^3}{3!}+\cdots=\frac{1}{2}.$$
