average speed = total distance travelled / time taken
in this case total distance = 2x miles
time taken for first half of the journey = x/10 hours and for second part its x / 8 hours
average speed = 2x / ( x/10 + x/8) = 2 x / ( 4x + 5x / 40)
= 2x * 40 / 9x = 80 / 9 mph 8.89 mph