# Speed of two trains travelling side by side

I'm a high school student, and I have come across a problem that I cannot solve. I feel there must be something obvious that I'm not seeing.

Problem: The distance between two train stations is $96$ km. One train covers this distance in $40$ minutes less time than another one. The second train is $12$ km/h faster than the first one. Find both trains' speeds.

What I have done: Set $v_1+12 = v_2$ (the speed of train $2$ is $12$km/h more than speed of train $2$), and $96/(v_1) = (96/v_2)-40$ (the time it takes for train 2 to transverse the distance between the stations is $40$ minutes less than the required by train $2$) Now, from here I get to: $v_1 = v_2-12$.

\begin{align} &\frac{96}{v_2-12} = \frac{96}{v_2}-40 \\ &\qquad\implies \frac{96}{v_2-12} = \frac{96-40v_2}{v_2} \\ &\qquad\implies v_2\cdot 96 = (v_2-12)\cdot (96-40v_2) \\ &\qquad\implies v_2\cdot 96 = v_2\cdot 96-40v_2^2-1152-380v_2 \\ &\qquad\implies 0 = -40v_2^2-380v_2-1152 \end{align}

Solving this quadratic equation yields no real roots.

Could you please suggest the right way to go?

• You are not going to get a sensible solution unless the faster train takes less time – Henry Jan 10 '18 at 14:34
• You wrote this: $96/(v_1)=(96/v_2)−40$ (the time it takes for train 2 to transverse the distance between the stations is $40$ minutes less than the required by train 2). The equation and the parenthetical remark contradict each other. If your equation is correct, $96/(v_1)$ is smaller ($40$ less) than $96/(v_2)$, so your equation says train 1 is faster. – Steve Kass Jan 10 '18 at 14:39
• +1 for first time poster a.) showing work, b.) not flat out asking for the answer – jameselmore Jan 10 '18 at 14:40
• If you find one or more of the answers helpful, it is customary to "Accept" one of them. Either accept the answer that you think is most helpful, or (if there are several that are all just as good), you might consider accepting the answer from the user with the least reputation (as accepting an answer gives a small reputation reward). – Xander Henderson Jan 10 '18 at 15:53
• The moral of the story is: write down your units! Now that you have found your mistake, here is a follow up problem. The two trains are at opposite ends of the 96km route, heading towards each other on the same track at the speeds you have deduced. How far apart are they when they collide? – Eric Lippert Jan 10 '18 at 19:53

Let $v_1$ km/hr denote the speed of the faster train, and $v_2$ km/hr denote the speed of the slower train (I seem to have reversed your notation—sorry, $v_1$ feels like faster variable to me than $v_2$). First off, we can relate the amount of time it takes for each train to travel the 96 km to the speed of each train. So, let $$t_1 \text{ hrs} = \frac{96 \text{ km}}{v_1 \ \frac{\text{km}}{\text{hr}}} = \frac{96}{v_1}\text{ hrs} \qquad\text{and}\qquad t_2 \text{ hrs} = \frac{96 \text{ km}}{v_2 \ \frac{\text{km}}{\text{hr}}} = \frac{96}{v_2}\text{ hrs}\tag{1}$$ denote these two times. We know that the faster train arrives 40 minutes (that is, $\frac{2}{3}$ of an hour—watch the units! (this is an easy mistake to make—I messed it up, too!)) earlier than the slower train, which implies that $$t_1 \text{ hrs} = t_2 \text{ hrs} - \frac{2}{3} \text{ hrs} = \left( t_2 - \frac{2}{3} \right)\text{ hrs},$$ and we know that the faster train is 12 kph faster than the slower train, hence $$v_1 \ \frac{\text{km}}{\text{hr}} = v_2 \ \frac{\text{km}}{\text{hr}} + 12 \ \frac{\text{km}}{\text{hr}} = \left(v_2 + 12\right) \ \frac{\text{km}}{\text{hr}}.$$ It should be noted that the only major mistake that I see in your work is in the above step—in your model the faster train takes more time to cover the distance, which is a problem. Substituting these into the equations at (1) (and eliding units—the units of time are hours, the unit of distance are kilometers, and the units of speed are km/hr), we get the system $$\begin{cases} t_2 - \dfrac{2}{3} = \dfrac{96}{v_2 + 12} \\ t_2 = \dfrac{96}{v_2}. \end{cases}$$ Can you solve it from here?

• Thanks to everyone!! First, I had messed up my vars as Henderson, SteveKass and others pointed, and second, I was ignoring the minute - hour relaationship. Solved. Lots of thanks. – Vladislav Vordank Jan 10 '18 at 15:25
• Xander, I wonder if you would consider actually including the units in your equations? I consider writing units to be such an important best practice (and, in particular, one that would have made one of the errors obvious) that I'd like to see it represented among the answers. But I don't think I could improve on your explanation, which is why I didn't just write my own answer. – David Z Jan 11 '18 at 0:38
• @DavidZ Indeed, and I probably would have done that in the first place if the "obvious" sign error hadn't made me complacent. I've edited the answer to include units in the setup. – Xander Henderson Jan 11 '18 at 6:29
• Thanks! (Your edit looked a little strange at first and I took a while to realize it's because I would omit units after the variables, e.g. let $v_1$ represent a speed, not just a number, and then write things like $v_1 = v_2 + 12\ \mathrm{km/hr.}$, but I suppose that's just a matter of preference.) – David Z Jan 11 '18 at 7:08

The question states that "One train covers this distance in 40 mins less than the other". Although it does not tell you which train, it is quite obvious that the faster train (i.e. train 2) takes 40 mins less.

So instead, it should be $96/(v2)=(96/v1)−40$.

• Also, you've mixed up hours and minutes. It should be 2/3 not 40. – Michael Behrend Jan 10 '18 at 14:46
• Thanks to everyone!! First, I had messed up my vars as Henderson, SteveKass and others pointed, and second, I was ignoring the minute - hour relaationship. Solved. Lots of thanks. – Vladislav Vordank Jan 10 '18 at 15:25

I'll post this as an answer, since i'm not yet allowed to write comments. So, as mentioned in the comments (and the answer given by glowstonetrees) you might want to use $96/(v2)=(96/v1)−40$ instead.

Also keep in mind that you are subtracting minutes from hours. Your final formula should be $96/(v2)=(96/v1)−(40/60)$.

• Thanks to everyone!! First, I had messed up my vars as Henderson, SteveKass and others pointed, and second, I was ignoring the minute - hour relaationship. Solved. Lots of thanks. – Vladislav Vordank Jan 10 '18 at 15:25

A method that doesn't require the quadratic formula:

Once you've corrected the errors mentioned in the other answers, you should have

96/(v+12) = 96/v – 2/3

You can rewrite that as

8/(v/12 +1) = 8/(v/12) -2/3

12/(v/12+1)=12/(v/12) – 1

This is in some ways a more complicated form, but if we assume that each term is an integer, then v/12 and v/12+1 must be factors of 12. And what factors of twelve are there that differ by 1? Just 3,4. If we plug those in and check, 12/4 = 12/3 -1 => 3 = 4-1. So v/12 = 3 => v = 36 and the other speed is 4*12 = 48.

Also, when you get an equation like

v2⋅96=(v2−12)⋅(96−40v2)

You should divide out by the common factor of 8 and get

v2⋅12=(v2−12)⋅(12−5v2)

before multiplying it out.