1.1: Describing Relationsips Between Two Quantities with Functions
Course Goal:
To describe relationships between two quantities that change and use it to make predications and informed decisions modeling applications.
Focus: How Can We Represent a Relationship Between Two Quantities?
The natural world is full of relationships between quantities that change. Mathematics is the art of making sense of patterns and these relationships. In this setting, we may make sense of the situation by expressing the relationship between the changing quantities through words, through graphs, through data, or through a formula.
Example \(\PageIndex{1}\)
If Jaylen throws a ball upward into the air, there is a relationship between time and the height of the ball. To describe this relationship, we first need to define variables to represent each quantity. Let t represent the time in seconds since the ball was thrown and h represent height of the ball in feet.
We can represent this relationship with
- A table
| time t | 0 | 0.5 | 1 | 1.5 | 2 |
| height h | 4 | 15 | 18 | 13 | 0 |
- A graph
- A formula or an equation
\[h = -16t^2+30t+4\nonumber \]
- With words in an application
" The ball went upward after Jaylen threw before reaching its maximum height, then came dropping back down to the ground."
Notice, the graph allows us to get a quick, general idea of how the height varies relative to time over the flight of the ball. We can summarize that the ball goes upward until about 1 second then comes back down. With the formula, we are unable to quickly see how the height varies over time without evaluating the formula for height at a number of different times. However, if we need detailed information, such as what is the height at 1.5 seconds, the formula allows us to find this information exactly. With the graph, we are only able to estimate the height at 1.5 seconds. Ultimately, if we have a graph, a formula, and a table, we will be able to more accurately describe the relationship of the height of the ball over time. The ability to describe the relationship with words allows us to communicate the relationship between height and time.
Focus: Are All Relationships Well-Defined Direct Relationships?
Notice in example 1 that the ball is at exactly one height at each point in time. It is impossible for an object to be at two heights at the same time. This is an example of a well defined direct relationship that we call a function. The height is a function of (or depends on) time.
Definition: Function
A function is a well-defined direct relationship between two quantities where each input is related to exactly one output.
It is useful to think of a function as a machine, where you put one thing in (the input), the machine does something to it, and then you get one thing out (the output). The output of a function is the dependent quantity. In example 1, the height is the output since the height depends on the time since the ball was thrown. The input of a function is the independent quantity. Typically, the independent quantity is one that can be intentionally manipulated or changed in an experiment. In this example, the time is the independent quantity.
Be aware that it is possible for the ball to be at the same height at two different times. For example, the ball has a height of h = 15 ft at \(t \approx 0.5\) and \(t \approx 1.4\), In general, one output can be related to two different inputs with a function.
Example \(\PageIndex{2}\)
Consider the height of a person, h, over there lifetime.
- Is height a function of age?
Solution
In this case, the age is the input and the height is the output. It would be correct to say that height is a function of age, since each age uniquely determines a height. For example, on my 16 \({}^{th}\) birthday, I had exactly one height of 75 inches.
- Is age a function of height?
Solution
However, age is not a function of height, since one height input might correspond with more than one output age. For example, for an input height of 77 inches, there is more than one output of age since I was 77 inches at the age of 20 and 21.
Example \(\PageIndex{3}\)
At a coffee shop, a cup of coffee costs $3. A customer orders a number of cups of coffee.
- Is total price a function of the number of cups of coffee?
Solution
In this case, the number of cups of coffee is the input and the total price is the output. We could say that total price is a function of the number of items, since each number of cups corresponds to a single total price. For example, four cups of coffee costs a total of $12. In addition, we can build a table as well as develop a formula to further describe this relationship.
| Cups of coffee, C | 1 | 2 | 3 | 4 | 5 | \(C\) |
| Price, P | 3 | 6 | 9 | 12 | 15 | \(P=3C\) |
- Is the number of cups of coffee a function of the total price?
Solution
In this case, the total price is the input and the number of cups of coffee is the output. Yes, the number of items is a function of the total price, since each total cost corresponds to a single number of cups. For example, of total cost of $15 corresponds to five cups of coffee.
Is a percentage earned in a class translated to a letter grade a function?
- Answer
-
Yes it’s a function. For example, in our class an 85% would translate to a B.
Tables as Functions
Functions can be represented in many ways: words (as we did in the last few examples), tables of values, graphs, or formulas. Represented as a table, we are presented with a list of input and output values. In some cases, these values represent everything we know about the relationship, while in other cases the table is simply providing us a few select values from a more complete relationship.
Example \(\PageIndex{4}\)
Which of these tables define a function (if any)?
Table 1:
| Input, x | Output, y |
|---|---|
| 1 | 3 |
| 2 | 4 |
| 3 | 4 |
| 4 | 5 |
Table 2:
| Input, x | Output, y |
|---|---|
| 1 | 3 |
| 2 | 4 |
| 2 | 5 |
| 3 | 5 |
Solution
The first table defines a function since each input corresponds to exactly one output. Notice that even though two inputs \(x = 2\) and \(x = 3\) are related to the same output, the relationship is still a function. The second table does not define a function since the input value of \(x = 2\) corresponds with two different output values \(y = 4\) and \(y = 2\).
Graphs as Functions
Oftentimes a graph of a relationship can be used to define a function. By convention, graphs are typically created with the input quantity along the horizontal axis and the output quantity along the vertical axis. The most common graph has \(y\) on the vertical axis and \(x\) on the horizontal axis, and we say \(y\) is a function of \(x\).
Plotting the data points for the function described by Table 1 of example 1.1.4 on the graph below, each input on the horizontal axis corresponds a single output on the vertical axis. Moreover, if we draw a vertical line through each input on the horizontal axis, the vertical line intersects the graph at only one point.
However, plotting the data points for the relation in Table 2 of example 1.1.4 (which was not a function) on the graph below, each input on the horizontal axis does not corresponds a single output on the vertical axis. The input \(x = 2\) corresponds to two outputs \(y = 4\) and \(y = 5\) . In this case, when we draw a vertical line \(x=2\), the vertical line intersects the graph at more than one point. This gives us a simple way to identify whether or not a graph represents a function.
If a vertical line can be drawn that intersects a graph in two or more points, the graph does not represent a function.
Example \(\PageIndex{5}\)
Determine if each graph represents a function.
- The graph of \(y=x^3-4x\)
- The graph of the circle of radius 3 centered at the origin, \(x^2+y^2=9\)
Solution
- Since each vertical line that can be drawn intersects the graph at only one point, the graph in part (a) represents a functions by the vertical line test.
- The graph in part b does not represent a function, since it fails the vertical line test. The vertical line \(x = 1\) intersects the graph at two points, \(y = \sqrt{8} \approx 2.83 \) and \(y = -\sqrt{8} \approx -2.83 \). Therefore, the input \(x = 1\) corresponds to two outputs \(y = \sqrt{8} \approx 2.83 \) and \(y = -\sqrt{8} \approx -2.83 \).
Determine if the graph of the line represents a function.
- Answer
-
Yes, the graph represents a function since it passes the vertical line test. Each vertical drawn on the graph will intersect the graph at only one point.
Formulas as Functions
When possible, it is very convenient to define relationships using formulas or equations. Notice in example 1.1.5a, the equation can be written as a single formula, \(y=x^3-4x\), for the output \(y\) . In this case, each time we input a value for \(x\), we get a single output for \(y\). For example, when we input \(x=1\), we get the output \(y=(1)^3-4(1)=-7\). If we input \(x=2\), we get the output \(y=(2)^3-4(2)=0\) and so on. Therefore, equations that can be represented as a single formula for the output \(y\) represents a function confirming our conclusion from its graph in example 1.1.5a.
However, in example 1.1.5b, the equation \(x^2+y^2=9\) can't be written as a single formula for the output \(y\). When we try to solve for \(y\) in the equation, we get two formulas for \(y\).
\[x^2+y^2=9\nonumber \]Subtracting \(x^2\) from both sides
\[y^2=9-x^2\nonumber \] There are two square roots of every positive real number, one positive and one negative, yielding two formulas for \(y\).
\[y= \sqrt{9-x^2} \text{ and } y=- \sqrt{9-x^2}\nonumber \]
An input such as \(x=1\) corresponds to two outputs \(y= \sqrt{8}\) and \(y=- \sqrt{8}\). Therefore, the equation in example 1.1.5b does not represent a function, confirming our conclusion from its graph in example 1.1.5b.
An equation represents a function if it can be written as a single formula for the output \(y\).
Example \(\PageIndex{6}\)
Does the equation \(3x + 4y = 12\) represent a function for y in terms of x?
Solution
Solving the equation as a single formula for the output \(y\) by subtracting \(3x\) from both sides \[4y= -3x + 12\nonumber \] Dividing both sides by 4 and simplifying \[y=\dfrac{-3x+12}{4} = \dfrac{-3x}{4}+\dfrac{-12}{4} = \dfrac{3}{4} x - 3 \nonumber \] Therefore, the equation represents a function.
Does the equation \(x^{2} +y^{3} =1\) represent a function?
- Answer
-
Yes. We can solve the equation as a single formula for the output \(y\) where \(y= \sqrt[3]{1-x^2} \).
Focus: Function Notation
If we have two different functions, how can we distinguish between the inputs and outputs of each function? For example, if we have two functions represented by the equations \(y=x^2\) and \(y=2x-1\), which function has the output \(y=3\) when \(x=2\)? It's hard to tell without inputting the value \(x=2\) into each equation. When we do, we find that the output \(y=3\) comes from the second equation \(y=2x-1\).
Our strategy to address this issue is to use a letter or name to represent a function. We could name the function \(y=x^2\) with the letter \(f\). For an input, \(x=2\) whose output is \(y=4\) for this function, we write \(f(2)=4\). We say "f of 2 is 4". For an input, \(x=3\) whose output is \(y=9\) for this function, we write \(f(3)=9\). We say "f of 3 is 9". For any input x, we can represent the output of this function with \(y=f(x)=x^2\). Note that the parenthesis do not mean multiplication in this context.
We could represent the other function \(y=2x-1\) with the different letter such as \(g\). For an input, \(x=2\) whose output is \(y=3\) for this function, we write \(g(2)=3\). We say "g of 2 is 3". For any input x, we can represent the output of the second function with \(y=g(x)=2x-1\).
Function notation allows to distinguish between the inputs and outputs of two or more different functions. To communicate that we are dealing with the input and output of the second function \(y=2x-1\) for \(y=3\) when \(x=2\), we need only write \(g(2)=3\).
Function notation allows us to distinguish between the inputs and outputs of two different functions.
We are using letters in two different contexts. The letters f and g represent two different functions. The letters x and y represent variables or unknown numbers.
Example \(\PageIndex{7}\)
A table of values for the functions \(y=f(x)\) and \(y=g(x)\) is given.
| x | 0 | 1 | 2 | 3 | 4 |
| \(y=f(x)\) | 2 | 3 | 5 | 0 | 3 |
| \(y=g(x)\) | 4 | 2 | 0 | 2 | 4 |
- Evaluate \(f(0)\).
- Evaluate \(f(3)\).
- Evaluate \(g(3)\).
- Find all values of x where \(f(x)=3\).
Solution
- \(f(0)=2\) since when \(x=0\), \(y=2\) for function \(f\).
- \(f(3)=0\) since when \(x=3\), \(y=0\) for function \(f\).
- \(g(3)=2\) since when \(x=3\), \(y=2\) for function \(g\).
- When \(x=1\) and \(x=4\), \(f(x)=3\).
Example \(\PageIndex{8}\)
The graphs of the functions \(y=h(x)\) and \(y=k(x)\) are given.
- Evaluate \(h(1)\).
- Evaluate \(k(1)\).
- Evaluate \(k(2)\).
- Find all values of x where \(k(x)=3\).
Solution
- \(h(1)=4\) since when \(x=1\), \(y=4\) for function \(h\).
- \(k(1)=3\) since when \(x=1\), \(y=3\) for function \(k\).
- \(k(2)=4\) since when \(x=2\), \(y=4\) for function \(k\).
- When \(x=1\) and \(x=3\), \(y=k(x)=3\).
Example \(\PageIndex{9}\)
Given the functions \(f(x) = 2x+1\) and \(g(x) = x^2+3x\)
- Evaluate \(f(2)\)
- Evaluate \(g(-3)\)
- Find all values of x where \(f(x)=7\)
- Evaluate \(f(4)-f(3)\)
Solution
(a) To evaluate \(f(2)\), we are given the value of the input \(x=2\) which we can plug into the formula for the function \(f\) wherever we see \(x\) in the formula and simplify
\[f(2) = 2(2) + 1 = 4 + 1 = 5\nonumber \]
(b) To evaluate \(g(-3)\), we are given the value of the input \(x=-3\) which we can plug into the formula for the function \(g\) wherever we see \(x\) in the formula and simplify
\[g(-3) = (-3)^2 + 3(-3) = 9 + -9 = 0\nonumber \]
(c) In this case, we are given the output \(y = 7\) for the function f. We can set the formula for \(y=f(x)\) equal to 1 , and solve for the value the input x that will produce that output
\[f(x) = 7\nonumber \] Substituting into the original formula
\[7 = 2x+1\nonumber \] Subtracting 1 from each side
\[6 = 2x\nonumber \] Dividing by 2 on both sides
\[3 = x\nonumber \]
You can always check your answer by using your solution in the original equation to see if your calculated answer is correct.
(d) In this part, we are trying to subtract two outputs where \(y_{2}=f(4)\) and \(y_{1}=f(3)\). We need to evaluate each function to find the outputs before we can subtract. Substituting each input into \(f\)
\[f(4) - f(3) = (2(4)+1) - (2(3)+1) \nonumber \] Simplifying
\[ = (9)-(7) \nonumber \] Then subtracting
\[ = 2\nonumber \]Given the functions \(h(x) = 3x-2\) and \(k(x) = x^2-5\)
- Evaluate \(h(-2)\)
- Evaluate \(k(-2)\)
- Find all values of x where \(h(x)=-2\)
- Evaluate \( \frac{k(3)-k(1)}{2}\)
- Answer
-
(a) \(h(-2) = -8 \)
(b) \(k(-2) = -1 \)
(c) \(x = 0\)
You can always check your answer by using your solution in the original equation to see if your calculated answer is correct.
(d) \( \frac{k(3)-k(1)}{2}= 3 \)
Focus: Inputting Variables into Functions in Function Notation
As we move forward in using functions to describe relationships between two quantities, we may want to use variables to represent the quantities that we are describing, such as in example 1.1.1 where t represented the time since the ball was thrown and h represented the height of the ball. Just like when we inputted a numerical input into a function in notation, if our input represents another variable or expression, such as \(x=a\), we would input the variable \(a\) where ever we see the input \(x\).
Given the functions \(f(x) = 2x+1\) and \(g(x) = x^2+3x\ \nonumber\), we can evaluate each with variable inputs. To evaluate \(f(a)\), we input the variable \(a\) where ever we saw the input \(x\) in the formula for function \(f\). \[f(a)=2a+1 \nonumber\]
Similarly, to evaluate \(g(a)\), we input the variable \(a\) in both places where the input \(x\) occurred in the formula for function \(g\). \[g(a)=a^2+3a\nonumber\]
Now, inputing a box \( \square \) into function \(f\), we get \[f(\square)=2(\square)+1 \nonumber\]
If our input is a variable expression such as \( a+h\), we can input \(a+h\) where ever we see the box \(\square\), essentially letting \(\square = a+h\). For example, \[f(a+h)=2(a+h)+1 \nonumber\]
Then simplifying, we have\[f(a+h)=2a+2h+1 \nonumber\]
Example \(\PageIndex{10}\)
Given the functions \(k(x) = 3x-4\), \(m(x) = x^2-5\), and \(n(x) = x^2-4x+1\ \nonumber\)
- Evaluate \(k(a)\)
- Evaluate \(m(a)\)
- Evaluate \(k(a+h)\)
- Evaluate \(m(a+h)\)
- Evaluate \(\frac{k(a+h)-k(a)}{h}\)
- Evaluate \(\frac{m(a+h)-m(a)}{h}\)
- Evaluate \(\frac{m(x)-k(a)}{x-a}\)
- Evaluate \(\frac{n(a+h)-n(a)}{h}\)
Solution
-
To evaluate \(k(a)\), we are given the input \(x=a\) which we can plug into the formula for the function \(k\) wherever we see the input variable \(x\).
\[k(a) = 3(a) - 4=3a-4\nonumber \]
-
To evaluate \(m(a)\), we are given the input \(x=a\) which we can plug into the formula for the function \(m\) wherever we see the input variable \(x\).
\[m(a) = (a)^2 -5=a^2-5\nonumber \]
-
To evaluate \(k(a+h)\), we are given the expression \(x=a+h\) for the input which we can plug into the formula for the function \(k\) wherever we see the input \(x\).
\[k(a+h) = 3(a+h) - 4\nonumber \] Then simplifying we have \[= 3a+3h - 4\nonumber \]
-
To evaluate \(m(a+h)\), we are given the expression \(x=a+h\) for the input which we can plug into the formula for the function \(m\) wherever we see the input \(x\).
\[m(a+h) = (a+h)^2 -5\nonumber \] Then simplifying we have \[= (a+h)(a+h) - 5=a^2+2ah+h^2-5\nonumber \]
-
In this part, we are trying to subtract two outputs in the numerator where \(y_{2}=k(a+h)\) and \(y_{1}=k(a)\), then divide the result by \(h\) . We need to evaluate the function with each input to find the outputs before we can subtract. Substituting each input into the function \(k\)
\[\frac{k(a+h) - k(a)}{h} = \frac{(3(a+h)-4) - (3a-4)}{h} \nonumber \] Distributing in the numerator
\[=\frac{(3a+3h-4) - 3a+4}{h} \nonumber \] Then combining like terms in the numerator and simplifying \[=\frac{3h}{h} =3 \nonumber \]
-
Similar to part (e), we need to evaluate the function with each input to find the outputs before we can subtract in the numerator. Substituting each input into the function \(m\)
\[\frac{m(a+h) - m(a)}{h} = \frac{((a+h)^2-5) - ((a)^2-5)}{h} \nonumber \] Squaring \(a+h\) and distributing the minus sign in the numerator
\[=\frac{((a+h)(a+h)-5) - a^2+5}{h} \nonumber \] \[=\frac{a^2+2ah+h^2-5 - a^2+5}{h} \nonumber \] Then combining like terms in the numerator and simplifying \[=\frac{2ah+h^2}{h} \nonumber \] Factoring a common factor of h in the numerator \[=\frac{h(2a+h)}{h} \nonumber \] Then simplifying by canceling a common factor \[=2a+h \nonumber \]
-
Substituting each input into the function \(m\)
\[\frac{m(x) - m(a)}{x-a} = \frac{((x)^2-5) - ((a)^2-5)}{x-a} \nonumber \] Subtracting in the numerator
\[=\frac{x^2 - a^2}{x-a} \nonumber \] Factoring in the numerator \[=\frac{(x-a)(x+a)}{x-a} \nonumber \] Then simplifying by canceling a common factor \[=x+a \nonumber \]
-
Substituting each input into the function \(n\)
\[\frac{n(a+h) - n(a)}{h} = \frac{((a+h)^2-4(a+h)+1) - ((a)^2-4a+1)}{h} \nonumber \] Performing the operations in the numerator and distributing the minus sign
\[=\frac{((a+h)(a+h)-4a-4h+1) - a^2+4a-1}{h} \nonumber \] Then multiplying and combining like terms in the numerator to simplify \[=\frac{a^2+2ah+h^2-4h - a^2}{h} \nonumber \] Again, combining like terms in the numerator to simplify \[=\frac{2ah+h^2-4h}{h} \nonumber \] Factoring a common factor of h in the numerator \[=\frac{h(2a+h-4)}{h} \nonumber \] Then simplifying by canceling a common factor we have \[=2a+h-4 \nonumber \]
Given the functions \(r(x) = 5x+1\), \(s(x) = x^2+3\), and \(t(x) = x^2+5x\ \nonumber\)
- Evaluate \(r(a)\)
- Evaluate \(t(a)\)
- Evaluate \(s(a+h)\)
- Evaluate \(t(a+h))\)
- Evaluate \(\frac{r(x)-r(a)}{x-a}\)
- Evaluate \(\frac{s(a+h)-s(a)}{h}\)
- Evaluate \(\frac{s(x)-s(a)}{x-a}\)
- Evaluate \(\frac{t(a+h)-t(a)}{h}\)
- Answer
-
- \(r(a) = 5a+1 \)
- \(t(a) = a^2+5a \)
- \(s(a+h) = a^2+2ah+h^2+3 \)
- \( t(a+h)= a^2+2ah+h^2 + 5a+5h \)
- \(\frac{r(x) - r(a)}{x-a} = 5 \)
- \(\frac{s(a+h) - s(a)}{h} = 2a+h \)
- \(\frac{s(x) - s(a)}{x-a} = x+a \)
- \(\frac{t(a+h) - t(a)}{h} = 2a+h+5 \)
Focus: Function Notation in Applications
When we work with functions in applications to describe relationships, both the input and output variables in function notation represent real world quantitiessuch as the hight of a ball or the number of infected patients as opposed to abstract unknown numbers. In this situation, it is critical that we identify which quantity is the input and which quantity is the output in order to understand what a statement in function notation is communicating in the application.
Example \(\PageIndex{11}\)
The function \(P = f(t)\) gives the population of a Clovis, California t years since 2010. The function \(P = g(t)\) given the population of Fresno, California t years since 2010 (as reported by the United States Census Bureau at https://data.census.gov/ on June 1, 2024).
- Interpret the meaning of \(f(10) = 120,674\).
- Interpret the meaning of \(g(10) = 542,159\).
Solution
- The function f has an input t that represents the years since 2010. The input t = 10 represents 10 years since 2010 or the year 2020. The output of the function f represents the population of Clovis, California. In this example, P = 120,672 represents the population of Clovis. In summary, the statement tells us that the population of Clovis, California was 120,672 in 2020.
- Similarly, the function g has an input t that represents the years since 2010. The input t = 10 represents 10 years since 2010 or the year 2020. The output of the function g represents the population of Fresno, California. In this example, P = 542,159 represents the population of Fresno. In summary, the statement tells us that the population of Fresno, California was 542,159 in 2020.
Suppose, the function \(A(t) = 1.69t+30.2\) approximates the amount of lumber produced in the United States (in billions of board feet) t years since 2010 (Based on data reported by the United States Department of Agriculture at https://www.usda.gov/topics/data on June 1, 2024).
- Interpret the meaning of \(A(12) =50.5 \).
- Find and interpret the meaning of \(A(5)\).
Solution
- Like the previous example, the function has an input t that represents the years since 2010. The input t = 12 represents 12 years since 2010 or the year 2022. The output 50.5 of the function A represents the billions of board feet of lumber produced. In summary, the statement tells us that the amount of lumber produced in the United States in 2022 was 50.5 billion board feet.
- We are given the input t = 5, which represents 5 years since 2010 or the year 2015. Since we are given a formula for the amount, we can find the output by evaluating our function at t =5. \[A(5)=1.69(5)+30.2=38.7 \nonumber \] In summary, the statement tells us that the amount of lumber production in the Unites States was 38.7 billion board feet in 2015.
Let \(C=h(A)\) represent the cost (in US dollars) of painting an area of A square feet of a house.
- Interpret the meaning of \(h(400)=600\)
- Interpret the meaning of \(h(600)\)
- Answer
-
- This function has an input A that represents the square footage of the house to be painted. The input A=400 represents 400 square feet of the house to be painted. The output C=600 of the function h represents the cost. In summary, the statement tells us that the cost of painting an area of 400 square feet is $600.
- In this case, we are giving the input A = 600 which represents area of the house to be painted in square feet. We are not given the value of the output, so expression represents the unknown cost of painting an area of 600 square feet.
Important Topics of this Section
- Definition of a function
- Input (independent variable)
- Output (dependent variable)
- Function notation
- Descriptive variables
- Functions in words, tables, graphs & formulas
- Vertical line test
- Evaluating a function at a specific input value
- Solving a function given a specific output value