Equation in Complex plane I know that $\cos(\theta)=\frac{\exp(i\theta)+\exp(-i\theta)}{2}$ in which $\theta=arg(z)$ for some complex number $z$. Can I assume $\theta$ in above folmula as a comlex number? I mean, $$\cos(z)=\frac{\exp(iz)+\exp(-iz)}{2}$$ You know, I want to do $\cos(z)=2i$. Someone told me that I can, but $\theta$ is an angle and $z$ itself is a number and I can not understand this point!
Thanks
 A: Yes, you can. In fact, the complex cosine function is defined as $$\cos(z) = \frac{e^{iz}+e^{-iz}}{2}$$ so there is no problem with just taking $z=\theta.$ After all, theta is just a variable, that does not have to be restricted.
Applying the formula to your case, we have $e^{iz}+e^{-iz} = 4i \stackrel{u=e^{iz}}{\implies} u^2 - 4iu + 1 = 0\implies u = 2i\pm i\sqrt{5}\implies z = \log(2i\pm\sqrt{5}i)/i = -i\log(2i\pm\sqrt{5}i)$
A: Yes, the formula
$$
\cos(z)=\frac{\exp(iz)+\exp(-iz)}{2}
$$
holds for all complex numbers $z$, including the real values $z = \theta$ that you first saw.  This follows from a uniqueness theorem for analytic continuations.  The so-called identity theorem states that if two holomorphic functions $f$ and $g$ agree on a set containing an accumulation point, then they must be identically equal.
In your case, we take $f$ to be the analytic continuation of (the real-valued function) $\cos(\theta)$, and $g(z) = \frac{\exp(iz)+\exp(-iz)}{2}$.  Your statement that
$$
\cos(\theta)=\frac{\exp(i\theta)+\exp(-i\theta)}{2}
$$
for $\theta \in \mathbb{R}$ means the functions $f$ and $g$ agree on $\mathbb{R}$.  Since $\mathbb{R}$ contains an accumulation point (indeed, every point of $\mathbb{R}$ is an accumulation point), then the theorem implies that $f$ and $g$ must be identically equal.  Since the functions are defined on all of $\mathbb{C}$, this means that
$$
\cos(z)=\frac{\exp(iz)+\exp(-iz)}{2}
$$
for all $z \in \mathbb{C}$.
