There are parallel train tracks running from Abilene to Imogene. The tracks run in a straight line between the two cities. On a particular morning, Train A begins the journey from Abilene to Imogene on the first track. At the exact same time, Train B begins the journey from Imogene to Abilene on the second track. The two trains always travel at constant velocities.

The two trains pass each other at a small town called Xanadu. From there, Train A takes another 5 hours to reach Imogene, while Train B takes another 10 hours to reach Abilene.

The next day, Train A embarks on the return trip to Abilene at the exact same time Train B leaves for Imogene. This time, they pass each other at a small town called Yonkers, whereby Train A takes another 5 hours to reach Abilene while Train B takes another 10 hours to reach Imogene.

If the distance between Yonkers and Xanadu is 500 miles, then how fast is each train traveling?

Ab...................X......................Y...................Im

as mentioned before, the distance between Abilene and X are the same as the distance between Y and Imogene, since the descriptions of the trips are identical. Lets call that distance X, the speed of train A=A, the speed of train B=B.

Then we get the equations (500-X)/A=5 and X/B=10 and (500-x)/B=X/A.

If we replace A and B in the third equation by (500-X)/5 respective X/10 we get (500-X)*10/X=5X/(500-X).

moving around terms a bit and we get X^2+500000-2000x=0

the quadratic formula gives x=1000+/- sqrt(1000000-500000)

X1=~1707 and X2=~292

if we use X1 we get the same answers as Bractals got, 170.7 mph and 241.4. But if we use X1, the distance 500-x will be a negative value, which should mean the the town wouldnt be between A and B, therefor we must use X2. By using that value in the equations (500-x)/A and X/B=10 we get that Train A travels at 41.42 mph and Train B travels at 29.29 mph.