Optimization, minimize cost – MathOverflow

A trucking company has hired him to determine the optimal speed of the road, and they must require their drivers to minimize the costs. The decision will be based solely on economic reasons. Just keep in mind:

1) driver's hourly wage (W), and

2) price of fuel (P), measured in $ per gallon.

The formula for the fuel consumption rate is:

r = 9.34 (miles / gallon) -0.0596 (hours / gallon) * v

where r is in miles per gallon and v is in miles per hour.

Determine the formula that would be used to calculate the optimal velocity for any value of W and P.

I've been stuck on this question for several hours now. I do not know how to get the mpg in the equation. Do I also have to use the formula for the fuel consumption rate? Any advice on where or how to start would be great.