We know that in a collision the momentum of the system is conserved, that is:
[tex]p_i=p_f[/tex]In this case, since the railroad cars coupled together and have the same mass we have:
[tex]mv_1+mu_1=2mv[/tex]Now, we know the initial velocity of the cars, one is traveling at 5 m/s and the other is at rest; plugging the values and solving for the final velocity we have:
[tex]\begin{gathered} 20000(5)+20000(0)=2(20000)v \\ v=\frac{5(20000)}{2(20000)} \\ v=2.5 \end{gathered}[/tex]Therefore, the velocity of the combined cars is 2.5 m/s