Question about this ODE? $\frac{dy}{dx} = \frac{2x-y}{x+2y}$ Am I being dumb, or is this question actually hard?  I made the substitution $u=y/x \implies y = ux$, so then I get:
$x \cdot \dfrac{du}{dx} + u = \dfrac{2x-ux}{x+2ux} \implies x \cdot \dfrac{du}{dx} + u = \dfrac{2-u}{1+2u} $.  Then I simplified this to 
$x \cdot \dfrac{du}{dx} + \dfrac{2u^2+2u-2}{1+2u}=0$... Now I have no idea how to solve this, back to where I started.  Was my initial substitution wrong? It's the one my teacher recommended so I thought it would work out a little better...
Thanks!
 A: After setting $u=y/x$, the differential equation
$$
\frac{dy}{dx}=\frac{2x-y}{x+2y}
$$
becomes
$$
x\frac{du}{dx}+u=\frac{2-u}{1+2u},
$$
i.e.
$$
x\frac{du}{dx}=\frac{2-u}{1+2u}-u=\frac{2-2u-2u^2}{1+2u}=-\frac{2u^2+2u-2}{2u+1}.
$$
Assuming that
$$
2u^2+2u-2\ne 0 \, \mbox{ and }\, x\ne 0,
$$
we get
$$\tag{1}
\frac{2u+1}{2u^2+2u-2}du=-\frac1xdx.
$$
Integrating (1) we have:
$$
\int\frac{2u+1}{2u^2+2u-2}du=-\int \frac1xdx,
$$
i.e.
$$
\frac12\ln|2u^2+2u-2|=-\ln|x|+A,
$$
where $A$ is a real constant. Hence
$$
\ln\left|\left(\frac{y}{x}\right)^2+\frac{y}{x}-\frac12\right|=-\ln x^2+2A,
$$
i.e.
$$
y^2+xy-\frac{x^2}{2}=C
$$
with $C$ a real constant.
A: Hint: we have $$\frac{2-u}{1+2u}-u=\frac{2-u-u(1+2u)}{1+2u}=\frac{2-2u-2u^2}{1+2u}$$
A: this differential equation is exact. we can rewrite it as $$0=M \,dx + N\, dy = (y-2x)\, dx+(x+2y)\, dy.$$ then we see that $$M_y = 1 = N_x.  $$there is an $F$ such that $F_x = y-2x, F_y = x+2y$ integrating the first with we get $$F = xy - x^2 +f(y)\to F_y = x + g' = x + 2y\to g = y^2 $$
 so the solutions is $$xy - x^2 + y^2 = constant $$
