Take the series expansion of $e^z$, which is defined also for complex $z$
(and actually it is used to define the principal value of $e^z$, which is the usual acception
for writing $e^z$).
Split it into the even and odd components.
$$
e^{\,z} = \sum\limits_{0\, \leqslant \,k} {\frac{{z^{\,k} }}
{{k!}}} = \sum\limits_{0\, \leqslant \,k} {\left( {\frac{{z^{\,\left( {2k} \right)} }}
{{\left( {2k} \right)!}} + \frac{{z^{\,\left( {2k + 1} \right)} }}
{{\left( {2k + 1} \right)!}}} \right)} = \sum\limits_{0\, \leqslant \,k} {\frac{{z^{\,\left( {2k} \right)} }}
{{\left( {2k} \right)!}}} + \sum\limits_{0\, \leqslant \,k} {\frac{{z^{\,\left( {2k + 1} \right)} }}
{{\left( {2k + 1} \right)!}}}
$$
Then putting $iy$ in place of $z$, you will notice that
$$
\begin{gathered}
e^{\,i\,y} = \sum\limits_{0\, \leqslant \,k} {\frac{{i^{\,\left( {2k} \right)} y^{\,\left( {2k} \right)} }}
{{\left( {2k} \right)!}}} + \sum\limits_{0\, \leqslant \,k} {\frac{{i^{\,\left( {2k + 1} \right)} y^{\,\left( {2k + 1} \right)} }}
{{\left( {2k + 1} \right)!}}} = \hfill \\
= \sum\limits_{0\, \leqslant \,k} {\frac{{\left( { - 1} \right)^{\,k} y^{\,\left( {2k} \right)} }}
{{\left( {2k} \right)!}}} + \sum\limits_{0\, \leqslant \,k} {\frac{{\left( { - 1} \right)^{\,k} i\,y^{\,\left( {2k + 1} \right)} }}
{{\left( {2k + 1} \right)!}}} = \hfill \\
= \sum\limits_{0\, \leqslant \,k} {\frac{{\left( { - 1} \right)^{\,k} y^{\,\left( {2k} \right)} }}
{{\left( {2k} \right)!}}} + i\sum\limits_{0\, \leqslant \,k} {\frac{{\left( { - 1} \right)^{\,k} \,y^{\,\left( {2k + 1} \right)} }}
{{\left( {2k + 1} \right)!}}} = \hfill \\
= \cos y + i\sin y \hfill \\
\end{gathered}
$$
We can actually develop a series that converges for all positive $x$.
Begin by rendering the Maclaurin series for $\ln(1+y)$ and $\ln(1-y)$:
$\ln(1+y)=\sum_{n=1}^\infty \dfrac{(-1)^{n-1}y^n}{n}$
$\ln(1-y)=\sum_{n=1}^\infty \dfrac{(-1)y^n}{n}$
Now subtract the second equation from the first, recognizing that (1) the difference between logarithms on the left side is now a logarithm of a quotient, (2) only the odd $n$ terms on the right will give a nonzero difference. Thereby
$\ln(\dfrac{1+y}{1-y})=2\sum_{m=1}^\infty {\dfrac{y^{2m-1}}{2m-1}}$
Now define $x=(1+y)/(1-y)$, which is solved for $y$ to give $y=(x-1)/(x+1)$. Note that this latter equation implies $|y|<1$ for all positive $x$ -- so, convergence of the series follows! The final, convergent series takes the form
$\ln(x)=2\sum_{m=1}^\infty {\dfrac{(\frac{x-1}{x+1})^{2m-1}}{2m-1}}$
Best Answer
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.