Say we have a rocket of mass $m$ and velocity $v$. It’s accelerating, so let’s say it ejects a mass $\delta m$ in time $\delta t$ with a relative velocity $-w$, to gain some velocity $\delta v$.
Then, the change in momentum of the rocket must be
$$\begin{aligned} \delta p&=p_1-p_0\\ &=((m-\delta m)(v+\delta v)+(v-w)\delta m)-mv\\ &=m\delta v-w\delta m \end{aligned} $$
Dividing by time,
$$\frac{dp}{dt}=F=ma-w\dot{m}$$
Where $F$ is the external force on the rocket system. Now, we have two possible cases: the rocket is in free space, or it is in a gravitational field.
Without gravity, the total change in momentum must be zero:
$$ma+w\dot{m}=0$$
Rearranging and integrating over time gives:
$$\int_{v_0}^{v(t)}{dv}=-w\int_{m_0}^{m(t)}{\frac{dm}{m}}$$
Giving
$$v(t)=v_0-w\ln{\frac{m(t)}{m_0}}$$
If you have a rocket floating in free space, with fuel $m_f$ and non-fuel mass $M$, what is the maximum achievable velocity?
$$v_\text{max}=w\ln{\frac{M+m_f}{M}}$$
Insert graph of $\ln{\frac{1}{1-x}}$
With gravity, the overall force is just $-mg$, giving
$$-mg=ma-w\dot m$$
This time, we need to assume that mass is ejected at a constant rate: $m(t)=m_0-\alpha t$. This gives
$$\Delta v=-g(t_f-t_i)-w\ln{\frac{m_0-\alpha t_f}{m_0-\alpha t_i}}$$
For example, if the rocket blasts off with an initial fuel fraction of $50\%$ (half its mass is fuel), then the velocity at burnout time $T$ is
$$v=-gT+w\ln{2}$$
And to find the height at burnout, we integrate the velocity:
$$\int_0^h{dx}=-g\int_0^T{tdt}-w\int_0^T{\ln{\left(1-\frac{\alpha t}{m_0}\right)}dt}$$
Giving
$$h=-\frac{1}{2}gT^2+wT(1-\ln{2})$$