speed = distance/time, so distance = speed * time
s = speed, t = time
First train 480 = st or s = 480/t
Second train 480 = (s - 8)(t + 3)
Plug the first equation into the second for s (I'm also going to switch sides of the second equation)
(s - 8)(t + 3) = 480
(480/t - 8)(t + 3) = 480
t*480/t + 3*480/t - 8t - 8*3 = 480
480 +1440/t - 8t - 24 = 480
The 480's cancel on each side, so we have
1440/t - 8t - 24 = 0
Multiply the whole equation by t (I'm going to move stuff around on the left also)
-8t² - 24t + 1440 = 0
All 3 terms are divisible by 8, so you can divide that out. Dividing by -8 gets rid of negative in front of your t² term.
t² + 3t - 180 = 0
To factor, what two numbers have a difference of 3 & a product of 180? 12 & 15, so
(t + 15)(t - 12) = 0
For that to be true, t = -15 or 12.
You can't have negative time, so the answer is 12 hours.
speed = distance/time = 480 km/12 hr = 40 km/hr