So first, we're gonna split these into their own little sections.
If Duncan drove 30 mph for 20 minutes, we need to think about the time for now. One hour is 60 minutes, and 20 minutes is 1/3 of an hour. If it's 30 miles per hour, then we'd need to split that into thirds to give it the twenty minute value, so in twenty minutes he drove 10 miles.
For the second part, we're gonna do the same thing. 40 mph in twelve minutes. 60 divided by 12 is 5. Then split the 40 mph into fifths. 40 / 5 = 8. Every twelve minutes, he drove 8 miles.
Add 10 and 8, and he drove a total of 18 miles to get home.