Impossible

Explanation:

Let us first denote everything with variables.

d= distance to picnic place

T = time taken to get there

t = time required to get back

R = Speed while returning back

d = 20T

T = d/20

d = Rt

t = d/R

We have made equations for T and t and now we can derive an 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

Do you see the paradox here? You literally have to travel back at an infinite speed if you want to make the average speed of your trip 40 mph. The faster return speed will have lesser impact of the average speed but consider that the quicker your return trip is, the faster you will make it.

We are talking about travelling double the distance in the same time that was taken for one way trip. Thus, if you travel at infinite speed, you will be able to attain an average of 40 mph.