Question about non-separable ODE I have a problem with my assignment. The problem is as follows:
$(x^2+y^2e^\frac{x}{y})\frac{dx}{dy}=xy$
I don't think this is an exact ODE, and I have tried to solve it using integrating-factor method but I cannot find the result. I also tried to multiply each side by $y^{-2}$ and set u = $\frac{x}{y}$ but unable to solve it properly.
I would really appreciate if anybody could help me with this problem. It would be a very big help for me. Thank you very much.

We have $$(x^2+y^2e^\frac{x}{y})\frac{dx}{dy}=xy$$
Dividing through by $y^2$ as you suggested yields
$$\left(\frac{x^2}{y^2}+e^\frac{x}{y}\right)\frac{dx}{dy}=\frac{x}{y}$$
Again, we will use your suggestion: let $$u=\frac{x}{y}\iff x=uy$$
We can differentiate both sides implicitly with respect to $y$:
$$\frac{dx}{dy}=u+y\frac{du}{dy}$$
But we know that $$\frac{dy}{dx}=1\Big/\frac{dx}{dy}$$
Hence, substituting back into our original equation, we have
$$\begin{align}
\frac{u^2+e^u}{u+y\frac{du}{dy}}=u&\iff u+y\frac{du}{dy}=\frac{u^2+e^u}{u}=u+u^{-1}e^u\\
&\iff y\frac{du}{dy}=u^{-1}e^u=\frac{e^u}{u}\\
&\iff \frac{du}{dy}=\frac{e^u}{uy}\\
\end{align}$$
We are now in a position to separate the variables! We have:
$$\int ue^{-u}~du=\int \frac{1}{y}~dy$$
Integrating by parts on the left we eventually come to
$$-ue^{-u}-e^{-u}=\ln\lvert y\rvert +C=\ln\lvert y\rvert +\ln k$$
So finally
$$-\frac{x}{y}e^{-\frac{x}{y}}-e^{-\frac{x}{y}}=\ln \lvert ky\rvert$$
