The original function is $$ (y^2+yx)dx+x^2dy = 0 $$
I've arrived at $$\frac{dx}{x} + \frac{du}{u(u+2)} = 0 $$
The text book carries on to factor as such, but I don't understand how they justify it: $$\frac{dx}{x}+\frac{1}{2}\left(\frac{1}{u}-\frac{1}{u+2}\right)du=0 $$
Any clues how they got that $1/2$? Why'd they stick a minus sign between two fractions that were previously multiplied by each other?
It's a decomposition by partial fractions. Note that
$$\frac{1}{u} - \frac{1}{u + 2} = \frac{(u + 2) - u}{u(u + 2)} = 2 \frac{1}{u(u + 2)}$$