natural logarithm of a complex number $\ln(a+bi)$ I am trying to find a formula for $\ln(a+bi)$, is my working correct?
$$a+bi=re^{i\theta},\,\,r=\sqrt{a^2+b^2},\,\,\theta=\frac{|b|}{b}\arctan\left(\frac ba\right)$$
and so:
$$\ln(a+bi)=\ln(re^{i\theta})=\frac{\ln(r^2)}{2}+i\theta$$
$$\therefore \ln(a+bi)=\frac{\ln(a^2+b^2)}{2}+i\frac{|b|}{b}\arctan\left(\frac ba\right)$$

I would also like to calculate: $$(a+bi)^{c+di}$$ and using a similar method I got:
$$(a+bi)^{c+di}=(a^2+b^2)^{c/2}\exp\left(-\frac{d|b|}{b}\arctan\left[\frac ba\right]\right)\left[\cos\left(\frac{c|b|}{b}\arctan\left[\frac ba\right]\right)+i\sin\left(\frac{c|b|}{b}\arctan\left[\frac ba\right]\right)\right]\left[\cos\left(\frac d2\ln(a^2+b^2)\right)+i\sin\left(\frac d2\ln(a^2+b^2)\right)\right]$$
could anyone confirm if this is correct? Thanks
 A: When you have $z^u$ it is convenient to have $z=a+ib=re^{i\theta}$ in polar form and keep $u=c+id$ in cartesian form.
The polar formula is $\begin{cases}r=|z|=\sqrt{a^2+b^2}\\\theta=\operatorname{atan2}(b,a)\end{cases}$
You got it ok, but for the angle it is more convenient to use atan2 which deals with the proper quadrants for the angle (this function is defined on most systems that have a math library):
https://fr.wikipedia.org/wiki/Atan2

We have $\ln(z)=\ln(r)+i\theta+2ik\pi\quad k\in\mathbb Z$, and it is important to keep this $k$ because the complex logarithm is multivalued (i.e. it has branches).
It ensures that formulas like $z^{u}\times z^v=z^{u+v}$ and $(z^u)^v=z^{uv}\ $  stays true at least for some value of $k$.
$\begin{align}z^u
&=\exp\bigg(u\ln(z)\bigg)\\
&=\exp\bigg((c+id)(\ln(r)+i\theta)+2ik\pi)\bigg)\\
&=\exp\bigg((c\ln(r)-d\theta)+i(c\theta+d\ln(r)+(-2kd\pi+2ikc\pi)\bigg)
\end{align}$
So we have the formula $\boxed{z^u\in\bigg\{z_{[k]}=z_{[0]}\ w^k\mid k\in\mathbb Z\bigg\}}$ where:
$$\begin{cases}z_{[0]}&=r^c\ e^{-d\theta}\ \bigg(\cos\big(c\theta+d\ln(r)\big)+i\sin\big(c\theta+d\ln(r)\big)\bigg)\\\\w&=e^{-2d\pi}\ \bigg(\cos(2c\pi)+i\sin(2c\pi)\bigg)\end{cases}$$

Comparatively to your formula (i.e. $z_{[0]}$), you still have a complex multiplication remaining, while I separated real part and imaginary part, but this is basically the same.
But I also have the multiplicative factor $w^k$ which correspond the the branches of the complex log.
The value $z_{[0]}$ obtained for $k=0$ is called the principal value.
Note: the principal value is not necessarily the "simplest" one, it happens that some other $z_{[k]}$ is simpler (i.e. real for instance) for a value of $k\neq 0$.
