CHAPTER 3
### Chapter 3 - The Mathematical function and its Graph

### Gas savings calculator

#### The
savings of driving slower expressed in dollars per hour

Most 4-cylinder japaneese/korean cars achieve maximum fuel efficiency at 45 miles per hour. Most drivers
average 70 miles per hour on the interstate. If they drove 55 instead of 70, they would observe 15% better gas mileage.
The problem is drivers do not think the extra time it takes by driving slower is worth the gas savings.

In this exercise we will
develop a function to express the savings in terms of dollars per hour. So if someone who drives 55 takes 1 hour longer to
reach their destination, we can say they saved $x per hour. If they took 3 hours longer, their
total savings would be 3 * $x. So you can compare that number to the minimum wage
to determine if their time was better spent flipping burgers or driving slower.

You have to look at the problem in terms of how much longer you are spending in the car relative to the higher speed. So if it takes 1 hour at 70 mph to do 70 miles it takes 1 hour 16 minutes to do it at 55 mph. So you have to take the fuel savings for that trip and divide it by 16 minutes to get your $savings/hour.

Doing this we get:

At 70 mph, mileage is 35 mpg , so 2 gallons of gas is used. At $3.85/gallon will have spent $7.7

At 55mph, mileage is 41 mpg, so we spent ( 70/41 ) * 3.85 = $6.60

So for 16 minutes longer trip we saved $7.70 - $6.60 or $1.10 which translates to hourly savings of $1.10 / 16 minutes = $4.1/hour