So first we have to solve for the total momentum of the entire system. We can do this by solving momentum for the first train. The equation for momentum is p=mv, where "p" is momentum.
Total momentum is
[tex]p=(1000kg)*(15m/s) = 15000(kg*m/s)[/tex]
When the first train comes to a complete stop, it is an elastic collision. We can use conservation of momentum to solve for the velocity of the second train.
[tex]15000(kg*m/s)=500v
v=30m/s[/tex]
If they stick completely, then it is an inelastic collision. Here we have to combine the mass of the two trains and solve for the velocity.
[tex]15000(kg*m/s) = (1000+500)v
v= 10m/s[/tex]
Finally, if the train is 20m/s then what is the velocity of the first train. Just like before, we can solve using conservation of momentum.
[tex]15000=(500kg)(20m/s)+1000v
v=5m/s[/tex]