Question 1197607
<font color=black size=3>
The other tutors have provided great answers already.


Here's a numeric approach.


Let's say the distance from Boston to Framingham is 200 miles. Admittedly I'm not familiar with the Boston area, so this figure may be inaccurate compared to the real distance. But I'll stick to 200 since 50*40 = 200.


It doesn't matter what the distance is as the tutor @ikleyn has shown the distance (D) cancels.
The distance doesn't matter as long as the distance is the same from A to B, compared to from B to A.


Joseph traveled 200 miles from Boston to Framingham at 50 mph.
distance = rate*time
time = distance/rate
time = 200/50
time = 4 hours


Then he travels from Framingham back to Boston at 40 mph
We need to assume he takes the same route coming back home (or he'll likely travel a different distance).
time = distance/rate
time = 200/40
time = 5 hours


The total round trip distance is 200+200 = 400 miles.
The total time is 4+5 = 9 hours.
Ignore any moments where he is stopped, eg: getting gas, as that doesn't factor into the total travel time. 


Then,
distance = rate*time
rate = distance/time
rate = 400/9
rate = <font color=red>44.444 mph approximately</font>
This represents the approximate average speed for the entire round trip.


A related concept is the harmonic mean
<a href = "https://www.mathsisfun.com/numbers/harmonic-mean.html">https://www.mathsisfun.com/numbers/harmonic-mean.html</a>
</font>