Find the immaginary part of $f(z)$ Determine the analytic function $f(z)=u(x,y)+iv(x,y)$ knowing that:
$$u(x,y)=Ref=\phi\left(\frac{y}{x}\right)$$ where $\phi\in C^2$.
Firstly, I've tried to prove that $u$ is harmonic.
$$\frac{\partial^2 u}{\partial x^2}=\phi''\left(\frac{y}{x}\right)\frac{y^2}{x^4}+\phi'\left(\frac{y}{x}\right)\frac{2y}{x^3}$$
$$\frac{\partial^2 u}{\partial y^2}=\phi''\left(\frac{y}{x}\right)\frac{1}{x^2}$$
The sum must be $0$, but then? Is there another way to find it?
 A: Using Cauchy-Riemann, I find
\begin{align}
\frac{\partial u }{\partial x} &= \frac{\partial}{\partial x} \phi\left(\frac{y}{x}\right) \\
&= \frac{-y}{x}\phi' \\
&= \frac{\partial v}{\partial y}\\
\frac{\partial u }{\partial y } &= \frac{\partial}{\partial y} \phi\left(\frac{y}{x}\right) \\
&= \frac{1}{x}\phi' \\
&= -\frac{\partial v}{\partial x}
\end{align}
Can you integrate up, remembering constants?
A: You're doing well. You have
$$ (\frac{y^2}{x^4}+\frac{1}{x^2})\phi'' \left(\frac{y}{x}\right)  + \frac{2y}{x^3} \phi'\left(\frac{y}{x}\right)  = 0$$
that is for $t=y/x$
$$ \frac{1}{x^2} \Big((t^2+1) \phi'' \left(t\right)  + 2t \phi'\left(t\right) \Big)= 0$$
$$ (t^2+1) \phi'' \left(t\right)  + 2t \phi'\left(t\right) = 0 $$
Solving this equation will give you $\phi(t)$.
Another, equivalent way is to use radial coordinates. We have
$$ \Delta u  = \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} = \frac{1}{r}\frac{\partial}{\partial r} \left( r \frac{\partial u}{\partial r} \right)+ \frac{1}{r^2} \frac{\partial^2 u}{\partial \varphi^2}$$
Since $u(x,y) = \phi(\tan \varphi)$ then $\partial u/\partial r = 0$ and you get easily
$$ \frac{\partial^2 u}{\partial \varphi^2} = 0$$
$$ u = a\varphi + b = a \arctan \frac{y}{x} + b$$
(at least in the first quadrant).
