# Related Rates: The Distance Between Moving Points Problem

Lesson Transcript
Instructor: Erin Monagan

Erin has been writing and editing for several years and has a master's degree in fiction writing.

Remember the classic problem of math horror stories everywhere? You know, where one train leaves Kentucky at 2 p.m. and another leaves Sacramento at 4 p. m.? In this lesson, tame the horror and learn how to solve these problems using differentiation and related rates. Updated: 01/29/2020

## Two Trains Problem

Remember that problem that everybody always makes fun of: If one train leaves Kentucky at 2 p.m. and another leaves Sacramento at 4 p.m., and the alignment of the moons is such that everything is going 5 mph, when will they cross? We're going to do a problem that's similar, but a little more reasonable. Imagine that you have two trains heading toward one another. Train 1 is going eastbound at 30 mph, and Train 2 is headed westbound at 45 mph. They're going to start 100 miles apart. How far apart will they be in one hour? When will they pass one another?

Because we want to know how far apart they're going to be and when they pass each other (when the distance between them is zero), we want to write that the distance between them is equal to the position of Train 2 minus the position of Train 1, l = x sub 2 - x sub 1. Now we've got the distance between them, which I'll call l. Here we're going to use a related rate. We're going to relate the distance between them to each one of their speeds. I'm going to take the derivative of both the left and right side of this equation, and I'll get dl/dt (how their distance changes as a function of time) = dx(sub 2/dt) - dx(sub 1/dt), how fast Train 2 is going minus how fast Train 1 is going. If I plug in the velocity of Train 2 and the velocity of Train 1, I find that the distance is changing at a rate of -75 mph.

If I use a separation of variables to solve this differential equation - if I get all the t variables on the right side and all the l variables on the left side - I get dl=-75dt. If I integrate both sides, I find that l=-75t + C. Because they start out when time equals zero at a distance 100 miles apart, I can solve this l equation for C. So 100=(-75)(0) + C, that means C=100 miles. What I end up with is an equation for how far apart they are as a function of time: l=-75t + 100. After one hour, t=1, I find that l is 25, and they're 25 miles apart. They pass each other when l=0, when t=1.3 hours.

## Another Two Trains Problem

If Train 1 turns around and starts heading westbound at 30 mph instead of heading toward Train 2, and they still start 100 miles apart, how far apart will they be in one hour? Will Train 2 ever pass Train 1?

Again, I'm going to write the distance between the two trains as l= x sub 2 - x sub 1. I'm going to take the derivative of both the left and right sides. This time, after I find dl/dt = 'dx(sub 2/dt) - dx(sub 1/dt), and I plug in velocity 1 and velocity 2, velocity 1 is going to be negative because Train 1 is moving to the left (the same direction that Train 2 is moving). So dl/dt = (-45) - (-30) or dl/dt = -45 + 30. This means that the distance between them is changing at a rate of -15 mph. Again, using the fact that at time 0 they're 100 miles apart, I can solve this equation and find that l = -15t + 100. This means that after one hour, the two trains will be 85 miles apart. After 6.7 hours, Train 2 will overtake Train 1; I can solve this equation for t when l=0. But what if the distance isn't along a straight line?

To unlock this lesson you must be a Study.com Member.

### Register to view this lesson

Are you a student or a teacher?