You can
put this solution on YOUR website!
The diagram as below.
500 m 100 km/h ->
A<------>B (1st train)
C<------------->D (2nd train)
<- 80 km/h 1000 m
When they pass each other after t hrs,diagram as
A B
<------>
<------------->
C D
After t hrs, B moves 100 t km and C moves 80 t km.
So we have 100 t + 80 t = BC = CD + AB = 1000+ 500
So, 180 t = 1500, t = 25/3 hrs
[Or get t by (1000+ 500)/(100+80) directly.
Answer: it takes 25/3 hrs for the trains to pass each other
from the moment the locomotives are at the same point.
Or get t by (1000 + 500)/ (1000+ 60) directly.