Solution (source code)

= Solution

Let $dm$ be the gas mass ejected in a short interval, and let $dD$ be the stationary dust mass acquired. The rocket mass change is $dM=dD-dm$. Before the interval the <momentum> of the rocket and this dust is $Mv$, because the incoming dust is at rest. Afterwards it is
$$
(M+dM)(v+dv)+(v-u)dm
$$
to first order; changing the gas ejection speed by $dv$ affects only second-order terms. <Momentum conservation>, with no external force, therefore gives
$$
M\,dv+v\,dM+(v-u)\,dm=0.
$$
Dividing by the time interval produces the <rocket equation with stationary mass accretion>:
$$
\boxed{M\dot v+v\dot M+(v-u)\dot m=0.}
$$
The incoming material's zero initial <momentum> is essential: accelerating it to the rocket's speed consumes part of the thrust.