Let's say that the two cars travel from city A to city B, and we know that AB = 500m.
Let's also say that we consider city A to sit at x = 0, and city B to sit at x = 500. So, speed is positive for the car going from A to B, and is negative for the car going from B to A.
So, the first car follows this rule:
While the second car follows this rule:
But we know that the difference between their speed is 40, so let's say that
These are the equations that identify the position of the cars after
hours. Since we know that after 5 hours (i.e.
) the cars meet, it means that if we plug that value in both equations, we will have the same results. In formulas,
From here, it's easy to rearrange the equation and solve for the first car's speed:
And since the speed of the second car was 40 more than the first one, we have