Question 1208315
<pre>
Think of the two parallel tracks as identical number lines.
Suppose the longer train is traveling to the right (east) and the shorter train
is traveling to the left (west).

The speed of the longer train headed right will be taken as a POSITIVE speed 
and the speed of the shorter train headed left will be taken as a NEGATIVE
speed. 

The noses of the trains are side by side at time t=0 and their noses are both
at point 0 on their number lines (their tracks).

The tail of the long train is at point -1/5 at time t=0.
The tail of the short train is at point +1/8 at time t=0.

We want to know when the tails of the trains will be side-by-side at the same
point.

The longer train's tail is at point -1/5 at time t=0 and is traveling at rate
+40 mph.
The shorter train's tail is at +1/8 at time t=0 and is traveling at rate 
-50 mph.

Using DISTANCE = RATE x TIME:

At time t, the longer train's nose is at point 40t and so its tail is 1/5 mile
further to the left, that is, at 40t-1/5

At time t, the shorter train's nose is at point -50t and so its tail is 
1/8 mile further to the right, that is, at -50t+1/8

Remember, we want to know when the tails of the trains will be side by side at
the same point on the number lines.

We set them equal and get 

{{{40t-1/5=-50t+1/8}}}
{{{90t=1/8+1/5}}}
{{{90t=5/40+8/40}}}
{{{90t=13/40}}}
{{{t=(13/40)/90}}}
{{{t=13/3600}}} of an hour.

That is a very convenient denominator, for
since there are 60x60=3600 seconds in an hour,
that means the answer is 13 seconds.

[In case you're interested in where on the number line (track) that will
occur, it will be at -293 1/3 feet. That means they will have passed each
other 293 1/3 feet before the longer train's tail has reached the point 0 
on the tracks, and where the shorter train is 293 1/3 feet left of
the point 0, (where their noses were side by side).]

Edwin</pre>