so basically, one train has a head start of 45 miles
we assume that the slower train has the head start because if the faster train had the head start, then faster train would just get farther and farther away from the slower train (distance≥45mi for all time)
so
set a 0 point
lets say that at t=0, fast train has traveled 0 and slow train has traveled 45
distance=speed times time+headstart
so dist_fast=70*t+0=70t
dist_slow=60*t+45=60t+45
when will the distance between them be 10?
there will be a time when slower train will be in front and when fast train will be in front
when slow train is in front, dist_slow-dist_fast=10 or
60t+45-70t=10
solve for t
60t+45-70t=10
-10t+45=10
minus 45 both sides
-10t=-35
divide both sides by -10
t=-3.5 hrs
when fast train is ahead, dist_fast-dist_slow=10
70t-(60t+45)=10
70t-60t-45=10
10t-45=10
add 45 to both sides
10t=55
divide both sides by 10
t=5.5 hrs
so after 3.5hrs is the first time they are 10 miles apart
after 5.5 hours is the 2nd time they are 10 miles apart