Euler famously used the Taylor's Series of $\exp$:
$\exp (x)=\sum_{n=0}^\infty \frac{x^n}{n!}$
and made the substitution $x=i\theta$ to find
$\exp(i\theta) = \cos (\theta)+i\sin (\theta)$
How do we know that Taylor's series even hold for complex numbers? How can we justify the substitution of a complex number into the series?