We know the formula for rate is distance / time.

So The formula for distance shall be rate × time
Distance = rate × time.
Rate = 30 mph, Time = 1.5 h
Distance = 30 × 1.5 = 45 miles
Also for the second leg of the journey
Rate = 40 mph and time = 2 hours
Distance = 40 × 2 = 80 miles.
Total distance traveled = 45 + 80 = 125 miles
If Will drives 30 mph for 1.5 hours and then 40 mph for 2 hours, then he shall drive 125 miles.