The trains take 57.4 s to pass each other.
Two trains A and B move towards each other. Let A move along the positive x axis and B along the negative x axis.
therefore,
[tex]v_A=90 km/h\\ v_B=-80 km/h[/tex]
The relative velocity of the train A with respect to B is given by,
[tex]v_A_B=v_A-v_B\\ =(90km/h)-(-80km/h)\\ =170km/h[/tex]
If the train B is assumed to be at rest, the train A would appear to move towards it with a speed of 170 km/h.
The trains are a distance d = 2.71 km apart.
Since speed is the distance traveled per unit time, the time taken by the trains to cross each other is given by,
[tex]t= \frac{d}{v_A_B}[/tex]
Substitute 2.71 km for d and 170 km/h for [tex]v_A_B[/tex]
[tex]t= \frac{d}{v_A_B}\\ =\frac{2.71 km}{170 km/h} \\ =0.01594 h[/tex]
Express the time in seconds.
[tex]t=(0.01594h)(3600s/h)=57.39s[/tex]
Thus, the trains cross each other in 57.4 s.