Calculating the rest mass after relativistic collision Suppose we got two particles, both of mass $m$ for simplicity, travelling at high speeds towards each other, meaning we have to take into consideration of relativistic effects. We also know that the collision is inelastic, and they hit each other head to head, meaning they travel along the same direction. We have also been given the fact that their relative velocity is $v$. What is then the rest mass of the particle formed after the collision?
My attempt at solving this problem is using the fact that the four-momentum vector is conserved in all types of collisions.
The four-momentum vector can be described as $\vec{P}_1 = m \gamma(v_1)(1,v_1,0,0)$ for our first particle, and $\vec{P}_2 = m \gamma(v_2)(1,v_2,0,0)$, meaning that the initial four-momentum vector is $\vec{P} = m \gamma(v_2)(1,v_2,0,0) + m \gamma(v_1)(1,v_1,0,0)$
After the collision, we get a new particle with mass $M$ and velocity $v_f$. Meaning, our four-momentum vector becomes $\vec{P} = M\gamma(v_f)(1,v_f,0,0)$
Since it's conserved, we set the previous expression equal to the latter, giving us:
$$\left\{\begin{matrix}
m(\gamma(v_1)+\gamma(v_2)) = M\gamma(v_f) \\
m(\gamma(v_1)v_1+\gamma(v_2)v_2) = M\gamma(v_f)v_f
\end{matrix}\right.$$
$$\Leftrightarrow$$
$$\left\{\begin{matrix}
m(\gamma(v_1)+\gamma(v_2)) = M\gamma(v_f) \\
(\gamma(v_1)v_1+\gamma(v_2)v_2) = (\gamma(v_1)+\gamma(v_2)) v_f
\end{matrix}\right.$$
$$\Leftrightarrow $$
$$\left\{\begin{matrix}
m(\gamma(v_1)+\gamma(v_2)) = M\gamma(v_f) \\
\frac{(\gamma(v_1)v_1+\gamma(v_2)v_2)}{(\gamma(v_1)+\gamma(v_2)} = v_f
\end{matrix}\right. $$
Substituting the latter equation into the first, we have:
$$ 
m(\gamma(v_1)+\gamma(v_2)) = \frac{M}{\sqrt{1-\left(\frac{(\gamma(v_1)v_1+\gamma(v_2)v_2)}{(\gamma(v_1)+\gamma(v_2)}\right) ^2}}
 $$
$$\Leftrightarrow$$
$$ m = \frac{M}{\sqrt{\left(\gamma(v_1)+\gamma(v_2)\right)^2-\left(\gamma(v_1)v_1+\gamma(v_2)v_2)\right) ^2}}$$
$$\Leftrightarrow$$
$$ m = \frac{M}{\sqrt{\gamma(v_1)^2(1-v_1^2)+\gamma(v_2)^2(1-v_2^2)+2\gamma(v_1)\gamma(v_2)(1-v_1v_2)}} = \frac{M}{\sqrt{2+2\gamma(v_1)\gamma(v_2)(1-v_1v_2)}}$$
Now from this I want to somehow simplify the root using the fact that $v_1-v_2 = u$ and then solving for $M$, however, I struggle solving it from here. I'd be glad if someone could give me any tips on how to further simplify this expression.
Edit: Okay, I see what went wrong now, it's the fact that $u \neq v_1-v_2$, rather $u = \frac{v_1-v_2}{1-v_1v_2}$, this managed to solve the problem for me. However, why is that $u$ is simply not what I first thought it to be. I mean, when we are given their relative velocity, we are an observer "outside" measuring their difference in velocity. Why did I have to use their relative velocity in special relativity, since the relative velocity is not given in the frame of one of the particles?
 A: it is simply a question of terminology, the relative velocity of two observers is the velocity of one with respect to the other. This way, you do not need to appeal to a third frame that is not well-defined. In this specific problem, while a natural candidate would be the center of mass frame, in general you would want the definition of relative velocity to be purely kinematical, in which case there is no privileged third frame.
Btw, I would recommend to use arrows for the spatial part of 4 vectors, and the calculations are made easier if you use the Minkowski metric (I'll use the +,-,-,- convention) instead of looking at a specific frame, this unlocks the full power of the geometric nature of 4 vectors. For your problem, writing $u_1,u_2$ the respective 4-velcoties and masses of the particles, you get $M = \sqrt{(u_1+u_2)^2}m$. The geometric translation of the relative velocity is $u_1\cdot u_2 = \gamma(v)$ so you directly get:
$$
M = m\sqrt{2+2\gamma(v)}
$$
Hope this helps and tell me if you find some mistakes.
