Answer: (1)
; (2) 340 miles. See details below.
Step-by-step explanation:
The key here is to know that given the speed and time traveled you can determine the (distance traveled) as (speed) x (time).
They want us to keep the time traveled for the first part of the journey as a variable, so let us do that. The speed during the first part is 65mph, so the distance for the first part is

Knowin that the total ride was 6 hours, the distance in the second part (with speed of 40 mph) is as follows:

So the total distance in terms of t is:

(this is the answer to the first question). Note that t can range form 0 to 6 hours but outside of this range the expression is not applicable.
If we know t=4 hours:

The answer to the second question is 340 miles.