$\require{cancel}\newcommand\degree{^{\circ}} \newcommand\Ccancel[black]{\renewcommand\CancelColor{\color{#1}}\cancel{#2}} \newcommand{\alert}{\boldsymbol{\color{magenta}{#1}}} \newcommand{\blert}{\boldsymbol{\color{blue}{#1}}} \newcommand{\bluetext}{\color{blue}{#1}} \delimitershortfall-1sp \newcommand\abs{\left|#1\right|} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&}$

## SectionFunctions

###### Supplemental Videos

The main topics of this section are also presented in the following videos:

### SubsectionThe Definition of Function

We often want to predict values of one variable from the values of a related variable. For example, when a physician prescribes a drug in a certain dosage, she needs to know how long the dose will remain in the bloodstream. A sales manager needs to know how the price of his product will affect its sales. A function is a special type of relationship between variables that allows us to make such predictions.

Suppose it costs $800 for flying lessons, plus$130 per hour to rent a plane. If we let $C$ represent the total cost for $t$ hours of flying lessons, then

\begin{equation*} C=800+130t ~~~~ (t\ge 0) \end{equation*}

Thus, for example

 when $t=\alert{0}\text{,}$ $C=800+130(\alert{0})=800$ when $t=\alert{4}\text{,}$ $C=800+130(\alert{4})=1320$ when $t=\alert{10}\text{,}$ $C=800+130(\alert{10})=2100$

The variable $t$ is called the input or independent variable, and $C$ is the output or dependent variable, because its values are determined by the value of $t\text{.}$ We can display the relationship between two variables by a table or by ordered pairs. The input variable is the first component of the ordered pair, and the output variable is the second component.

 $t$ $C$ $(t,C)$ $0$ $800$ $(0, 800)$ $4$ $1320$ $(4, 1320)$ $10$ $2100$ $(10,2100)$

For this relationship, we can find the value of $C$ for any given value of $t\text{.}$ All we have to do is substitute the value of $t$ into the equation and solve for $C\text{.}$ Note that there can be only one value of $C$ for each value of $t\text{.}$

###### Definition of Function

A function is a relationship between two variables for which a unique value of the output variable can be determined from a value of the input variable. In other words, a function is relation in which every input corresponds to exactly one output.

What distinguishes functions from other variable relationships? The definition of a function calls for a unique value that is, exactly one value of the output variable corresponding to each value of the input variable. This property makes functions useful in applications because they can often be used to make predictions.

###### Example1
1. The distance, $d\text{,}$ traveled by a car in 2 hours is a function of its speed, $r\text{.}$ If we know the speed of the car, we can determine the distance it travels by the formula $d = r \cdot 2\text{.}$

2. The cost of a fill-up with unleaded gasoline is a function of the number of gallons purchased. The gas pump represents the function by displaying the corresponding values of the input variable (number of gallons) and the output variable (cost).

3. Score on the Scholastic Aptitude Test (SAT) is not a function of score on an IQ test, because two people with the same score on an IQ test may score differently on the SAT; that is, a person's score on the SAT is not uniquely determined by his or her score on an IQ test.

1. As part of a project to improve the success rate of freshmen, the counseling department studied the grades earned by a group of students in English and algebra. Do you think that a student's grade in algebra is a function of his or her grade in English? Explain why or why not.

2. Phatburger features a soda bar, where you can serve your own soft drinks in any size. Do you think that the number of calories in a serving of Zap Kola is a function of the number of fluid ounces? Explain why or why not.

A function can be described in several different ways. In the following examples, we consider functions defined by tables, by graphs, and by equations.

### SubsectionFunctions Defined by Tables

When we use a table to describe a function, unless stated otherwise the first variable in the table (the left column of a vertical table or the top row of a horizontal table) is the input variable, and the second variable is the output. We say that the output variable is a function of the input.

###### Example3
1. Table4 shows data on sales compiled over several years by the accounting office for Eau Claire Auto Parts, a division of Major Motors. In this example, the year is the input variable, and total sales is the output. We can see that it is a function since each input (year) corresponds to exactly one output (total sales). We say that total sales is a function of the year, or $S\text{,}$ is a function of $t\text{.}$

2. Table5 gives the cost of sending printed material by first-class mail in 2016.

###### Example21

When you exercise, your heart rate should increase until it reaches your target heart rate. The table shows target heart rate, $r = f(a)\text{,}$ as a function of age.

 $a$ $20$ $25$ $30$ $35$ $40$ $45$ $50$ $55$ $60$ $65$ $70$ $r$ $150$ $146$ $142$ $139$ $135$ $131$ $127$ $124$ $120$ $116$ $112$

1. Find $f(25)$ and $f(50)\text{.}$

2. Find a value of $a$ for which $f(a) = 135\text{.}$

Solution
1. $f (25) = 146, ~~f (50) = 127$

2. $a = 40$

If a function is described by an equation, we simply substitute the given input value into the equation to find the corresponding output, or function value.

###### Example22

The function $f$ is defined by $f(s) = \dfrac{\sqrt{s+3}}{s}\text{.}$ Evaluate the function at the following values.

1. $s=6$

2. $s=-1$

Solution
1. $f(\alert{6})=\dfrac{\sqrt{\alert{6}+3}}{\alert{6}}= \dfrac{\sqrt{9}}{6}=\dfrac{3}{6}=\dfrac{1}{2}\text{.}$ Thus, $f(6)=\dfrac{1}{2}\text{.}$

2. $f(\alert{-1})=\dfrac{\sqrt{\alert{-1}+3}}{\alert{-1}}= \dfrac{\sqrt{2}}{-1}=-\sqrt{2}\text{.}$ Thus, $f(-1)=-\sqrt{2}\text{.}$

###### Example23

Complete the table displaying ordered pairs for the function $f(x) = 5 - x^3\text{.}$ Evaluate the function to find the corresponding $f(x)$-value for each value of $x\text{.}$

 $x$ $f(x)$ $-2$  $f(\alert{-2})=5-(\alert{-2})^3=~$ $0$  $f(\alert{0})=5-\alert{0}^3=$ $1$  $f(\alert{1})=5-\alert{1}^3=$ $3$  $f(\alert{3})=5-\alert{3}^3=$
Solution
 $x$ $f(x)$ $-2$ $\alert{13}$ $0$ $\alert{5}$ $1$ $\alert{4}$ $3$ $\alert{-22}$
###### Technology24Evaluating a Function

We can use the table feature on a graphing calculator to evaluate functions. Consider the function of Example23, $f(x) = 5 - x^3\text{.}$

Press Y=, clear any old functions, and enter

$\qquad Y_1=5-X$ ^ $3$

Then press TblSet (2nd WINDOW) and choose Ask after Indpnt, as shown in Figure25, and press ENTER. This setting allows you to enter any $x$-values you like. Next, press TABLE (using 2nd GRAPH).

To follow Example23, key in (-) 2 ENTER for the $x$-value, and the calculator will fill in the $y$-value. Continue by entering 0, 1, 3, or any other $x$-values you choose. One such table is shown in Figure26.

If you would like to evaluate a new function, you do not have to return to the Y= screen. Use the $\boxed{\rightarrow}$ and $\boxed{\uparrow}$ arrow keys to highlight $Y_1$ at the top of the second column. The definition of $Y_1$ will appear at the bottom of the display, as shown in Figure26. You can key in a new definition here, and the second column will be updated automatically to show the $y$-values of the new function.  To simplify the notation, we sometimes use the same letter for the output variable and for the name of the function. In the next example, $C$ is used in this way.

###### Example27

TrailGear decides to market a line of backpacks. The cost, $C\text{,}$ of manufacturing backpacks is a function of the number, $x\text{,}$ of backpacks produced, given by the equation

\begin{equation*} C(x) = 3000 + 20x \end{equation*}

where $C(x)$ is measured in dollars. Find the cost of producing 500 backpacks.

Solution

To find the value of $C$ that corresponds to $x = \alert{500}\text{,}$ evaluate $C(500)\text{.}$

The cost of producing 500 backpacks is \$13,000.

###### Example28

The volume of a sphere of radius $r$ centimeters is given by

\begin{equation*} V = V(r) = \frac{4}{3}\pi r^3 \end{equation*}

Evaluate $V(10)$ and explain what it means.

Solution

$V(10) = 4000\pi/3\approx 4188.79 \text{ cm}^3$ is the volume of a sphere whose radius is $10$ cm.

### SubsectionThe Vertical Line Test

Before completing this section we turn again to the definition of a function in order to develop one very powerful tool for deciding if a relation is a function. Recall the definition of a function.

###### Definition of Function

A function is a relationship between two variables for which a unique value of the output variable can be determined from a value of the input variable. In other words, a function is relation in which every input corresponds to exactly one output.

One way of thinking about this definition is that in a function, two different outputs cannot be related to the same input. This restriction means that two different ordered pairs cannot have the same first coordinate. What does it mean for the graph of the function?

Consider the graph shown in Figure29a. Every vertical line intersects the graph in at most one point, so there is only one point on the graph for each $x$-value. This graph represents a function. In Figure29b, however, the line $x = 2$ intersects the graph at two points, $(2, 1)$ and $(2, 4)\text{.}$ Two different $y$-values, $1$ and $4\text{,}$ are related to the same $x$-value, $2\text{.}$ This graph cannot be the graph of a function.

We summarize these observations as follows.

###### The Vertical Line Test

A graph represents a function if and only if every vertical line intersects the graph in at most one point.

The following figure demonstrates how the vertical line test works. Try changing the equation (to anything with variables $x$ and $y$) and dragging the vertical line around to determine whether your equation passes the vertical line test.

###### Example31

Use the vertical line test to decide which of the graphs in Figure32 represent functions.

Solution
• Graph (a) represents a function, because it passes the vertical line test.

• Graph (b) is not the graph of a function, because the vertical line at (for example) $x = 1$ intersects the graph at two points.

• For graph (c), notice the break in the curve at $x = 2\text{:}$ The solid dot at $(2, 1)$ is the only point on the graph with $x = 2\text{;}$ the open circle at $(2, 3)$ indicates that $(2, 3)$ is not a point on the graph. Thus, graph (c) is a function, with $f(2) = 1\text{.}$

###### Example33

Use the vertical line test to determine which of the graphs in Figure34 represent functions.