The three-field formula
The total is (distance / MPG) x price per gallon. Distance and MPG combine first to produce gallons burned, then the price converts gallons into dollars. Because it is a single multiplication chain, every input scales the result proportionally: doubling the distance doubles the cost, and so does halving the MPG. That proportionality is why a small change in fuel economy matters more on a long trip.