Sub topic 5
Relative speed: same and opposite directions
This chapter assumes you are comfortable with the relation distance = speed × time, with converting km/h to m/s using the factor 5/18, and with solving a one-variable linear equation. Relative speed is the tool that turns most two-object problems in this topic into a single-object problem.
The idea: pretend one object is standing still
Relative speed is the speed of one object as seen from the other. If you sit in a car and a second car passes you, you do not care how fast each car moves relative to the road. You care how quickly the gap between you and the other car changes.
Relative speed lets you replace two moving objects with one. You freeze one object, give the other the relative speed, and use distance = speed × time on the gap between them.
| Situation on a straight line | Relative speed | What the gap does |
|---|---|---|
| Moving towards each other | sum of the speeds | shrinks |
| Moving away from each other (opposite directions) | sum of the speeds | grows |
| Same direction, faster one behind | difference of the speeds | shrinks |
| Same direction, faster one ahead | difference of the speeds | grows |
The rule works because velocities along a line have signs. Opposite directions mean opposite signs, so subtracting one velocity from the other adds the speeds. Same direction means the same sign, so the speeds subtract.
Worked example 1: moving towards each other
Two cars start 300 km apart and drive towards each other at 50 km/h and 70 km/h. When do they meet, and how far from the first car's start?
- Relative speed: 50 + 70 = 120 km/h.
- Time to close the gap: 300 / 120 = 2.5 hours.
- Distance covered by the first car: 50 × 2.5 = 125 km.
Check: the second car covers 70 × 2.5 = 175 km, and 125 + 175 = 300 km.
Worked example 2: chasing in the same direction
Car A is 30 km ahead of car B. Both drive in the same direction. A moves at 40 km/h and B at 55 km/h. When does B catch A?
- Relative speed: 55 − 40 = 15 km/h.
- Time: 30 / 15 = 2 hours.
- B travels 55 × 2 = 110 km. A travels 40 × 2 = 80 km, and 80 + 30 = 110 km, so both are at the same point.
Handling a head start in time
Often one object leaves later. The gap you divide is the gap at the moment the later object starts moving.
A leaves town at 9:00 at 40 km/h. B leaves the same town at 11:00 at 60 km/h in the same direction. When does B catch A?
- By 11:00, A has covered 40 × 2 = 80 km. This is the gap.
- Relative speed: 60 − 40 = 20 km/h.
- Time after 11:00: 80 / 20 = 4 hours, so B catches A at 15:00.
- Distance from the town: 60 × 4 = 240 km. A's check: 40 × 6 = 240 km.
The same method works for any problem that says "leaves t hours later". Compute the gap created during the delay, then treat it as the starting gap.
The same code, for checking
This function computes the closing time for a gap. It returns None when the gap never closes.
def closing_time(gap, speed1, speed2, same_direction):
"""Time for a gap to close.
Same direction: speed1 is the chaser, speed2 is the target.
Opposite directions: the objects move towards each other.
"""
relative = speed1 - speed2 if same_direction else speed1 + speed2
if relative <= 0:
return None # the chaser never catches up
return gap / relative
print(closing_time(300, 50, 70, same_direction=False)) # 2.5
print(closing_time(30, 55, 40, same_direction=True)) # 2.0
print(closing_time(80, 60, 40, same_direction=True)) # 4.0
print(closing_time(30, 40, 55, same_direction=True)) # NoneThe last call shows the usual same-direction check. If the object behind is not faster, no catch-up ever happens.
Units must match before you add or subtract
Relative speed only makes sense when both speeds use the same unit. Convert to m/s with the factor 5/18 whenever the gap is in metres and the time is in seconds.
Two trains, 120 m and 180 m long, run on parallel tracks at 54 km/h and 36 km/h. How long does the faster one take to completely cross the slower one?
- The distance to cover is the sum of the lengths: 120 + 180 = 300 m.
- Opposite directions: relative speed is 54 + 36 = 90 km/h, which is 90 × 5/18 = 25 m/s. Time is 300 / 25 = 12 s.
- Same direction: relative speed is 54 − 36 = 18 km/h, which is 5 m/s. Time is 300 / 5 = 60 s.
length_a, length_b = 120, 180 # metres
speed_a, speed_b = 54, 36 # km/h
gap = length_a + length_b
opposite = gap / ((speed_a + speed_b) * 5 / 18)
same = gap / ((speed_a - speed_b) * 5 / 18)
print(opposite, same) # 12.0 60.0The bird that flies back and forth
Some problems add a third object that moves back and forth between two others. Do not sum the zigzag legs. Find how long the two main objects take to meet, then multiply by the third object's speed.
Two trains are 200 km apart and move towards each other at 60 km/h and 40 km/h. A bird flies at 100 km/h from one train to the other and back until the trains meet.
- Time until the trains meet: 200 / (60 + 40) = 2 hours.
- The bird flies the entire time, so it covers 100 × 2 = 200 km.
Repeated meetings between two fixed points
Two travellers start together from points A and B, which are D apart. They walk towards each other, turn around instantly when they reach an end, and keep going.
- At the first meeting, their combined distance is D.
- At the second meeting, each has gone to the far end and come back part way. Their combined distance is 3D.
- At the n-th meeting (counting only meetings where they face each other), the combined distance is (2n − 1)D.
Since speeds are constant, each person's distance at the n-th meeting is (2n − 1) times their distance at the first meeting.
Example: D = 120 km, speeds 5 km/h and 7 km/h, so the relative speed is 12 km/h.
- First meeting at 120 / 12 = 10 hours. The first traveller has gone 50 km, so the meeting is 50 km from A.
- At the second meeting, the first traveller has gone 3 × 50 = 150 km. That is 120 km to B and 30 km back, so the meeting is 30 km from B, which is 90 km from A.
- Check with the second traveller: 3 × 70 = 210 km, which is 120 km to A and 90 km back. This also puts the meeting 90 km from A.
Common errors
- Subtracting when the objects approach each other. The word "towards" or "opposite" means add. The phrase "same direction" means subtract.
- Using the wrong gap. In a delayed-start problem, the gap is the distance the first object covers during the delay, not the full distance of the journey.
- Mixing units. A gap in metres with speeds in km/h gives a wrong time. Convert first.
- Forgetting to subtract the smaller speed from the larger. In a chase, the relative speed is faster minus slower. A negative result means no catch-up.
- Reporting the time when the question asks for a place. After you find the time, multiply it by one object's own speed to get the meeting point.
- Using only one length for trains. For two trains crossing completely, add both lengths.
Summary of the method
- Draw the gap and mark each object's direction.
- Decide: same direction means the difference of speeds, and opposite directions mean the sum.
- Make the units match.
- Divide the gap at the moment both are moving by the relative speed.
- Use each object's own speed with the time to find positions.
- Verify that the two distances reconcile with the gap.
Exercise
Two cyclists start 90 km apart and ride towards each other at 12 km/h and 18 km/h. How long until they meet, and how far has the slower cyclist travelled?
Show answer
Relative speed is 12 + 18 = 30 km/h, so the time is 90 / 30 = 3 hours. The slower cyclist has travelled 12 × 3 = 36 km.
Exercise
A train moving at 54 km/h is 90 m behind a train moving at 36 km/h on a parallel track in the same direction. How long until the front of the faster train is level with the front of the slower train?
Show answer
The relative speed is 54 − 36 = 18 km/h = 5 m/s. The time is 90 / 5 = 18 seconds.
Exercise
A leaves a town at 6:00 at 30 km/h. B leaves the same town at 7:30 at 45 km/h in the same direction. At what time does B catch A?
Show answer
By 7:30, A has covered 30 × 1.5 = 45 km. The relative speed is 45 − 30 = 15 km/h, so B needs 45 / 15 = 3 hours. B catches A at 10:30.