I just said “rates average harmonically”, so 2x80x40/(40+80). Works for speed, resistors in parallel, capacitors in series, springs in series, nuclear decay rates through different channels, other relaxation processes.
A funny incident happened over 30 when a statistics teacher tried to trick me in to fing average speed of 40 and 50 and distance of 150. My friend sitting next to me whispered "say 40" but I knew that that teacher wouldn't have have asked me if it was that simple. My initial guess was that the answer should be between 30 and 40 and I calculated 37.5. I still remember the look on the teacher's face and he said that in his 25 years of teaching the course no one else came up with the correct answer.
Nice problem. The 10 miles is irrelevant. The same answer will occur at any distance. This can be solved using alligation methods. Rate and time are inversely proportional. He spends twice the time going 40mph as he goes 80mph. The final answer is between 40 and 80 mph and the 40 receives a weight of 2 and 80 a weight of 1. It’s like a lever problem. There is a 2 pound weight on the 40 marker and a 1 pound weight on the 80 marker. The fulcrum should be placed at 40+ 1/3(80-40) .
s=d/t => 1/s = t/d, so 1/s1 = t1/d and 1/s2 = t2/d (t1+t2)/d = 1/s1 + 1/s2 => (t1+t2)/(1/s1 + 1/s2) = d here total time T = t1+t2 and total distance D = 2d, so we multiply by 2 and get 2T/(1/s1 + 1/s2) = D average speed : S = D/T = 2/(1/s1 + 1/s2) S = 2/(1/40 +1/80) = 2/(3/80) = 160/3 mph