There's probably a more elegant way, but this does work:

This is essentially a Bernoulli equation, so if we go ahead and let we obtain a linear equation:

So

Now, depends only on x, so the integrating factor will be:

So is an exact differential equation.

Thus

or

Thus

-Dan