<s>[INST] Solve the differential equation: $(y^2-xy)dx+x^2dy=0$ $$(y^2-xy)dx+x^2dy=0$$
Need step by step answer.
Thank you in advance for your help
 [/INST] With some manipulation, we have
$$(y^2 - xy)dx + x^2dy = 0$$
$$(xy - y^2)dx = x^2dy$$
$$\begin{align}\frac{dy}{dx} &= \frac{xy - y^2}{x^2}\\
&= \frac{y}{x} - \left(\frac{y}{x}\right)^2\end{align}$$
Now, let $v = \frac{y}{x} \implies y = vx \implies \frac{dy}{dx} = v + x\frac{dv}{dx}$ (product rule). Then,
$$v + x\frac{dv}{dx} = v - v^2$$
$$x\frac{dv}{dx} = -v^2$$
$$\frac{1}{v^2}\frac{dv}{dx} = -\frac{1}{x}$$
Integrating both sides W.R.T $x$,
$$\int\frac{1}{v^2}\frac{dv}{dx}\cdot dx = \int\frac{-1}{x}dx$$
$$\int\frac{1}{v^2}dv = \int\frac{-1}{x}dx$$
$$-v^{-1} = -\ln{|x|} - C$$
where $C$ is the constant of integration. Then,
$$v^{-1} = \ln{|x|} + C$$
$$v = \frac{1}{\ln{|x|} + C}$$
But $v = \frac{y}{x}$, so
$$\frac{y}{x} = \frac{1}{\ln{|x|} + C}$$
$$y = \frac{x}{\ln{|x|} + C}$$
</s>