I am trying to find the general solution to the following equation, but the integral at the end is very complicated and leads me to believe I may have made a mistake somewhere.
$$xy^2\frac {dy}{dx} = y^3 + xy^2 -x^2y - x^3 $$
Which, by the substitution $z = \frac {y}{x}$, can be rearranged into the equation
$$x\frac {dz}{dx} = 1 - \frac {1}{z} - \frac {1}{z^2} $$
This is a separable equation, which I separated into
$$ \int \frac {1}{1 - \frac {1}{z} - \frac {1}{z^2}}dz = \int \frac {1}{x}dx $$
The right-hand side is easy to solve, but the left-hand integral is giving me trouble. Assuming I did the steps leading up to it correctly, the integral has me stumped. Even WolframaAlpha is unhelpful. My first thought would be to try a partial fraction, but after a few attempts it does not seem to work.
Am I approaching this differential equation correctly? Is there an error I haven't caught?