We can have two d = rt equations.
d = 40 t
d = 50 (9 - t)
We know the distance is the same, so we can just set the equations equal to each now.
40 t = 50 (9 - t)
40 t = 450 - 50 t
90 t = 450
t = 5
So, Terrell took 5 hours going 40 mph, and 4 hours going 50 mph. 5 * 40 gives us 200 miles one way.