I have been trying to derive why relativistic momentum is defined as $p=\gamma mv$.
I set up a collision between 2 same balls ($m_1 = m_2 = m$). Before the collision these two balls travel one towards another in $x$ direction with velocities ${v_1}_x = (-{v_2}_x) = v$. After the collision these two balls travel away from each other with velocity ${v_1}_y = (-{v_2}_y) = v$. Coordinate system travells from left to right with velocity $u=v$ at all times (after and before collision).
Please see the pictures below where picture (a) shows situation before collision and picture (b) after collision.
Below is a proof that Newtonian momentum $mv$ is not preserved in coordinate system $x'y'$. I used $[\, | \,]$ to split $x$ and $y$ components. $p_z'$ is momentum before collision where $p_k'$ is momentum after collision.
$$ \scriptsize \begin{split} p_z' &= \left[ m_1 {v_1}_x' + m_2 {v_2}_x'\, \biggl| \, 0 \right] = \left[ m_1 0 + m_2 \left( \frac{{v_2}_x - u}{1-{v_2}_x\frac{u}{c^2}} \right)\, \biggl| \, 0 \right]= \left[ m \left( \frac{-v - v}{1+ v \frac{v}{c^2}} \right) \, \biggl| \, 0 \right] \\ p_z' &= \left[ - 2mv \left( \frac{1}{1+ \frac{v^2}{c^2}}\right) \, \biggl| \, 0 \right] \end{split} $$
$$ \scriptsize \begin{split} p_k' &= \left[-2mv \, \biggl| \,m_1 {v_1}_y' + m_2 {v_2}_y'\right]=\left[ -2mv \, \biggl| \, m_1 \left( \frac{{v_1}_y}{\gamma \left(1 - {v_1}_y \frac{u}{c^2}\right)} \right) + m_2 \left( \frac{{v_2}_y}{\gamma \left(1 - {v_2}_y \frac{u}{c^2}\right)} \right) \right]\\ p_k' &= \left[ -2mv \, \biggl| \, m \left( \frac{v}{\gamma \left(1 - v \frac{v}{c^2}\right)} \right) - m \left( \frac{v}{\gamma \left(1 - v \frac{v}{c^2}\right)} \right)\right]\\ p_k' &= \left[ -2mv \, \biggl| \, 0 \right] \end{split} $$
It is clear that $x$ components differ by factor $1/\left(1+\frac{v^2}{c^2}\right)$.
QUESTION: I want to know why do we multiply Newtonian momentum $p=mv$ by factor $\gamma = 1/ \sqrt{1 - \frac{v^2}{c^2}}$ and where is the connection between $\gamma$ and factor $1/\left(1+\frac{v^2}{c^2}\right)$ which i got?