Find the analytic function $f(z)$ I have to find $u(x,y)$ and $v(x,y)$ such that $f=u+iv$ is analytic. The textbook says that: $$2xyu+(y^2-x^2)v+2xy(x^2+y^2)^2=0$$
I've already tried to divide all the relation by $2xy$ (supposing $x$, $y$ non-zero) and then calculating the second order partial derivatives (to prove that $u$ or $v$ are harmonic). The computations got pretty complicated, so I was wondering, is there an easier way to find $u$ and $v$?
 A: Dividing the whole constraint equation by $(x^2+y^2)^2$ we can write it as:
$$\frac{-2xyu+(x^2-y^2)v}{(x^2+y^2)^2}=2xy.$$
Next notice that
$$ g(z)=\frac{f(z)}{z^2}=\frac{f(z)(x-iy)^2}{(x^2+y^2)^2}=\frac{(u+iv)(x^2-y^2-i2xy)}{(x^2+y^2)^2}.$$
If $g(z)=\phi+i\psi$, this last equation implies that $\psi$, the imaginary part of g(z), is:
$$\psi(x,y) = \mathrm{Im}g(z)=\frac{-2xyu+(x^2-y^2)v}{(x^2+y^2)^2}=2xy.$$
But
$$g'(z) = \frac{\partial\psi}{\partial y}+i\frac{\partial\psi}{\partial x}=2(z+iy)=2z\;\Rightarrow\;g(z)=z^2+C,$$
where $C$ is a constant that has to be real for the imaginary part of $g(z)$ to be $2xy$. From the definition of $g(z)$ we get the general solution for $f(z)$:
$$ \bbox[5px,border:2px solid red]
{f(z)=z^2(z^2+C)}\;\;\mathrm{with}\;\; C\;\mathrm{real}$$
A: All those $x^2+y^2$ suggest using a polar form ($x = r \cos\theta$ and $y = r\sin\theta$), which gives
$$
r^2 \sin(2\theta) u - r^2\cos(2\theta) v + r^6 \sin(2\theta) = 0
$$
or
$$
v = (u+r^4)\tan(2\theta).
$$
Now do Cauchy-Riemann in polar form:
\begin{eqnarray}
-\partial_\theta u &=& r\partial_rv = (r\partial_r u + 4r^4)\tan(2\theta)\\
r\partial_r u &=& \partial_\theta v = 2(u+r^4)\sec(2\theta)^2 + \partial_\theta u \tan(2\theta).
\end{eqnarray}
These can be reduced to two ordinary differential equations:
$$
r\partial_r u- 2u = 2r^4\cos(4\theta)
$$
and 
$$
\partial_\theta u +2\tan(2\theta)u=-2\tan(2\theta)r^4[2+\cos(4\theta)]
$$
The first solves to $u = r^4\cos(4\theta) + r^2 g(\theta)$ for some function $g$. Plugging this into the second gives $g'(\theta) = -2\tan(2\theta)g(\theta)$, which solves to $g(\theta) = C\cos(2\theta)$. Thus, we have $u = r^4\cos(4\theta) + Cr^2\cos(2\theta)$.
We could back substitute $r$ and $\theta$ for $x$ and $y$, but De Moivre's theorem makes it rather obvious this is just $\mathrm{Re}[z^4] + C\mathrm{Re}[z^2]$. So $u = \mathrm{Re}[z^2(z^2+C)]$, and thus
$$
f(z) = z^2(z^2+C).
$$
