How can I find an ODE equation from $dy/dx$ What is the ODE satisfied by $y=y(x)$ 
given that $$\frac{dy}{dx} = \frac{-x-2y}{y-2x}$$
I understand that I need to get it in some form of $\int \cdots \;dy = \int \cdots \; dx$, but am not sure how to go about it.
 A: rewrite your equation in the form $$\frac{dy}{dx}=\frac{-1-2\frac{y}{x}}{\frac{y}{x}-2}$$ and set $$y=xu$$
A: We have, $$\frac{dy}{dx} = \frac{-x-2y}{y-2x}$$
Let $y=ux\implies \frac{dy}{dx}=x\frac{du}{dx}+u$ $$u+x\frac{du}{dx}=\frac{-x-2ux}{ux-2x}$$
$$u+x\frac{du}{dx}=\frac{2u+1}{2-u}$$ $$x\frac{du}{dx}=\frac{2u+1}{2-u}-u$$ $$x\frac{du}{dx}=\frac{1+u^2}{2-u}$$ $$\frac{(2-u)du}{1+u^2}=\frac{dx}{x}$$ Integrating both the sides, we get $$\int \frac{(2-u)du}{1+u^2}=\int \frac{dx}{x}$$  $$2\tan^{-1}(u)-\frac{1}{2}\ln(1+u^2)=\ln(x)+c$$ Substituting $u=\frac{y}{x}$, we get $$2\tan^{-1}\left(\frac{y}{x}\right)-\frac{1}{2}\ln\left(\frac{x^2+y^2}{x^2}\right)=\ln(x)+c$$ $$2\tan^{-1}\left(\frac{y}{x}\right)-\frac{1}{2}\ln\left(x^2+y^2\right)+\frac{1}{2}\ln (x^2)=\ln(x)+c$$
$$2\tan^{-1}\left(\frac{y}{x}\right)-\frac{1}{2}\ln\left(x^2+y^2\right)=c$$
A: \begin{align}
\frac{dy}{dx} = \frac{ -x-2y }{ y-2x } \\ 
\frac{ dy }{ dx } =\frac{ -1-2\frac{ y }{ x }  }{ \frac{ y }{ x } -2 } \\ \frac{ y }{ x } = t \to \quad y=xt \quad \Rightarrow \quad dy=t+x \frac{ dt }{ dx } \\ 
t+x\frac{ dt }{ dx } =\frac{ -1-2t }{ t-2 } \\ 
x\frac{ dt }{ dx } =\frac{ -1-2t }{ t-2 } -t=\frac{ -1-{ t }^{ 2 } }{ t-2 } \\
\int { \frac{ 2-t }{ t^{ 2 }+1 } dt } =\int { \frac{ dx }{ x }  } \\ 
\int { \left( \frac{ 2 }{ { t }^{ 2 }+1 } -\frac{ t }{ { t }^{ 2 }+1 }  \right) dt= } \int { \frac { dx }{ x }  } \\ 2\int { \frac { 1 }{ { t }^{ 2 }+1 } dt-\frac { 1 }{ 2 } \int { \frac { d\left( { t }^{ 2 }+1 \right)  }{ { t }^{ 2 }+1 }  } =\int { \frac { dx }{ x }  }  } \\ 2\arctan { \left( t \right) -\frac { 1 }{ 2 }  } \ln { \left( 1+{ t }^{ 2 } \right) =\ln { \left| x \right| +C }  } \\ \arctan { \left( t \right) =\frac { 1 }{ 2 } \ln { \left| x\sqrt { 1+{ t }^{ 2 } }  \right| +C }  } \\ \arctan { \left( \frac { y }{ x }  \right) =\frac { 1 }{ 2 } \ln { \left| x\sqrt { 1+{ \left( \frac { y }{ x }  \right)  }^{ 2 } }  \right| +C }  } 
\end{align}
A: If you have this equation:
$$\frac{dy}{dx} = \frac{-x-2y}{y-2x}$$
you may do:
$$ ( y - 2 \cdot x) \cdot dy = - ( x + 2 \cdot y ) dx $$
After that
$$ y dy + x dx = -2 y^2 \cdot \frac{ydx-xdy}{y^2}$$
Small tricks:
$$y~dy = \frac{y^2}{2} + C $$
$$ d\bigg(\frac{x}{y}\bigg) = \frac{ydx-xdy}{y^2} $$
With this small tips you can solve this problem with elementary integrals theory.
