How to solve $y=(xy'+2y)^2$? What kind of differential equation is this thing and how to solve it?
$$y=(xy'+2y)^2$$
$$y=x^2y'^2+4xyy'+4y^2$$

Lets try a substitution $y = x^{\alpha}u$
this results in
$$
x^{\alpha}u = x^2\left(\alpha x^{\alpha-1}u + x^{\alpha}u'\right)^2 + 4x\left(\alpha x^{\alpha-1}u + x^{\alpha}u'\right)x^{\alpha}u + 4x^{2\alpha}u^2 
$$
dividing by $x^{\alpha}$ and collecting like terms we find
$$
u = \left(\alpha^2+4\alpha + 4\right)u^2 + (2\alpha + 4)x^{\alpha+1}uu' + x^{\alpha+2}u'^2
$$
if we set $\alpha = -2$
then we have
$$
\alpha^2+4\alpha + 4 = 4 -8 + 4 = 0\\
2\alpha + 4 = -4 + 4 = 0
$$
thus we have
$$
u = u'^2
$$
this results in
$$
u' = \pm\sqrt{u} \implies 2\sqrt{u} = \pm x + C
$$
integrating leads to
$$
2u^{1/2} = \pm x + C
$$
replacing the subs, we obtain
$$
y = x^{-2}\left(\pm x + C\right)^2 = \left(\frac{C}{x}\pm 1\right)^2
$$
lets try the solution (always do this)
$$
xy' + 2y = -2\left(\frac{C}{x}+1\right)\frac{C}{x^2}x + 2\left(\frac{C}{x}+ 1\right)^2\\
(xy'+2y)^2 = \left(\frac{C}{x}+1\right)^2\left[-\frac{2C}{x} + 2\left(\frac{C}{x}+ 1\right)\right]^2 = \left(\frac{C}{x}+1\right)^2 = y
$$
