Modeling with functions

Many real-world questions involve quantities that depend on one another:
The demand for a product depends on its price.
The mass of a container depends on how much liquid it currently holds.
The speed of a car depends on the pressure applied to the gas pedal.
The time for a computer to sort a list depends on the number of items in the list.
Mathematics gives us precise ways to describe these relationships and use them to make predictions. In this lesson, we'll use functionsfunctionA rule or relationship that assigns exactly one output to each allowed input. to build mathematical modelsmathematical modelA simplified mathematical description of a situation used to understand relationships and make predictions. of changing quantities.
By the end of this lesson, you should be able to:
- Represent and interpret relationships between quantities using multiple representations of functions.
- Describe changes in quantities using \( \Delta \) notation and interpret those changes in context.
- Build and analyze linear and nonlinear models to make predictions about real-world situations.
Imagine you're organizing a small concert, and one of the decisions you have to make is how much to charge for tickets. You have the following past data:
At one concert, you charged \( \$3.00 \) per ticket, and \( 720 \) people attended. Assuming that each person bought one ticket, your total revenuerevenueThe total amount of money received from selling goods or services. was \[3.00\text{ dollars per ticket}\times 720\text{ tickets}=2160\text{ dollars.}\]
At another concert, you charged \( \$3.50 \) per ticket, and \( 680 \) people attended. In this case, your total revenue was \( \$ \)Multiply the price per ticket by the number of tickets..
So when you raised the price, even though fewer people wanted to attend, you still ended up making more revenue.
At this point you wonder: if you choose a particular ticket price, could you predict how many people will want to attend and how much revenue the concert will make?
What you need is a mathematical modelmathematical modelA simplified mathematical description of a situation used to understand relationships and make predictions. — a simplified mathematical description of the situation that you can use to make predictions.
Let's first focus on the question of how many people might attend your concert. Based on your data so far, you might assume that whenever you raise the price by \( \$0.50 \), the number of people who will buy tickets goes down by \( 40 \) people. You continue this pattern to see what your model predicts.
| Price | Number of tickets demanded |
|---|---|
| \( \$3.00 \) | \( 720 \) |
| \( \$3.50 \) | \( 680 \) |
| \( \$4.00 \) | |
| \( \$4.50 \) | |
| \( \$5.00 \) |
Now that you have several predicted values, it may be helpful to look for a pattern in them. One way to do this is to graph your data.
If you put price on the horizontal axis and the number of tickets demanded on the vertical axis, you can see that the points all lie on a . Hence you would say that there is a linear relationship between price and quantity of tickets demanded.
The graph makes the pattern easier to see, but it might be inconvenient to read every single prediction from the graph. This is where a symbolic representation would come in handy — if you can find a formula for this relationship, you could enter any price you want, and the number of tickets would just pop out!
We'll use \( p \) to denote the price per ticket, and \( q \) to denote the quantity of tickets demanded at that price.
Since our model is based on the idea that equal changes in \( p \) lead to equal changes in \( q \), we might decide to look at the ratio between those changes. When we raised the price from \( \$3.00 \) to \( \$3.50 \), the number of tickets demanded decreased from \( 720 \) to \( 680 \); the ratio between those two changes is
\[\begin{aligned}\frac{\text{change in quantity}}{\text{change in price}}&=\frac{q\tsub{final}-q\tsub{initial}}{p\tsub{final}-p\tsub{initial}}\\ &=\frac{680-720}{3.5-3}\\ &=-80\end{aligned}\]
Based on our pattern, if we raise the price from \( \$3.50 \) to \( \$5.00 \), the number of tickets demanded should decrease from \( 680 \) to \( 560 \). If we once again compute the ratio of change in quantity to change in price, we get .
Our assumption that equal changes in price produce equal changes in demand means that this ratio will always be \( -80 \).
Since we divided a change in the number of tickets by a change in the price in dollars, this ratio is best expressed in : for every \( \$1.00 \) increase in price, the quantity of tickets demanded by \( 80 \). (Note that this also means that for every \( \$1.00 \)decrease in price, the quantity of tickets demanded by \( 80 \).)
If this relationship holds throughout our model, then for any other valid price \( p\ne 3 \) and corresponding quantity \( q \), the following equation should be true:
\[\frac{q-720}{p-3}=-80\]
We can solve for \( q \) by multiplying both sides by \( p-3 \):
\[q-720=-80(p-3)\]
Solving for \( q \) and collecting all the terms together, we get
\[q=-80p+960\text.\]
Since each value of \( p \) leads to exactly one value of \( q \), we can now think of \( q \) as a functionfunctionA rule or relationship that assigns exactly one output to each allowed input. of \( p \), which we emphasize by writing it as
\[q(p)=-80p+960\text.\]
Because equal changes in price produce equal changes in demand, \( q(p) \) is a linear functionlinear functionA function that can be written in the form f(x)=mx+b, where m and b are constants..
We can use this formula to predict the number of people who will buy the tickets at any price \( p \). For example, if we charge \( \$7.00 \), we have \( q(7)=-80(7)+960= \).
If we draw the graph of \( q(p) \), we see that \( -80 \) is the of the line, while \( 960 \) is the .
Notice that our model is only meaningful for \( \le p\le \): a negative price would not make sense, and too high a price would predict a negative number of tickets.
From here, we can now find the revenue in dollars, which is just the price per ticket multiplied by the number of tickets you sell. Since we developed a model for the quantity sold, we can now use it to derive a formula for revenue:
\[\begin{aligned}\text{Revenue} &= \text{Price} \cdot \text{Quantity}\\ R(p) &= p\cdot q(p)\\ &= p\cdot (-80p+960)\\ &= -80p^2+960p\end{aligned}\]
For example, if we charge \( \$7.00 \) for tickets, our revenue would be
\[R(7)=-80(7)^2+960(7)\text,\]
which comes out to \( \$ \).
Since this function involves \( p^2 \), its shape will be a , as shown in the graph below.
Looking at the graph, we can make a number of new observations and predictions. For example, we can see that there are two prices where the revenue is zero:
When \( p=0 \), you don't get any revenue because you're not charging anything.
When \( p= \), you don't get any revenue because you're charging so much that nobody wants to buy any tickets.
Also, based on the symmetry of the parabola, your maximum possible revenue would come from setting your price at \( \$ \), which would give you a revenue of \( \$ \).
Note that the models we've developed aren't necessarily perfect descriptions of what will happen at a real concert — they depend on our original assumption about how demand changes with price. But they do give us a useful way to turn that assumption into a prediction. By representing the same situation with data, graphs, and formulas, we were able to discover patterns and make observations that weren't obvious at first. This process of building and using mathematical models is the backbone of many of the problems we'll study in calculus.
Mathematical modeling
When we want to understand a real-world phenomenon, it's often useful to use mathematics to describe the relationships between the quantities involved. We do this by constructing a mathematical modelmathematical modelA simplified mathematical description of a situation used to understand relationships and make predictions., which is a simplified mathematical description of a situation. These models allow us to describe relationships between quantities and make predictions about how those quantities behave.
Building a mathematical model generally involves:
identifying the important quantities and features of a situation;
making assumptions about how these quantities are related;
using mathematics to explore the consequences of those assumptions; and
testing the model by deciding whether its results make sense in the original context.
A model doesn't need to perfectly describe every detail of reality to be useful; in fact, simplifying a complicated situation is often what makes the model useful in the first place! As we use our model and learn more about it, we test our assumptions and make refinements as necessary.
Functions
Functions are one of the most important tools we can use to build mathematical models.
We have many different ways of representing functions:
verbally, describing the relationship in words;
numerically, giving a collection of data values;
geometrically, displaying all input-output pairs as points;
symbolically, writing a formula for the relationship.
Different representations may show different features of the same function. For example, in the Explore activity for this section, we represented the relationship between ticket price and number of tickets sold:
as a written rule ("equal increases in price lead to equal decreases in quantity demanded");
as a set of data (both our known values from two concerts and our extrapolation from the pattern);
as a straight-line graph with a downward slope;
as a formula \( q(p)=-80p+960 \).
We often need to think carefully about what kinds of inputs we want to allow for a function. This is especially true when using a function as a model; not all values may make real-world sense in the context of our model. Hence we choose a domaindomainThe set of input values allowed for a function. — a set of allowed input values — that best reflects our situation.
For example, in the ticket price example, our model only made sense when \( 0\le p\le 12 \): negative ticket prices (\( p<0 \)) don't make sense, and neither do negative numbers of tickets (which occur when \( p>12 \)). Hence \( 0\le p\le 12 \) is the domain of our function. These inputs lead to outputs where \( 0\le q\le 960 \); we call this set of outputs the rangerangeThe set of output values produced by the allowed inputs of a function. of our function.
When we study functions mathematically, we often consider the natural domainnatural domainThe set of all inputs for which a function's defining expression is meaningful. of the function, which is the set of inputs for which the function is defined. For example, the natural domain of the function \( f(x)=\sqrt{x} \) is usually taken to be \( [0,\infty) \) when working only with real numbers.
Units
Any time you're working with real-world quantities, you need to keep track of the unitsunitsStandard quantities, such as feet or kilograms, used to express the measurement of a quantity. those quantities are measured in, such as feet, kilograms, degrees, and so on. These units help make sure that your computations are tied to the real-world contexts they came from, and they also give you a quick way to make sure that your results make sense.
In this book, we'll establish the following notational convention about units: if \( x \) is some quantity you're measuring, then \( [x] \) will sometimes denote the units it's measured in. For example, if \( x \) represents the length of a football field, then \( [x] \) might be in yards or meters.
Describing change
Calculus is fundamentally concerned with how different quantities change. We therefore need notation that lets us describe these changes precisely.
If \( y=f(x) \), we can also define the change in \( f \) as follows:
Linear and nonlinear functions
One particularly simple relationship between two quantities occurs when equal changes in the input correspond with equal changes in the output. The graph of such a relationship is a straight line, so we call a function with this property a linear functionlinear functionA function that can be written in the form f(x)=mx+b, where m and b are constants..
Another way to see this is that changes in the output are always proportional to changes in the input, and \( m \) is the scale factor that takes one to the other: \[\Delta y=m\Delta x\]
This means that the ratio of \( \Delta y \) and \( \Delta x \) is always the same: \[\frac{\Delta y}{\Delta x}=m\]
We call this ratio the rate of changerate of changeThe change in an output per unit change in an input. of \( y \) with respect to \( x \). It tells us how much the output changes per unit change in the input. For a linear function, the rate of change is constant and equal to \( m \).
For example, consider the train from earlier, whose position was \( s(t)=50t \). Its position changes by \( 50 \) miles for each hour that passes, so its rate of change is \( 50 \) miles per hour. In this context, the rate of change of position with respect to time is the train's velocity.
Velocity is an important example of a rate of change, but there's nothing inherently special about time. In our ticket model, \( \Delta q/\Delta p=-80 \) tickets per dollar is the rate of change of demand with respect to price.
Visually, \( m \) determines how steeply the line rises or falls as \( x \) increases, so we call it the slopeslopeThe change in a line's output per unit change in its input, measuring how steeply the line rises or falls. of the line.
Furthermore, since \( m(0)+b=b \), we call \( b \) the vertical interceptvertical interceptThe output value where a graph crosses its vertical axis; for y=mx+b, it is b. (or \( \boldsymbol{y} \)-interceptvertical interceptThe output value where a graph crosses its vertical axis; for y=mx+b, it is b.) of the line, as the line crosses the \( y \)-axis at the point \( (0,b) \). We call \( y=mx+b \) the slope-intercept formslope-intercept formThe form y=mx+b of a linear equation, where m is the slope and b is the vertical intercept. of a line.
If we know that a line has slope \( m \) and passes through a particular point \( (x_0,y_0) \), then any other point \( (x,y) \) on the line must satisfy
\[\frac{y-y_0}{x-x_0}=m\text;\]
we can rearrange this algebraically to obtain
\[y-y_0=m(x-x_0)\text.\]
This is called the point-slope formpoint-slope formA form of a linear equation that identifies the line's slope and one point through which it passes. of a line. It's especially useful when we know the slope and a point on the line, but not the vertical intercept. We can easily turn it into slope-intercept form by isolating \( y \):
\[\begin{aligned}y-y_0 &=m(x-x_0)\\ y &=m(x-x_0)+y_0\\ &=mx+(y_0-mx_0)\text.\end{aligned}\]
If a function cannot be written in the form \( f(x)=mx+b \) for some \( m \) and \( b \), we call it a nonlinear function. Unsurprisingly, this means that its graph will not be a straight line. For example, in the Explore activity, we used our linear model for ticket demand to compute the revenue earned by selling tickets at a given price \( p \).
You may notice that we haven't talked yet about relationships between changes, such as rates or slopes, for a nonlinear model. It turns out there's a lot more that goes into figuring out how to make these ideas meaningful for nonlinear functions — and that's precisely what we're going to do in the next lesson.
For each \( y=f(x) \), find \( \Delta x \) and \( \Delta y \) as \( x \) makes the given change.
\( f(x)=${line} \), from \( x=${a} \) to \( x=${b} \)
\( \Delta x= \)
\( \Delta y= \)
Solution
\[\begin{aligned}\Delta x &= x\tsub{final}-x\tsub{initial}\\ &=${b}-${parenthesize_negative(a)}\\ &=\boxed{${dx}}\\[2 ex] \Delta y &= f(${b})-f(${a})\\ &=${fb}-${parenthesize_negative(fa)}\\ &=\boxed{${dy}}\end{aligned}\]
\( f(x)=x^{${n}} \), from \( x=${a} \) to \( x=${b} \)
\( \Delta x= \)
\( \Delta y= \)
Solution
\[\begin{aligned}\Delta x &= x\tsub{final}-x\tsub{initial}\\ &=${b}-${parenthesize_negative(a)}\\ &=\boxed{${dx}}\\[2 ex] \Delta y &= f(${b})-f(${a})\\ &=${fb}-${parenthesize_negative(fa)}\\ &=\boxed{${dy}}\end{aligned}\]
\( f(x)=${c}x^{${n}} \), from \( x=${a} \) to \( x=${b} \)
\( \Delta x= \)
\( \Delta y= \)
Solution
\[\begin{aligned}\Delta x &= x\tsub{final}-x\tsub{initial}\\ &=${b}-${parenthesize_negative(a)}\\ &=\boxed{${dx}}\\[2 ex] \Delta y &= f(${b})-f(${a})\\ &=${fb}-${parenthesize_negative(fa)}\\ &=\boxed{${dy}}\end{aligned}\]
\( f(x)=${y0} \), from \( x=${a} \) to \( x=${b} \)
\( \Delta x= \)
\( \Delta y= \)
Solution
\[\begin{aligned}\Delta x &= x\tsub{final}-x\tsub{initial}\\ &=${b}-${parenthesize_negative(a)}\\ &=\boxed{${dx}}\\[2 ex] \Delta y &= f(${b})-f(${a})\\ &=${y0}-${parenthesize_negative(y0)}\\ &=\boxed{0}\end{aligned}\]
Find the equation in slope-intercept form (\( y=mx+b \)) of the line that fits each of the following descriptions.
Has a slope of \( ${slope} \) and a vertical intercept of \( ${intercept} \)
\( y= \)
Solution
In slope-intercept form, the coefficient of \( x \) is the slope and the constant term is the vertical intercept. Substituting the given values into \( y=mx+b \) gives
\[y=\boxed{${line}}\text.\]
Has a slope of \( ${slope} \) and passes through the point \( (${a},${b}) \)
\( y= \)
Solution
Using the given point and slope, we first write the equation in point-slope form and then solve for \( y \):
\[\begin{aligned}y-${parenthesize_negative(b)} &= ${slope}(x-${parenthesize_negative(a)})\\ y &= \boxed{${line}}\text.\end{aligned}\]
Passes through the points \( (${a},${b}) \) and \( (${c},${d}) \)
\( y= \)
Solution
First, the slope between the two points is
\[m=\frac{${d}-${parenthesize_negative(b)}}{${c}-${parenthesize_negative(a)}}=${slope}\text.\]
Using the point \( (${a},${b}) \), we write the equation in point-slope form and then solve for \( y \):
\[\begin{aligned}y-${parenthesize_negative(b)} &= ${slope}(x-${parenthesize_negative(a)})\\ y &= \boxed{${line}}\text.\end{aligned}\]
Horizontal and passes through the point \( (${a},${b}) \)
\( y= \)
Solution
A horizontal line has the same \( y \)-value at every point. Since this line passes through \( (${a},${b}) \), its equation is
\[y=\boxed{${b}}\text.\]
A basket is being lifted up the side of a building. When timing begins, the basket is already above the ground. Let \( t \) be the time in seconds since timing began, and let \( h \) be the height of the basket above the ground in feet. Selected measurements are given in the table below.
\( t \) (seconds) \( 0 \) \( 1 \) \( 4 \) \( 6 \) \( h \) (feet) \( ${h1} \) \( ${h2} \) \( ${h3} \) \( ${h4} \) Find the values of \( \Delta h \) and \( \displaystyle \frac{\Delta h}{\Delta t} \) for each time interval.
\( t \) \( [0,1] \) \( [1,4] \) \( [4,6] \) \( \Delta h \) \( \displaystyle \frac{\Delta h}{\Delta t} \) Solution
For each interval, we subtract the initial value from the final value and then divide the change in height by the change in time:
\[\begin{aligned}0\le t\le 1:\qquad \Delta h &=${h2}-${h1}=${dh1}, & \frac{\Delta h}{\Delta t}&=\frac{${dh1}}{1-0}=${dhdt1},\\ 1\le t\le 4:\qquad \Delta h &=${h3}-${h2}=${dh2}, & \frac{\Delta h}{\Delta t}&=\frac{${dh2}}{4-1}=${dhdt2},\\ 4\le t\le 6:\qquad \Delta h &=${h4}-${h3}=${dh3}, & \frac{\Delta h}{\Delta t}&=\frac{${dh3}}{6-4}=${dhdt3}\text.\end{aligned}\]
Is \( h \) a linear function of \( t \)?
Solution
The rates of change over the three intervals are \( ${dhdt1} \), \( ${dhdt2} \), and \( ${dhdt3} \) feet per second. These rates ${"are" if linear else "are not"} all equal, so \( h \) is ${"a linear" if linear else "not a linear"} function of \( t \).
What are the units of the rate of change \( \Delta h/\Delta t \)?
Solution
Since \( h \) is measured in feet and \( t \) is measured in seconds,
\[\qty[\frac{\Delta h}{\Delta t}]=\frac{\text{feet}}{\text{seconds}}=\boxed{\text{feet per second}.}\]
Which statement best interprets the rate of change \( \Delta h/\Delta t=${dhdt2} \) over the interval \( 1\le t\le 4 \)?
Solution
The rate \( \Delta h/\Delta t=${dhdt2} \) means that between \( t=1 \) and \( t=4 \), the basket's height increased at an average rate of \( ${dhdt2} \) feet for each second that passed.
Use the given rate of change to find the requested initial or final value in each situation.
A candle is initially \( ${initial_height} \) centimeters tall. Its height decreases at a constant rate of \( ${burn_rate} \) centimeters per hour. How tall is the candle after \( ${hours} \) hours?
\( h\tsub{final}= \) centimeters
Solution
Let \( h \) be the candle's height in centimeters and \( t \) be the time in hours. Since the height decreases, its rate of change is \[\frac{\Delta h}{\Delta t}=-${burn_rate}\text{ centimeters per hour.}\] Since \( \Delta h=-${burn_rate}\Delta t \), we have
\[\begin{aligned}h\tsub{final}-h\tsub{initial} &= -${burn_rate}(t\tsub{final}-t\tsub{initial})\\ h\tsub{final}-${initial_height} &= -${burn_rate}(${hours}-0)\\ h\tsub{final} &= \boxed{${final_height}\text{ centimeters}.}\end{aligned}\]
A young tree grows at a constant rate of \( ${growth_rate} \) meters per year. After \( ${years} \) years, it is \( ${final_tree_height} \) meters tall. How tall was the tree at the beginning of this period?
\( H\tsub{initial}= \) meters
Solution
Let \( H \) be the tree's height in meters and \( t \) be the time in years. Its rate of change is \[\frac{\Delta H}{\Delta t}=${growth_rate}\text{ meters per year.}\] Since \( \Delta H=${growth_rate}\Delta t \), we have
\[\begin{aligned}H\tsub{final}-H\tsub{initial} &= ${growth_rate}(t\tsub{final}-t\tsub{initial})\\ ${final_tree_height}-H\tsub{initial} &= ${growth_rate}(${years}-0)\\ H\tsub{initial} &= \boxed{${initial_tree_height}\text{ meters}.}\end{aligned}\]
In a certain part of the ocean, the water temperature decreases by \( ${degrees_per_100m}\degree\text{C} \) for every \( 100 \)-meter increase in depth. At a depth of \( ${initial_depth} \) meters, the temperature is \( ${initial_temperature}\degree\text{C} \). At what depth would the temperature be \( ${final_temperature}\degree\text{C} \)?
\( d\tsub{final}= \) meters
Solution
Let \( T \) be the temperature in degrees Celsius and \( d \) be the depth in meters. Since the temperature decreases as the depth increases, its rate of change is \[\frac{\Delta T}{\Delta d}=${temperature_rate}\text{ degrees Celsius per meter.}\] Since \( \Delta T=${temperature_rate}\Delta d \), we have
\[\begin{aligned}T\tsub{final}-T\tsub{initial} &= ${temperature_rate}(d\tsub{final}-d\tsub{initial})\\ ${final_temperature}-${initial_temperature} &= ${temperature_rate}(d\tsub{final}-${initial_depth})\\ d\tsub{final} &= \boxed{${final_depth}\text{ meters}.}\end{aligned}\]
Over a certain range, a farm's expected wheat harvest increases at a constant rate of \( ${yield_rate} \) bushels for each additional acre planted. When the planted area reaches \( ${final_acres} \) acres, the expected harvest is \( ${final_yield} \) bushels. Earlier, the expected harvest was \( ${initial_yield} \) bushels. How many acres had been planted at that time?
\( A\tsub{initial}= \) acres
Solution
Let \( Y \) be the expected harvest in bushels and \( A \) be the planted area in acres. Its rate of change is \[\frac{\Delta Y}{\Delta A}=${yield_rate}\text{ bushels per acre.}\] Since \( \Delta Y=${yield_rate}\Delta A \), we have
\[\begin{aligned}Y\tsub{final}-Y\tsub{initial} &= ${yield_rate}(A\tsub{final}-A\tsub{initial})\\ ${final_yield}-${initial_yield} &= ${yield_rate}(${final_acres}-A\tsub{initial})\\ A\tsub{initial} &= \boxed{${initial_acres}\text{ acres}.}\end{aligned}\]
Suppose your shop sells sandwiches for a price of \( \$ ${p0} \) each. Every week, you sell \( ${q0} \) sandwiches. You estimate that your demand follows a linear model, so that for each extra \( \$0.10 \) that you charge, \( ${dq} \) fewer sandwiches would be sold at your shop.
How much revenue are you making per week right now?
\( R= \$ \)
Solution
The total revenue is \( \$ ${p0} \cdot ${q0} = \$ ${p0 * q0} \).
According to your model, if you were to charge \( \$ ${p0+1} \) for your sandwiches, how many sandwiches would you likely sell each week, and how much revenue would you make?
\( q= \) sandwiches
\( R=\$ \)
Solution
This is equivalent to ten increases of \( \$0.10 \) each, so you should expect that the quantity demanded will go down by \( ${dq*10} \). Hence you would expect \[${q0}-${-slope}=${q0+slope}\] sandwiches to be sold each week.
Multiplying price by quantity, you would expect your revenue to be \[\$ ${p0+1} \cdot ${q0+slope} = \$ ${(p0 + 1) * (q0 + slope)}\text.\]
Write a linear function \( q(p) \) for the number of sandwiches demanded weekly at a given price \( p \).
\( q(p)= \)
Solution
One way to set up your linear model is to use point-slope form of a line, knowing that the slope is \( ${slope} \):
\[\begin{aligned}q-${q0} &= ${slope}(p-${p0})\\ q &= ${slope}(p-${p0})+${q0}\\ q &= ${slope}p+${intercept}\text.\end{aligned}\]
Write a quadratic function \( R(p) \) for the total revenue you would make each week by selling your sandwiches at a given price \( p \).
\( R(p)= \)
Solution
Again using the fact that \[\text{Revenue} = \text{Price}\cdot\text{Quantity,}\] we have the following:
\[\begin{aligned}R(p)&=p\cdot q(p)\\ &= p\cdot(${slope}p+${intercept})\\ &= ${slope}p^2+${intercept}p\text.\end{aligned}\]