
If

, then

and we have

Divide both sides by

, so that we get

This is the Bernoulli equation we wanted to find. So we can substitute

. This gives

, so the ODE is equivalent to

which is linear in

. Multiply both sides by

and rearrange terms a bit to get

and now the LHS contains a derivative of a product, namely

Now you can solve for

, then integrate that result to find

.