I'm having a problem with finding my mistake when trying to find the derivative of the momentum when mass is being ejected in a constant rate.
The problem is this - a body in space is burning fuel while the created gas are pushing it forward. The initial mass of the system is $M$ while fuel is being burnt at a rate of $K$ kg/s. gas is being ejected at speed of $-u$ relative to the body.
So at time $t$, the momentum of the body is $P_1 = M(t)v(t)$, the speed of the gas is $v(t) - u$, and therefore it's momentum is $P_2 = kt(v(t) - u)$, summing it all together:
$$ P = m(t) v(t) + k t (v(t)-u)$$
taking the derivative will give
$$dp = dm(t) v(t) + dv(t) m(t) + d(kt)(v(t)-u) + d(v(t)-u) kt$$
this results in :
\begin{align} dp &= -k v(t) + a(t) m(t) + k v(t) - ku + a(t) kt \\ &= a(t)(m(t)-kt) -ku \end{align}
which is obviously not the solution shown in here, $$ dp=m\,dv-(u-v)dm $$
What have I done wrong?