Problems on trains - Two trains/objects travelling in same direction with length
We calculate relative speed as difference between both of the trains/objects speed 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) where u>v
The distance between them is considered as sum of their lengths i.e l = l1 + l2
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