Let
x ----> average rate on the trip home
y ----> average rate on the trip to the mountains
Remember that
The rate or speed is equal to dividing the distance by the time
speed=d/t
d=t*speed
on the trip home
d=5x -----> equation 1
on the trip to the mountains
d=8y ----> equation 2
we know that
her average rate was 21 miles per hour faster on the trip home
x=y+21 -----> equation 3
therefore
substitute equation 3 in equation 1
d=5(y+21) -----> equation 4
Equate equation 2 and equation 4 (because the distance is the same)
8y=5(y+21)
solve for y
8y=5y+105
8y-5y=105
3y=105
y=35
Find out the distance
d=8y
d=8(35)=280
The answer is 280 miles