Complex numbers as exponents Is there any formula to calculate $2^i$ for example? What about $x^z$? I was surfing through different pages and I couldn't seem to find a formula like de Moivre's with $z^x$.
 A: By definition, for non-rational exponents,
$$
x^z=e^{z\log(x)}
$$
This definition is fine as far as it goes, but the limitation is on the values of $\log(x)$ for $x\in\mathbb{C}$.  Since $e^{2\pi i}=1$, logarithms, as inverses of the exponential function, are unique up to an integer multiple of $2\pi i$.
Usually, when the base is a positive real number, we use the real value of the logarithm, so
$$
2^i=e^{i\log(2)}=\cos(\log(2))+i\sin(\log(2))
$$
However, if $2$ is viewed as a complex number, we might equally well say
$$
2^i=e^{i\log(2)-2k\pi}=e^{-2k\pi}\cos(\log(2))+ie^{-2k\pi}\sin(\log(2))
$$
for any $k\in\mathbb{Z}$.
A: As with the reals, you want to define $a^b$ as $e^{b\log a}$. The logarithm has issues in the complex plane (you cannot make it continuous) but these difficulties are not seen by the exponential. 
The key is the identity $$ e^{it}=\cos t+i\,\sin t.$$ This allows you to define the exponential of any $z=s+it$ via
$$
e^z=e^{s+it}=e^se^{it}=e^s\cos t+i\,e^s\sin t.
$$
In your concrete example, you have 
$$
2^i=e^{i\,\log 2}=\cos(\log 2)+i\,\sin(\log 2).
$$
