= Solution
For $z\ne0$, write $z=re^{i\theta}$ with $r=\sqrt{x^2+y^2}>0$. The <complex logarithm> has values $\ln r+i(\theta+2\pi k)$, $k\in\mathbb Z$. Therefore
$$
\boxed{\operatorname{Re}(\log z)=\tfrac12\ln(x^2+y^2),\qquad \operatorname{Im}(\log z)=\theta+2\pi k.}
$$
For a specified single-valued branch, choose the corresponding continuous determination of the <argument>. In particular, the principal value uses $\operatorname{Arg}z\in(-\pi,\pi]$; it is not represented correctly by $\arctan(y/x)$ in every quadrant. The <complex logarithm> is undefined at zero.
Back to article page