# Car rental cost function graph

An economy car rented in Florida from Enterprise on a weekly basis costs $185$ per week. Extra days cost $37$ per day until the day rate exceeds the weekly rate, in which case the weekly rate applies. Also any part of a day used counts as a full day. Find the cost C of renting an economy car as a function of the number x of days used, where $7 \le x \le 14$. Graph this function.

From what I understand I made the following piecewise function.

$$f(x) = \begin{cases} 185 & x=7\\[2ex] 185+(x-7)(37) & 7<x<14\\[2ex] 370 & x=14 \end{cases}$$

What would the graph be for this ?

• Are you sure you got the function right? How much would it cost to rent the car 13 days? – David Sep 20 '15 at 23:32
• @David I edited the function. I'm guessing it is right now ? – RufioLJ Sep 21 '15 at 0:08

The current version of the function is not right. As @David implied, you do not correctly handle the fact that anything between $11$ and $14$ days will be billed the same as $2$ weeks, due to the "until the day rate exceeds the weekly rate" clause. You also do not handle $x$ being a non-integer: it should be rounded up.

Here is a function that I believe is correct:

$$f(n)=\begin{cases} 185+37(\lceil x\rceil-7), & 7\le x\le 11 \\[2 ex] 370, & 11<x\le 14 \end{cases}$$

where $\lceil x\rceil$ is the ceiling function, rounding up to the smallest integer greater than or equal to $x$.

The ceiling function means that each small section of the graph, of width $1$, will be a horizontal line. The second case means that the last part of the graph is a horizontal line between $x=11$ exclusive to $x=14$ inclusive. The first case means that the segments will be like a staircase, with the left-hand endpoints on the line $y=185+37x$. Here is a graph. A better graph would have large solid dots and open dots to show which endpoints of the line segments are on or not on the graph. This should basically answer your question, however.