Yah this one threw me too....I did a bit different.
Use the formula [Time=distance/rate]. Find the time first 10miles/40mph = 1/4hour,
next find the total time [20miles/30mph=2/3hr] substract 2/3hr-1/4hr = 5/12hr,
now you can find the rate for the second 10miles. [rate=distance/time]=[10miles / 5/12hr =
24mph]