Answer:
3.5 hours.
Explanation:
When train Y is at position 0 train X is at position 25.
Speed = distance / time.
Suppose the distance travelled by train X before Train Y catches up with him is x miles.
Then we have the system
30 = x/ t
40 = (x + 25) / t where t is the time in hours.
x = 30t plug this into the second equation
40 = ( 30t + 25) / t
40t = 30t + 25
10t = 25
t = 2.5 hours.
Now the time taken for train Y to get 10 miles ahead is calculated as follows:
Combined speed = 40 - 30 = 10 mph.
so 10 = 10/t
t = 1 hours.
Answer is 3.5 hours.