Solution (source code)

= Solution

In the <centre-of-mass frame>, the two equal incoming <rest masses> have opposite <momenta> and total <energy> $2E$. The squared total <four-momentum> fixes the composite <invariant mass> $\mathcal M$:
$$
\mathcal M^2c^4=E_{\rm tot}^2-c^2|\mathbf P_{\rm tot}|^2=4E^2,
\qquad \boxed{\mathcal M=\frac{2E}{c^2}.}
$$
A change of <inertial frame>, including going to either particle's rest frame, cannot change this <invariant mass>. It includes the internal <kinetic energy> and is generally larger than $2M_1$.

There is a terminology convention worth making explicit. The older “relativistic mass” means frame-dependent total <energy> divided by $c^2$. To stop particle 1 requires a boost with <Lorentz factor> $\gamma=E/(M_1c^2)$, so the system has total <energy> $2\gamma E=2E^2/(M_1c^2)$ in that frame. Under that alternative convention, its relativistic mass would be $2E^2/(M_1c^4)$. This is not its <invariant mass>; both quantities coincide only when $E=M_1c^2$ and the incoming particles already have zero relative motion.