 # Calculus for Biological Scientists

## Section1.2Functions

Functions are a core concept in the study of calculus. In this section we outline common representations of functions and some general properties that we will use throughout future sections.

### Warm-Up1.2.1.

Consider the following equations:
1. $$\displaystyle y = x + 1$$
2. $$\displaystyle y^2 = x +1$$
For each equation above, fill in the following tables:

### Subsection1.2.1Functions and their Representations

Understanding systems is all about being able to describe the relationship between the quantities involved. The population of a species is related to time, the energy an animal exerts when running is related to its speed, and the growth of a plant is related to its exposure to sunlight. Equations, tables, and graphs are all mathematical objects that help us represent relationships between quantities, and it is beneficial to be able to represent a single relationship in multiple different ways.
The systems we are typically interested in are a special type of relationship called a function:

#### Definition1.2.1.Function.

Given two related quantities $$x$$ and $$y\text{,}$$ we say $$y$$ is a function of $$x$$ if every $$x$$ value in the relationship is related to exactly one $$y$$ value.
Using this terminology with our previous illustrations, we would say a population is a function of time, energy is a function of speed, and the height of a plant is a function of sunlight exposure. Notice that there is an ordering implied when we talk about function relationships. When we say “$$y$$ is a function of $$x$$”, we call $$x$$ the input (or independent variable) and $$y$$ the output (or dependent variable).

#### Example1.2.2.

Looking at Warm-Up 1.2.1, one equation represents $$y$$ as a function of $$x$$ and one does not.
1. In $$y = x+1\text{,}$$ $$y$$ is a function of $$x\text{.}$$ Our reasoning will sound different depending on whether you are looking at the equation, table, or graph, but in all cases our reasoning is based on Definition 1.2.1:
• Equation: For an $$x$$ value, the corresponding $$y$$ value is obtained by adding one. This gives a unique $$y$$ value for every $$x$$ value.
• Table: Every $$x$$ value in the table is listed exactly once. This means each $$x$$ value in the table is associated with exactly one $$y$$ value.
Warning: When relationships are represented via tables, it is possible you have limited information about the relationship. Unless you are told that the table shows every $$x,y$$ pair in the relationship, you should assume there may be other $$x,y$$ pairs in the relationship not listed in the table.
• Graph: If you pick an $$x$$ value and draw a vertical line at that $$x$$ value, you will intersect the graph exactly once. This means each $$x$$ value corresponds to exactly one $$y$$ value. This is known as the vertical line test to determine if the graph of a relationship represents a function relationship.
2. In $$y^2 = x+1\text{,}$$ $$y$$ is not a function of $$x\text{.}$$ Our reasoning will sound different depending on whether you are looking at the equation, table, or graph, but in all cases our reasoning is based on Definition 1.2.1:
• Equation: For an $$x$$ value, the corresponding $$y$$ value is obtained by the rule $$\pm \sqrt{x+1}\text{.}$$ This means that when $$x=0\text{,}$$ for example, the associated $$y$$ values are $$\pm 1\text{.}$$ This means there is an $$x$$ value associated to more than one $$y$$ value, and so this relationship is not a function.
• Table: There are $$x$$ values in the table listed more than once, and associated with different $$y$$ values. This means there are $$x$$ values in the relationship associated with more than one $$y$$ value.
• Graph: You can pick an $$x$$ value and draw a vertical line at that $$x$$ value such that you intersect the graph more than once. This means you have found an $$x$$ value which corresponds to more than one $$y$$ value. This is known as the vertical line test to determine if the graph of a relationship represents a function relationship.

#### Activity1.2.2.Function Relationships.

1. In the equation $$y^2 = x+1\text{,}$$ is $$x$$ a function of $$y\text{?}$$
2. Is student height a function of student name?
3. For each graph below, is $$y$$ a function of $$x\text{?}$$
• • • The graphs in Activity 1.2.2 are very similar, but they all represent different relationships. Of those that are functions, they differ in their domain and range, which we define below:

#### Definition1.2.3.Domain and Range.

• The domain of a function is the set of all possible input values.
• The range of a function is the set of all possible output values.

#### Remark1.2.4.

The domain of a function is typically determined by one or more of the following:
• Operations: There may be operations used to define a function which are undefined for specific inputs. For example, in $$y=\frac{1}{x}\text{,}$$ $$x=0$$ is not in the domain because the operation of division by $$0$$ is not defined.
• Context: When a function is used as a model, there may be some input values that don’t make sense for what the function represents. For example, if height is a function of time given by $$h = t^2\text{,}$$ negative $$t$$ values are not in the domain even though operationally the function is defined for negative $$t$$ values.

### Subsection1.2.2Explicit and Recursive Functions

When given a function relationship, there are two main ways we might express that relationship:
1. Explicit Function: An explicit function describes the output (or dependent variable) explicitly in terms of the input (or independent variable). For example, $$y=x+1$$ is an explicit function. However, moving forward we will most often write explicit functions using function notation, which means we write the output (dependent variable) as $$f(x)$$ instead of $$y\text{.}$$ The function $$y=x+1$$ is written using function notation as $$f(x) = x+1\text{.}$$ Note that we may name the function whatever we’d like (it does not have to be “$$f$$”). For example, if the output was “population” and the input was “time”, we might call our function $$p(t)\text{.}$$
2. Recursive Function: A recursive function is typically used when modeling discrete systems, and describes the next output (or dependent variable) in terms of the current output (or dependent variable). For example, $$p_{t+1} = p_t +2$$ is a recursive function. In words, this function says “the next output is equal to the current output plus two.” Notice that this relationship does have an independent variable $$t\text{,}$$ it is just not used in describing the relationship like in an explicit function.

### Subsection1.2.3Variables and Parameters

As illustrated in Exercise 1.1.4.2, modeling real systems typically involves representing quantities with letters and numbers. It is important that we know how to interpret the letters that we see in function representations.

#### Definition1.2.5.Variable and Parameter.

• A variable represents a quantity that can change in a fixed model.
• A parameter represents a quantity that is constant in a fixed model.

#### Example1.2.6.Variables and Parameters.

The function $$h(t)=mt+b$$ describes a relationship whose graph looks like a straight line. One benefit of using function notation is that it clearly indicates to us which letters represent variables. The notation “$$h(t)$$” tells us that $$t$$ is the input (or independent variable), and $$h(t)$$ is the output (or dependent variable). This means that for a fixed line, the input value $$t$$ can change, and $$h(t)$$ changes along with it.
Once we identify the independent and dependent variable, every other letter represents a parameter. In this example, $$m$$ and $$b$$ are parameters. This means that for a fixed line, $$m$$ and $$b$$ are constant values.
One benefit of using parameters is that it allows us to describe many models at once, and we can then analyze how a specific system behaves based on its parameter values.

### Subsection1.2.4Combinations of Functions

Just as there are ways to combine two numbers to get a new number, we can also combine two functions to get a new function. Given two functions $$g(x)$$ and $$k(x)\text{,}$$ we can define the following combinations:

#### Definition1.2.7.Combining Functions.

• Sum: $$(g+k)(x) = g(x) + k(x)$$
• Difference: $$(g-k)(x) = g(x) - k(x)$$
• Product: $$(g\cdot k)(x) = g(x) \cdot k(x)$$
• Quotient: $$\left(\dfrac{g}{k}\right)(x) = \dfrac{g(x)}{k(x)}$$
• Composition: $$(g \circ k)(x) = g(k(x))$$

#### Example1.2.8.Combining Functions.

Let $$f(x) = x^2 +1$$ and $$g(x)=2x - 3\text{.}$$
• \begin{align*} (f+g)(x) \amp= f(x) + g(x) \\ \amp= (x^2+1) + (2x-3) \\ \amp= x^2 + 2x -2 \end{align*}
•  1
\begin{align*} (f-g)(x) \amp= f(x) - g(x) \\ \amp= (x^2+1) - (2x-3) \\ \amp= x^2 - 2x +4 \end{align*}
• \begin{align*} (f \cdot g)(x) \amp= f(x) \cdot g(x) \\ \amp= (x^2+1) \cdot (2x-3) \\ \amp= 2x^3- 3x^2 + 2x -3 \end{align*}
• \begin{align*} \left(\dfrac{f}{g}\right)(x) \amp= \dfrac{f(x) }{ g(x)} \\ \amp= \dfrac{(x^2+1)}{ (2x-3)} \end{align*}
• \begin{align*} (f \circ g)(x) \amp= f(g(x)) \\ \amp= g(x)^2+1 \\ \amp= (2x-3)^2 +1\\ \amp= 4x^2-12x+10 \end{align*}
• \begin{align*} (g \circ f)(x) \amp= g(f(x)) \\ \amp= 2f(x)-3 \\ \amp= 2(x^2+1)-3\\ \amp= 2x^2 -1 \end{align*}
Composition is a way to combine functions that we cannot do with numbers, and allows us to “chain” multiple relationships together.

#### Activity1.2.3.Composition.

Let $$m(w)$$ be the number of mosquitos entering a house if $$w$$ windows are open, and $$b(m)$$ be the number of mosquito bites someone gets if there are $$m$$ mosquitos in a house.
1. In this context, which composition makes sense: $$b \circ m$$ or $$m \circ b\text{?}$$
2. In words, what relationship does the composition that makes sense describe?

### Subsection1.2.5Inverse Functions

We noticed in Definition 1.2.1 that there is an order implied in a function relationship. Depending on the question you would like to answer, the ordering of the function may or may not be desirable. For example, if you had a model where population was a function of time, and you wanted to know when the population would reach $$1,000\text{,}$$ this ordering would be desirable. However, if the population was decreasing and you wanted to know after how many years the population would become extinct, it may be desirable to have a model expressing time as a function of population. The property of being able to switch input and output and still have a function relationship is what we define below:

#### Definition1.2.9.Inverse Function.

Let $$f(x)=y$$ be a function of $$x\text{.}$$ If $$x$$ is also a function of $$y\text{,}$$ we say that $$f$$ is invertible. We denote $$x$$ as a function of $$y$$ as $$f^{-1}\text{,}$$ and call it the inverse function of $$f$$.

#### Example1.2.10.Inverse Functions as Graphs. To determine if this function has an inverse function, we must determine if the relationship obtained by swapping input and output is also a function. We can test this directly on the graph of $$f$$ by remembering the vertical line test used in Example 1.2.2, and thinking about how vertical lines change when we swap input and output.
A vertical line in the $$x,y$$ plane is a line whose points have a constant $$x$$ value. For example, the points $$(1,0), (1,1), (1,2), (1,3)$$ all lie on the vertical line $$x=1\text{.}$$ When we swap input and output, those points become $$(0,1), (1,1), (2,1), (3,1)$$ , which all lie on the horizontal line $$y=1\text{.}$$ So we can determine if the function $$f$$ is invertible by drawing horizontal lines on the graph of $$f\text{.}$$ If every horizontal line intersects the graph at most once, then $$f$$ is invertible. Otherwise, the function $$f$$ is not invertible.
This is known as the horizontal line test for testing invertibility. In this example we see the function is invertible, and we can visualize the graph of $$f^{-1}$$ by reflecting the graph of $$f$$ over the diagonal line $$y=x\text{:}$$ #### Example1.2.11.Inverse Functions as Equations.

• Let $$f(x)= 3x + 1\text{.}$$ If $$f$$ has an inverse function, $$x$$ would be the output and $$f(x)$$ would be the input. As an equation, this means we will try to re-write the function relationship as “$$x=$$”. For notational purposes, before we start the computation we’ll write the function as $$y=3x+1$$ instead of using function notation.
\begin{align*} y \amp=3x+1\\ y-1 \amp= 3x\\ \dfrac{y-1}{3}\amp= x\\ x \amp= \dfrac{y-1}{3} \end{align*}
This shows us that $$f$$ is invertible, and also what the rule is for the inverse function. Instead of using $$x$$ as the output variable, we switch back to the standard notation and write $$f^{-1}$$ as a function of $$x\text{:}$$ $$f(x)=3x+1$$ and $$f^{-1}(x) = \dfrac{x-1}{3}\text{.}$$
• Let $$g(x) = x^2 + 1\text{.}$$ We’ll try the same process as above to determine if there is an inverse function, $$g^{-1}\text{.}$$
\begin{align*} y \amp= x^2+1\\ y -1 \amp= x^2\\ \pm \sqrt{y -1} \amp= x\\ x \amp= \pm \sqrt{y -1} \end{align*}
Note that $$x$$ is not a function of $$y\text{,}$$ and so our original function $$g(x)$$ is not invertible.
Invertible functions and their inverse functions have a special property under composition. As illustrated in Example 1.2.8, the order of composition matters. That is, for two functions $$f(x)$$ and $$g(x)\text{,}$$ the compositions $$f(g(x))$$ and $$g(f(x))$$ are, in general, different. However, composition with an invertible function and its inverse function is an example of a special case when the order does not matter. Even more, the composition will always result in the same function:

### Subsection1.2.6Average Rate of Change

We mentioned in Section 1.1 that a main goal in mathematical modeling is to study how systems change. Given a function, one way we can describe how the function changes over time is by computing an average rate of change. This is also a foundational concept that will be used to extend our tools for describing change in Chapter 2.

#### Definition1.2.13.Average Rate of Change.

Given a function $$f(x)$$ and $$x$$ values $$a$$ and $$b\text{,}$$ the average rate of change between $$a$$ and $$b$$ is the number
\begin{equation*} AROC_{[a,b]}= \dfrac{f(b) - f(a)}{b-a}\text{.} \end{equation*}
Being able to compute an average rate of change is necessary, but understanding what an average rate of change represents graphically will be even more important for our future developments in describing how functions change. Use the interactive provided to complete the statements below before viewing the answers.
1. The value of $$AROC_{[-3,2]}$$ is Answer.
1
2. The line connecting the points $$(-3,f(-3))$$ and $$(2,f(2))$$ (increases/decreases/stays the same). Answer.
increases
3. The value of $$AROC_{[-1,1]}$$ is Answer.
-1.5
4. The line connecting the points $$(-1,f(-1))$$ and $$(1,f(1))$$ (increases/decreases/stays the same). Answer.
decreases
5. The value of $$AROC_{[-2,2]}$$ is Answer.
0
6. The line connecting the points $$(-2,f(-2))$$ and $$(2,f(2))$$ (increases/decreases/stays the same). Answer.
stays the same
7. Graphically, the value of $$AROC_{[a,b]}$$ describes Answer.
whether the line connecting the two points $$(a,f(a))$$ and $$(b,f(b))$$ increases, decreases, or stays the same. Further, the larger the average rate of change is in absolute value, the steeper the line will increase or decrease. The line connecting the two points is called the secant line.

#### Activity1.2.4.AROC.

1. Sketch the graph of a function $$f$$ such that $$AROC_{[0,2]} \gt 0$$ and $$f$$ is increasing on the interval $$(0,2)\text{.}$$
2. Sketch the graph of a function $$f$$ such that $$AROC_{[0,2]} \gt 0$$ and $$f$$ increases and decreases on the interval $$(0,2)\text{.}$$
3. Sketch the graph of a function $$f$$ such that $$AROC_{[0,2]} \gt 0$$ and $$f$$ is decreasing on the interval $$(0,2)\text{.}$$

### Subsection1.2.7Summary

• #### Question1.2.14.

What makes a relationship a function?
A quantity $$y$$ is a function of a quantity $$x$$ when each $$x$$ value is associated with exactly one $$y$$ value.
• #### Question1.2.15.

What are different ways we can describe a function?
We can describe function relationships using equations, tables, and graphs. Function relationships can also be described explicitly or recursively.
• #### Question1.2.16.

What does it mean when there are letters in a model?
A letter in function may represent a variable (a changing quantity) or a parameter ( a constant quantity). Function notation is useful for helping us recognize the variables in a model.
• #### Question1.2.17.

What are different ways that we can combine functions?
We can combine functions like numbers using addition, subtraction, multiplication, and division. We can also put functions inside of other functions using composition.
• #### Question1.2.18.

What does it mean for a function to be invertible?
A function is invertible if swapping domain and range results in another function relationship.
• #### Question1.2.19.

How can we describe how a function changes over time?
We can describe how a function changes over a specific time interval by computing the average rate of change over that time interval. Graphically, this number tells us the steepness of the secant line connecting the two end points, and if the secant line is increasing or decreasing.

### Exercises1.2.8Exercises

#### 1.

Give an example of a relationship in which $$y$$ is not a function of $$x\text{.}$$ Represent your example as an equation, table, and graph.

#### 2.

Give an example of a relationship in which $$y$$ is a function of $$x$$ but is not an invertible function. Represent your example as an equation, table, and graph.

#### 3.

Consider the equation $$h= kt^2 -m^2t + cm\text{.}$$
1. Write the equation using function notation if $$t$$ is the independent variable and $$h$$ is the dependent variable. What are the parameters?
2. Write the equation using function notation if $$m$$ is the independent variable and $$h$$ is the dependent variable. What are the parameters?

#### 4.

1. Sketch the graph of a single function $$q(x)$$ that meets all of the following criteria:
• The domain of $$q(x)$$ is $$[-1,0) \cup (0,4]\text{.}$$
Note: This notation means the domain is between $$-1$$ and $$4\text{,}$$ not including $$0\text{.}$$
• The range of $$q(x)$$ is $$[0,3]\text{.}$$
• $$q(-1) > q(4)\text{.}$$
2. Is your function from the previous part invertible? Explain why or why not.

#### 5.

The functions $$g(x)$$ and $$h(x)$$ are defined on the domain $$(-\infty, \infty)\text{.}$$ Compute the following values given that
• $$g(-1)=2$$ and $$h(-1)=-10\text{,}$$ and
• $$g(x)$$ and $$h(x)$$ are inverse functions of each other (i.e., $$g(x)=h^{-1}(x)$$ and $$h(x) = g^{-1}(x)$$).
1. $$\displaystyle (g+h)(-1)$$
2. $$\displaystyle (g-h)(-1)$$
3. $$\displaystyle (g \cdot h)(-1)$$
4. $$\displaystyle (h \circ g)(-10)$$
5. $$\displaystyle (g \circ h)(5)$$

#### 6.

Let $$\sigma(x) = x^2 +1\text{.}$$ Calculate each average rate of change below. Then use the graph provided to illustrate what each calculation represents graphically.
1. $$\displaystyle AROC_{[0,3]}$$
2. $$\displaystyle AROC_{[-2,2]}$$
3. $$\displaystyle AROC_{[-3,1]}$$ Note the importance in using parentheses!