Solve a differential equation : m*(dv/dt)=-m g - r v How to solve this differential equation:

$$ m*(dv/dt)=-m g- r v$$

where m, r and g are constants.

I am trying to rewrite the equation as dv=dt form, but I do not know how to do it. I get the solution from the mathematica as 

$$ (mg/r+v)*e^{(-rt/m)}-(mg/r)$$
$$m\left(\frac{dv}{dt}\right)=-mg-rv $$
$$\frac{m \cdot dv}{mg+rv}=-dt $$
Let $u = v + \frac{mg}{r}$, then $du = dv$,the equation turns to:
$$\frac{du}{u}=-\frac{r}{m}dt $$
$$ m*(dv/dt)=-m g- r v$$

$$ dv/dt = -  v * r/m - g $$

Variables are separated, you can now see how negative exponential exponent comes by integrating...