How to solve that ode I'm trying solve the following differential equation:
$$
x\left(\frac{dx}{dy}\right)^2+y\frac{dx}{dy}=x
$$
I tried to rewrite it this way:
$$
y(x)=x\frac{dy}{dx}+f\left(\frac{dy}{dx}\right)
$$

Let $v = \frac{dx}{dy}$ then we face $xv^2+yv=x$ this gives $v^2+\frac{y}{x}v-1=0$ solve this quadratic equation for $v$ to obtain:
$$ v = \frac{-y/x \pm \sqrt{y^2/x^2+4}}{2} $$
Hence,
$$ \frac{dx}{dy} = \frac{-y/x \pm \sqrt{y^2/x^2+4}}{2}  $$
Suppose $z = y/x$ then $xz=y$ and $z\frac{dx}{dy}+x\frac{dz}{dy}=1$,
$$ \frac{y}{z^2}\frac{dz}{dy} = \frac{-z \pm \sqrt{z^2+4}}{2}  $$
Thus,
$$ \frac{-2dz}{z^3\pm z^2\sqrt{z^2+4}} = \frac{dy}{y} $$
Perhaps this helps.
