Hello! The answer to your question would be as followed:
We have the first train going west at x speed mph
The second train is going east at (x+15) mph
The distance covered by first train in 2 hours = s · t
speed equaling x mph and time equaling 2 hours
distance = (2x) miles
Then after 2 hours, the second train leaves
After being six hours after the second train left, the two trains were 580 miles apart
Thus, eight hours after the first train left, the two trains were 580 miles apart
The distance traveled by the first train due west in 8 hours = s · t
= x · 8
= (8x) miles
The distance of the second train going east in six hours = s · t
= (x+15) · 6
Then the total distance between the trains is distance traveled by the first train added to distance traveled by the second train
8x + 6(x+15)=580
8x+6x+90=580
14x=580-90
14x=490
x=35
Meaning the first train was traveling at 35 mph
while the second train was traveling at (35+15) = 50 mph