Let the speed of two trains are A m/sec. and B m/sec.
(here A > B)
Now, when moving in opposite direction, then
(A + B) × 20 = 150 + 150
(A + B) =
⇒ A + B = 15 ...(i)
when moving in same direction, then
(A – B) × 40 = 150 + 150
(A – B) =
= 7.5
From (i) and (ii), we get that
A =
= 11.25 m/sec.
Hence, speed of faster train = 11.25 m/sec.