Raising Complex Numbers to Complex Powers So I was recently introduced to Maclaurin series, which leads to the inevitable proving of $e^{i\pi} = -1$, and from that the discovery of the equation $e^{ix} = i\sin(x) + \cos(x)$. I noted that using these properties, any real number $r$ can be raised to the complex power $a+bi$ by the equation: 
$$r^a(i\sin(b\ln(r))+\cos(b\ln(r)))$$
I was interested in raising complex numbers to complex powers, and couldn't find anything on the internet about this. Therefore I tried to generalize the equation to accept complex values of $r$, say $c+di$. 
From there I got to the equation: 
$$(c+di)^{(a+bi)}=c^a(i\sin(b\ln(\sqrt{c^2+d^2})) + \cos(b\ln(\sqrt{c^2+d^2})))(\cosh(b\arg(c+di)) - \sinh(b\arg(c+di)))$$
Which I got from using the identities: 
$$\ln(a+bi) = \ln(\sqrt{a^2+b^2})+i\arg(a+bi)$$
$$\sin(a+bi) = \sin(a)\cosh(b)+i\cos(a)\sinh(b)$$
$$\cos(a+bi) = \cos(a)\cosh(b) + i\sin(a)\sinh(b)$$
From here I ran, tediously, the value $(1+i)^{1+i}$ through my formula and through Google, and they matched, which was both surprising and great. 
This leads to two questions: 


*

*In general, does generalization of all sub-functions within a function generalize the entire function? Basically, is the approach I took to generalizing my first equation to my second equation an approach I can expect to work in general? 

*How does this, relate, if at all, to the Wolfram Alpha equation given at http://mathworld.wolfram.com/ComplexExponentiation.html?

 A: We can say that you took an expression valid for elements in a domain $D$ and tried to extend it to a larger domain $D'\supset D$ in a reasonable way. Will this always work? I doubt it. Think about the formula $\sum x^n = \frac{1}{1-x}$. It's valid for $x\in(0,1)$. Is it reasonable to extend it to $x\in(0,2)$?
However, it does frequently work out quite nicely. For example, take exponentiation again. The reason we can talk about exponentiation of complex numbers is that $f(x)=e^x$ has the alternate definition $f(x)=\sum\frac{x^n}{n!}$; this can immediately be extended to $\mathbb{C}$ because there is a notion of multiplication and norm for elements in $\mathbb{C}$, and the proof that this expression converges for $z\in \mathbb{C}$ is essentially the same as the real case. In fact, this formula can be generalized to matrices by defining $A^2 = A\cdot A$ and so on. In order for this to be useful, you'd probably want to define a norm for matrices and then show that the sum converges with respect to the norm; it turns out this can be done in a very easy and natural way. The function $e^A$ is called the matrix exponential and is quite useful in studying Lie groups. 
