Question 1183834
<br>
This kind of problem is probably easiest to solve if we choose a "nice" number for the distance to the school.  Since the given speeds are 5, 8, and 40km/h, we can choose 40km for the distance to the school.  Note that choice is not reasonable in the real situation -- but it makes solving the problem easy.<br>
She walks half of the 40km at 5km/h, taking 20/5 = 4 hours.
She walks half of the 40km at 8km/h, taking 20/8 = 2.5 hours.
She rides back the whole 40km at 40km/h, taking 40/40 = 1 hour.<br>
In all, she traveled 80km in 4+2.5+1 = 7.5 hours; her average speed was 80/7.5 = 160/15 = 32/3km/hr or 10 2/3 km/h.<br>
ANSWER: 10 2/3 km/hr<br>
If you need to solve the problem using formal algebra, simply use d for the distance instead of choosing a specific number.  Then the total time for the trip is<br>
{{{(d/2)/5+(d/2)/8+d/40 = d/10+d/16+d/40 = (8d+5d+2d)/80 = 15d/80 = 3d/16}}}<br>
and her average speed was the total distance divided by the total time:<br>
{{{2d/(3d/16) = 2d(16/3d) = 32/3}}}<br>