For the first portion of her trip, Frederique traveled of the total distance in miles at an average speed of 40 miles per hour, such that
. She traveled the remaining distance at an average speed of 60 miles per hour. In terms of
, what was Frederique's average speed for the entire trip?