
The diagram represents the question. AC represents the time for the round trip=2.25 hrs.
AB represents the outward trip and BC the return walk.
The slope of AB is R=32 mph and the slope of BC is R=4 mph.
The shorter segment of AC has a length (time) of D/32 where D is the distance of the trip, and the longer segment has a length of D/4.
So D/32+D/4=2.25=9/4. Multiply by 32: D+8D=72, so 9D=72 and D=8 miles.