<s>[INST] Finding a holomorphic function with a prescribed real part. I am to find a holomorphic function on $\mathbb{C}\setminus\{0\}$ with $u(x,y)=\dfrac{x+y}{x^2+y^2}$ and $f(1)=1$. Preceding this, I had to show we could write $f'(z) = \frac{\partial u}{\partial x} -i\frac{\partial u}{\partial y}$, which is clearly supposed to be a hint for this part.
The issue is I don't see how it helps at all. Other than taking $u(x,y)$ as I know it and doing lots of differentiation/integration along with the Cauchy Riemann equations (which would be a lot of work..) the only idea I had that used this as a hint was to compute $f'(z)$ with that formula, and see if it would arrange into an expression in $z$ which was readily integrable. I got to $f'(z(x,y)) = \dfrac{(y+ix)^2+i(y+ix)^2}{(x^2+y^2)^2}$, but given this all assumes $x$ is the real part, etc., you can't just swap $x$ and $y$ and there's no way to get to $x+iy$ nicely! so that approach seemed to fail..
This is a question from a past exam paper; one of the short 'more routine' questions in the first section. Typically these aren't so bad, but with this particular question is being more difficult to deal with. 
 [/INST] Since $u(x,y) = \dfrac{x+y}{x^2+y^2}$,
$$\frac{\partial u}{\partial x} = \frac{1}{x^2+y^2}-\frac{2x(x+y)}{(x^2+y^2)^2} = \frac{x^2+y^2-2x^2-2xy}{(x^2+y^2)^2} = \frac{-x^2-2xy+y^2}{(x^2+y^2)^2}.$$
Likewise, by symmetry,
$$\frac{\partial u}{\partial y} = \frac{-y^2-2xy+x^2}{(x^2+y^2)^2}.$$
Putting these together shows that
$$\begin{align} f'(z) &= \frac{-x^2-2xy+y^2-i(-y^2-2xy+x^2)}{(x^2+y^2)^2} \\ &= \frac{-x^2-2xy+y^2+iy^2+2ixy-ix^2}{(x^2+y^2)^2}.\end{align}$$
The numerator can be rewritten a bit:
$$\begin{align}(-x^2+2ixy+y^2)+i(-x^2+2ixy+y^2) &= (1+i)(-x^2+2ixy+y^2) \\ &= -(1+i)(x^2-2ixy-y^2) \\ &= -(1+i)(x-iy)^2.\end{align}$$
Thus we have that
$$f'(z) = \frac{-(1+i)(x-iy)^2}{((x+iy)(x-iy))^2} = -\frac{1+i}{(x+iy)^2} = -\frac{1+i}{z^2}.$$
From here, it is a simple application of integration to get the final answer.
</s>