Suppose you drive to a picnic spot at 20 mph, then how fast you must go while returning back home on the same route such that your average speed becomes 40 mph?

Impossible Math Problem

infinite speed

Let us denote distance with d, time to get there by T, time to get back by t and the speed while travelling back with R.

Now by applying the simple time, distance and speed formula:
d = 20T
T = d/20

d = Rt
t = d/R

As you can see, we have the equations for both T and t now. We can now finally derive and equation for the round trip.

2d = 40(T + t)
2d = 40(d/20 + d/R)
2d = 40d(1/20 + 1/R)
1 = 20(R/20R + 20/20R)
20R = 20(R+20)
R = R + 20

You can clearly see that it is a paradox as to make the average speed 40 mph, you will have to travel back at an infinite speed. The faster you return, the quicker you can make it although your faster speed will offer a lesser impact on the average speed.

If you made the return trip instantly, it would be comparable to traveling double the distance in the same time that was taken on the one way trip.

Thus to reach the average speed of 40 mph, you must return with an infinite speed.