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)
$$
 A: 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.
A: \begin{align}
x\left(\frac{dx}{dy}\right)^2 + y\frac{dx}{dy} - x & = 0 \\
\frac{dx}{dy} & = \frac{1}{2x}\left(-y \pm \sqrt{y^2 + 4x^2}\right).
\end{align}
This is now a homogeneous first-order ODE, i.e., $\frac{dx}{dy} = F\left(\frac yx\right)$ where $F(u) = \frac 12\left(-u \pm \sqrt{u^2 + 4}\right)$. This can be solved by substituting $u = \frac yx$.
I'll carry out the detail below:
From the substitution $y = xu$, so
\begin{align}
  \frac{dx}{d(ux)} & = F(u) \\
  \frac{udx + xdu}{dx} & = \frac 1{F(u)} \\
  u + x\frac{du}{dx} & = \frac 1{F(u)} \\
  \frac{1}{\frac{1}{F(u)} - u}du & = \frac 1xdx \\
\therefore x & = c\exp\left(\int^{y/x} \frac{1}{\frac 1{F(u)} - u}du\right)
\end{align}
The indefinite integral actually has a closed form in terms of fundamental functions: positive choice, negative choice.
A: The command of Maple $$dsolve(x(y)*(D(x))(y)^2+y*(D(x))(y) = x(y)) $$ produces the two answers
$$x \left( y \right) =-y{\frac {1}{\sqrt {2\,{\it LambertW} \left( -1/2
\,{\frac {y{{\rm e}^{-1/2}}}{{\it \_C1}}} \right) +1}}} \left( 
 \left( 2\,{\it LambertW} \left( -1/2\,{\frac {y{{\rm e}^{-1/2}}}{{
\it \_C1}}} \right) +1 \right) ^{-1}-1 \right) ^{-1}
 $$ and $$x \left( y \right) =y{\frac {1}{\sqrt {2\,{\it LambertW} \left( -1/2\,
{\frac {y{{\rm e}^{-1/2}}}{{\it \_C1}}} \right) +1}}} \left(  \left( 2
\,{\it LambertW} \left( -1/2\,{\frac {y{{\rm e}^{-1/2}}}{{\it \_C1}}}
 \right) +1 \right) ^{-1}-1 \right) ^{-1}
 .$$
