September 17th, 2012, 08:43 AM  #1 
Newbie Joined: May 2012 Posts: 17 Thanks: 0  Renting a car
I have a tricky math question regarding renting car. I have to find a function that can describe the following situation. A car rental agency charges a fee of 40$ for renting a car. The first 100 miles are for free, but after you exceed 100 miles, you have to start paying an extra 0.34$ per mile. The key says the answer should be: But if you drive say 50 miles, you only have to pay 23$, although the fee was 40$. The function above says that if you drive less than 100 miles, you will pay less then the 40$ start fee, which should not be possible. The problem is to find a function that will give , When but when gives you the total amount you have to pay, 40$ fee + 0.34$/mile after 100 miles. The function I'm looking for should be flat at 40$ the first 100 miles, but after 100 miles start to move up like a linear function. That is to say if you enter x=50 in the function you should get y=40$, and not 23$ All I get is this function below, although it is not complete. Their shoud be a flat line at 40$ the first 100 miles, and then move like the graph I have below. If you plot it you will see what I mean. I'm really thankful if somebody could help me find this function. 
September 17th, 2012, 08:53 AM  #2 
Senior Member Joined: Jul 2010 From: St. Augustine, FL., U.S.A.'s oldest city Posts: 12,206 Thanks: 513 Math Focus: Calculus/ODEs  Re: Renting a car
You could use a piecewise defined function: 
September 17th, 2012, 09:37 AM  #3 
Global Moderator Joined: Dec 2006 Posts: 19,977 Thanks: 1851 
Or y = 40 + .17(x  100 + x  100), for x ? 0.

September 17th, 2012, 10:46 AM  #4 
Newbie Joined: May 2012 Posts: 17 Thanks: 0  Re: Renting a car
I'm greatful for your answers. I was also thinking of a piecewise defined function, but I'm looking for one function that incorporates all xvalues without making any definitions for the xvalues and yvalues. The function I'm looking for should give a graph that lookes like the graph in the attached image file. Is it even possible to make such a function? 
September 17th, 2012, 10:54 AM  #5 
Senior Member Joined: Jul 2010 From: St. Augustine, FL., U.S.A.'s oldest city Posts: 12,206 Thanks: 513 Math Focus: Calculus/ODEs  Re: Renting a car [color=#008000]skipjack[/color] cleverly gave you such a function using absolute value.

September 17th, 2012, 11:10 AM  #6 
Newbie Joined: May 2012 Posts: 17 Thanks: 0  Re: Renting a car
Oh sorry, I didn't really know what absolute values were, until you (MarkFl) pointed it out. I looked up what absolute values are about, and I now understand what skipjack meant. One learns something new every day! So once again I would like to thank skipjack and MarkFL for your answers. 