Q:

Integration of Tsiolkovsky rocket equation with gravity

I have been looking for some time now at how to integrate correctly Tsiolkovsky's rocket equation with gravity applied. Though some articles and forums (including stack Exchange) provide a close solution to this problem, none seem to integrate the specific version of the equation that I am looking for. 
I was able to integrate the gravity and dv pretty easily from t0 to tf (or from the start of the experiment, till its end.) It's the logarithm though that I cannot figure out, should I integrate it from M0 to Mf ? (or from the initial mass at t0 till the final mass at tf.) And if so, how would I do that?
Overall, I am looking for a numerical expression for dx or the velocity's derivative from this equation.
Tsiolkovsky's rocket equation:
    $\frac{dv}{dt} = u*ln(\frac{m0}{mf}) - g*t$ 
where u is the exhaust velocity, m0 and mf are the initial and final masses respectivly, g is standard gravity and t is time. 
For my usage, the initial and final masses can be assumed to be constants, because I calculate them beforehand using a different expression and they do not change. 

A:

The Tsiolkovsky's rocket equation
$$\frac{dv}{dt} = av - gt$$
with
$$a=\ln\left(\frac{m0}{mf}\right)$$
Let $y=ve^{-at}$, take the derivative of $y$,
$$\frac{dy}{dt} = -gte^{-at}$$
Then, integrate-by-parts,
$$y=-g\int te^{-at} = \frac{g}{a}te^{-at}+\frac{g}{a^2}e^{-at}+C$$
In terms of original variable $v$,
$$v(t)=\frac{g}{a}t+\frac{g}{a^2}+Ce^{at}$$

