Answer:
Since the taxis are heading directly towards each other, we will assume the path between them to be a straight line
We have 2 taxis coming towards each other, which means that we have 2 observers in this system
so from now on, we will see this situation from the eyes of the driver coming at the speed of 40mph
Now imagine yourself in a car. if you are in a moving car, a tree outside will look like it is moving in the opposite direction and it will be doing so at the same speed as the speed of your car and we will always feel like we are at rest
so, we can say that when we are in a car, the objects coming towards us will have our car's velocity added to their velocity, as in the above case, the speed of the tree is 0mph and your speed is v mph, which causes the tree to move back at a velocity of v mph
Now, back to the question. we are in a car moving at a speed of 40 mph and there is a car coming towards us is moving at a speed of 27 mph
If we look at the situation from the eyes of the driver of the car moving at a velocity 40 mph,
he is at rest and the other car is moving at a velocity of (40 + 27) = 67 mph
So, from the frame of reference of the 40mph driver, the other car is moving at 67 mph and the time taken by a car moving at 67 mph to cover 7 miles is the time in which the taxis will meet
Hence, time taken by a 67 mph car to cover 7 miles
time = distance / speed
time = 7 / 67
time = 0.1 hour (approx) or 6 minutes
Therefore, the taxis will meet after 6 minutes