I'm trying to understand conservation of linear momentum and collisions. I've arrived at a contradiction in my derivation of final, post collision velocities for two masses – the force derivation and momentum derivation of final velocity differ and I'm looking for some expert insight into what I did wrong.
Let us have two masses $m_1$ and $m_2$ with positions $x_1<x_2$ and initial, pre collision velocities $v_{i1}>0$ and $v_{i2}=0$. The only way to cause an object to accelerate is to apply a force to it. Experimentally, when $m_1$ and $m_2$ collide, $m_1$ accelerates in the positive direction of the x-axis, and $m_1$ decelerates; final velocities are $v_{1f}<v_{1i}\approx 0$ and $v_{2f}>v_{2i}$ . So where do we get this force which causes the decelerations.
I'm thinking that while $m_1$ has a zero acceleration, it has an effective force as it gains momentum which is active during the collision. Because $\dot{v_1}=\dot{v_2}=0$, the net force is zero and we therefore have conservation of linear momentum:
$$P_{\text{initial}}=P_{\text{final}}\\=p_{1i}+p_{2i}\\=p_{1f}+p_{2f}\tag{1}$$
Because $F=\frac{dp}{dt}=m\frac{dv}{dt}$, we have
$Ft=mv=p \tag{2}$
Defining $t_1$ as the duration that $m_1$ has held a constant velocity $v_{1i}$ and and substituting $t_1,m_1,v_{1i}$ into $(2)$ we have initial force on collision $F_i=\frac{m_1v_{1i}}{t_i}$. This tells us that momentum increases with time, but initial force on collision decreases.
Defining $t_2$ as the time when the collison is over (and $t_1$ initial time of collision), we have $$ x_1(t)=\int^{t_2}_{t_1}\left[v_{1i}+\int^{t_2}_{t_1}\left[-\frac{v_{1i}}{t}\right]\right]dt^2\tag{3} $$ and
$$ x_2(t)=\int^{t_2}_{t_1}\int^{t_2}_{t_1}\left[\frac{m_1v_{1i}}{m_2t}\right]dt^2\tag{4} $$ Because at the end of the collision $x_1<x_2$, we can solve for the duration of the collision using the following mathematica code:
ta = 10
m1 = 100
m2 = 1
v1 = 2
Remove[x1]
Remove[x2]
x1[t_] := Integrate[v1 + Integrate[-v1/t, t], t]
x2[t_] := Integrate[Integrate[m1*v1/(m2*ta), t], t]
FindRoot[x1[a] - x2[a] + 10^-6, {a, 0.0001}]
Yielding $t_c\approx 0$.
From these two equations (3) and (4), we can set
$$
v_1(t)=\int^{t_2}_{t_1}\left[v_{1i}-\frac{v_{1i}}{t}\right]dt\\
v_2(t)=\int^{t_2}_{t_1}\left[\frac{m_1v_{1i}}{m_2t}\right]dt
$$
Therefore, we should get $v_1f\approx v_2f \approx 0$.
But law of conservation of momentum tells us otherwise. $$ v_{2f}=\left(\frac{2m_1}{m_1+m_2}\right)v_{1i} $$
$$ v_{1f}=\left(\frac{m_1-m_2}{m_1+m_2}\right)v_{1i} $$
I really have no idea what false assumption I am making.