Solution (source code)

= Solution

For $0\le k<1$, the first burn reduces the total <mass> from $M+m_0$ to $M+(1-k)m_0$. The <rocket equation> therefore gives
$$
v_1=u\log\frac{M+m_0}{M+(1-k)m_0}.
$$
Detachment exerts negligible impulse, so the surviving second stage keeps <velocity> $v_1$. Its initial and final <masses> are $(1-k)(M+m_0)$ and $(1-k)M$, respectively. A second application of the <rocket equation> gives
$$
\boxed{v_2=u\log\frac{M+m_0}{M+(1-k)m_0}+u\log\left(1+\frac{m_0}{M}\right).}
$$
For the single-stage comparison from rest, $v_{\rm single}=u\log(1+m_0/M)$. Hence
$$
\boxed{v_2-v_{\rm single}=u\log\frac{M+m_0}{M+(1-k)m_0}\ge0.}
$$
Equality holds at $k=0$; for positive fuel and exhaust speed it is strict when $0<k<1$. This <two-stage rocket with proportional fuel and body masses> gains speed by discarding inert body <mass> before the last burn.

As $k\to1^-$ the expression tends to $2u\log(1+m_0/M)$, but the surviving second-stage <mass> also tends to zero. At exactly $k=1$ there is no second stage, so its final <speed> is undefined and that limiting formula cannot be assigned to it. The first stage alone reaches the single-stage burnout <speed> before detachment. If $m_0=0$, neither design gains speed.