Solution
= Solution
With the same <separation of variables> ansatz, $xX'Y-2yXY'=0$ gives
$$
\frac{xX'}X=\frac{2yY'}Y=\lambda.
$$
On $x,y>0$, integration yields $X=Ax^\lambda$ and $Y=By^{\lambda/2}$. The choice $\lambda=2$, $AB=1$ gives a polynomial that extends smoothly to all real $x,y$:
$$
\boxed{u(x,y)=x^2y}.
$$
It is nonconstant and real everywhere, and $xu_x-2yu_y=2x^2y-2x^2y=0$, including on the axes.