TITLE: Show that $\displaystyle u=\frac{1}{2}\log(x^2+y^2)$ is harmonic and find its harmonic conjugate function
QUESTION [8 upvotes]: Show that $\displaystyle u=\frac{1}{2}\log(x^2+y^2)$ is harmonic and find its harmonic conjugate function.
I did the first part to show that $\displaystyle \frac{\partial^2 u}{\partial x^2}+\frac{\partial^2 u}{\partial y^2}=0$
Now, to find v: 
$\displaystyle\frac{\partial u}{\partial x}=\frac{x}{x^2+y^2}=\frac{\partial v}{\partial y}$
I get $\displaystyle v=\tan^{-1}(\frac{y}{x})$
$\displaystyle\frac{\partial u}{\partial y}=\frac{y}{x^2+y^2}=-\frac{\partial v}{\partial x}$
Here I get $\displaystyle v=-\tan^{-1}(\frac{x}{y})$
What did I do wrong here ?

REPLY [8 votes]: You've already got a complete answer (+1), but I'd like to add the complex analysis way to do it. If you set $z = x^2 + y^2$, then notice that
$$f(z) = \ln\Big(\sqrt{x^2 + y^2}\Big) = \ln |z|$$
Now this is exactly the real part of (a branch of) the logarithm, for if we write $z = re^{i\theta}$ and ignore some technicalities about branches,
$$\ln(z) = \ln(re^{i\theta}) = \ln r + \ln e^{i\theta} = \ln |z| + i \theta = \ln |z| + i \operatorname{Arg}(z)$$
where $\operatorname{Arg}(z)$ is the argument. Thus we've identified $\ln |z|$ as the real part of a complex analytic function, and so its harmonic conjugate is the imaginary part - in particular, $\operatorname{Arg}(z)$. Geometrically, one can check that the argument $\theta$ of a number satisfies
$$\tan \theta = \frac{y}{x}$$
so this is consistent with the answer you've already got.