Problems on trains - Two trains/objects travelling in opposite direction with length
We calculate relative speed as sum of both of the trains/objects speeds i.e if u m/s is the speed of first train/object and v m/s is the speed of second train. Then we calculate,
Relative speed = (u+v)m/s
The distance between them is considered as sum of their lengths i.e l = l1 + l2
where, l1 = length of first train,
l2 = length of second train
obtained relative speed and distance is used to calculate time taken for the fastest object to completly cross the other.
Formulae Used
Time taken = (length of object1 + length of object2) / Relative speed