1st train going west has speed x mph
second train going east has speed (x+15)mph
distance covered by first train in 2 hours=s*t
speed=x mph,time=2 hours
distance=(2x)miles
after 2 hours,the second train leaves
it is given that six hours after the second train leaves,the two trains were 580 miles apart.
that means that 8 hours after the first train leaves,the two trains were 580 miles apart.
distance travelled by first train due west in 8 hours=s*t
=x*8
=(8x) miles
distance travelled by secnd train going east in 6 hours=s*t
=(x+15)*6
Then total distance between the trains is distance travelled by first train added to distance travelled by second train
ie.
8x+6(x+15)=580
8x+6x+90=580
14x=580-90
14x=490
x=35
Hence the first train was travelling at 35 mph
while the second train was traveliing at (35+15)=50 mph
Hope this helps,
good luck.