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