Please take a look at the attached image!
Thank you!
First bring all the terms with $\displaystyle \frac{dy}{dx}$ to one side, and everything else to the other, then factor out $\displaystyle \frac{dy}{dx}$ and divide through.
$\displaystyle -3xy^2\frac{dy}{dx}+\frac{dy}{dx}-3xy\frac{dy}{dx}-3x^2\frac{dy}{dx}=-5x+4x^2+3xy^2-1$
$\displaystyle \frac{dy}{dx}(-3xy^2-3x^2-3xy+1)=3xy^2+4x^2-5x-1$
$\displaystyle \frac{dy}{dx}=\frac{(3xy^2+4x^2-5x-1)}{(-3xy^2-3x^2-3xy+1)}$