Solution (source code)

= Solution

Compute the <complex derivative> along horizontal and vertical increments. Along the real direction, $f'=u_x+iv_x$; along the imaginary direction, $f'=(u_y+iv_y)/i=v_y-iu_y$. Equality gives the <Cauchy-Riemann equations>
$$
\boxed{u_x=v_y,\qquad u_y=-v_x.}
$$
The real and imaginary parts of a <holomorphic function> are smooth. Equality of their <mixed partial derivatives> then gives $u_{xx}+u_{yy}=v_{yx}-v_{xy}=0$ and $v_{xx}+v_{yy}=-u_{yx}+u_{xy}=0$, proving that both are <harmonic functions>.

For the first real part, $u_x=2x$ and $u_y=-2y$. The <Cauchy-Riemann equations> require $v_y=2x$ and $v_x=2y$, so its <harmonic conjugate> is $v=2xy+C$. Therefore
$$
\boxed{f(z)=z^2+iC,\qquad C\in\mathbb R.}
$$
For the second real part, $u=x/(x^2+y^2)$ is the real part of $1/z$. Its <harmonic conjugate> is $-y/(x^2+y^2)+C$, giving
$$
\boxed{f(z)=\frac1z+iC,\qquad C\in\mathbb R,\quad z\ne0.}
$$
These are the most general answers on a connected open <domain>: the difference of two candidates has zero real part, so the <Cauchy-Riemann equations> make its imaginary part constant. The second <function> cannot extend <holomorphically> through zero.