Problem with the mass of exhaust when deriving relativistic rocket equation

In my special relativity book, there is a derivation of the velocity of a rocket. Let the rocket have rest mass $$m$$ (which decreases over time) and velocity $$v$$ in an inertial frame, and let the exhaust have speed $$u$$ in the accelerating frame of the rocket.

My book states that $$\frac{d(mv\gamma)}{dv}=\left(\frac{v-u}{1-\frac{vu}{c^2}}\right)\frac{d(m\gamma)}{dv}$$ without any explanation, so I have to prove this myself. The left-hand side is easy. It is the change of the rocket's momentum. I can also understand that$$\left(\frac{v-u}{1-\frac{vu}{c^2}}\right)$$ is the speed of exhaust in inertial frame. The problem is the last one: $$\frac{d(m\gamma)}{dv}$$. It is the change in relativistic mass of the rocket. The basic idea of this equation is $$\text{change in the momentum of rocket}=\text{change in the momentum of the exhausts}$$ so the RHS should be the momentum of the exhaust. However, I don't understand why $$\frac{d(m\gamma)}{dv}$$ is the mass of exhaust ejected; the rocket have lost $$\frac{d(m\gamma)}{dv}$$ kilograms of mass, but it doesn't mean that's the mass of the exhaust ejected, because exhaust have different velocity from the rocket, and mass depends on velocity. So I feel that it is not valid to assume $$\text{mass loss of the rocket}=\text{mass of propellant ejected}.$$

So, is the equation in my book correct? Have I understood anything wrong?

Let $$w=\frac{v-u}{1-\frac{uv}{c^2}}, \gamma_w=\frac{1}{(1-w^2/c^2)^{1/2}},\gamma=\frac{1}{(1-v^2/c^2)^{1/2}}$$ By conservation of momentum, we have $$d(m\gamma v)+w\gamma_wdm=0$$ By conservation of energy, we have $$d(m\gamma c^2)+\gamma_wc^2dm=0, \gamma_wdm=-d(m\gamma ).$$ Substituing, we eliminate $$\gamma_w$$, and $$d(m\gamma v)-wd(m\gamma)=0,$$ so the equation in the book is proven. In the question, the sign difference of the momentum is ignored.
Now we need to solve the equation. Keep in mind that $$u$$ is constant while $$v$$ is a function of $$m$$. We have $$d(mv\gamma)=vd(m\gamma)+m\gamma dv=wd(m\gamma),\\ \Rightarrow m\gamma dv=(w-v)d(m \gamma ),\\ \frac{dv}{w-v}=\frac{d(m\gamma)}{m\gamma}.$$