Let `t_1` be the time travelled by Michael in going to his friend's house and let `t_2` be the time on his return trip.
Since the total time in his round trip is 4 hours, then the first equation is:
`t_1 + t_2= 4` (Let this be EQ1.)
Then, apply the formula of speed `(s=d/t)` to express the t's in terms of distance travelled.
In going to his friend's house, plug-in s=40 and t=t_1. And, solve for t_1.
`t_1=d/40` (Let this be EQ2.)
In his return trip, plug-in s=45 and t=t_2. Since Michael took the same route, then his distance travelled is still the same (d). So,
`t_2=d/45` (Let this be EQ3.)
Now that the t's are expressed in terms of d, substitute EQ2 and EQ3 to EQ1.
`t_1 + t_2= 4`
To simplify this, multiply both sides by the LCD of the two fractions which is 360.
Then, combine like terms.
And, divide both sides by 17 to get d only on the left side.
Hence, the distance travelled by Michael is 84.7 miles.