Question 29961
First, let's find the time it took Elvin to drive each leg of the trip.

First leg:
{{{t1 = d1/r1}}} d1 = 40 miles and r1 = 40 mph.
{{{t1 = 40/40}}}
{{{t1 = 1}}}hour.

Second leg:
{{{t2 = d2/r2}}} d2 = 40 miles and r2 = 60 mph.
{{{t2 = 40/60}}}
{{{t2 = 2/3}}} hours.

Now we need to find the "weighted" average speed for the entire trip.  Let's call that M.

{{{M = (r1*t1 + r2*t2)/(t1+t2)}}}
{{{M = (40*1 + 60(2/3))/(5/3)}}}
{{{M = (40+40)/(5/3)}}}
{{{M = 80(3/5)}}}
{{{M = 48}}}mph.