Considering the length of train A=La , length of train B=Lb . The speed of train A be 5×x , speed of train B be 3×x From the information provided : The front end of A crossed the rear end of B46seconds after the front ends of the trains had crossed each other. In this case, train A traveled a distance equivalent to the length of train B which is Lb at a speed of 5×x+3×x=8×x because both the trains are traveling in the opposite direction. Hence (8×x)×46=Lb. In the information provided : It took another 69seconds for the rear ends of the trains to cross each other. In the next 69seconds The train B traveled a distance equivalent to the length of train A in this 69seconds. Hence (8×x)×69=La .