having trouble coming up with formula

Okay, here we have this:
Considering the provided information, we are going to calculate the speed at which he runs, so we obtain the following:
So we have the following equation:
Distance Traveled Walking + Distance Traveled Running = Total Distance
Distance Traveled Walking + Distance Traveled Running = 20 miles
And taking into account that speed is equal to distance over time, if we take speed to which runs as x we have:
((x/2) mi/h * 2h) + (x mi/h* 1.5h) = 20 miles
x mi+ 1.5x mi= 20 mi
2.5x mi=20mi
x = 20mi/2.5mi
x=8
Finally we obtain that he runs at 8 miles per hour.