We've updated our

TEXT

# Function Notation and Graphs of Functions

### Learning Outcomes

• Write functions using algebraic notation
• Use the vertical line test to determine whether a graph represents a function
Some people think of functions as “mathematical machines.” Imagine you have a machine that changes a number according to a specific rule such as “multiply by $3$ and add $2$” or “divide by $5$, add $25$, and multiply by $−1$.” If you put a number into the machine, a new number will pop out the other end having been changed according to the rule. The number that goes in is called the input, and the number that is produced is called the output. You can also call the machine “f” for function. If you put x into the box, f(x), comes out. Mathematically speaking, x is the input, or the “independent variable,” and f(x) is the output, or the “dependent variable,” since it depends on the value of x. $f(x)=4x+1$ is written in function notation and is read “f of x equals $4x$ plus $1$.” It represents the following situation: A function named f acts upon an input, x, and produces f(x) which is equal to $4x+1$. This is the same as the equation $y=4x+1$. Function notation gives you more flexibility because you do not have to use y for every equation. Instead, you could use f(x) or g(x) or c(x). This can be a helpful way to distinguish equations of functions when you are dealing with more than one at a time.

## Using Function Notation

Once we determine that a relationship is a function, we need to display and define the functional relationship so that we can understand it, use it, and possibly even program it into a computer. There are various ways of representing functions. A standard function notation is one representation that facilitates working with functions. Now you try it.

### Example

Represent height as a function of age using function notation.

Answer: To represent "height as a function of age," we start by identifying the variables: $h$ for height and $a$ for age. [latex-display]\begin{array}{ccc}h\text{ is }f\text{ of }a\hfill & \hfill & \hfill & \hfill & \text{We name the function }f;\text{ height is a function of age}.\hfill \\ h=f\left(a\right)\hfill & \hfill & \hfill & \hfill & \text{We use parentheses to indicate the function input}\text{. }\hfill \\ f\left(a\right)\hfill & \hfill & \hfill & \hfill & \text{We name the function }f;\text{ the expression is read as ''}f\text{ of }a\text{.''}\hfill \end{array}[/latex-display] Note: We can use any letter to name the function; the notation $h=f\left(a\right)$ shows us that $h$ depends on, or is a function of, $a$. The value $a$ must be put into the function $f$ to get a result (height). The parentheses indicate that age is the input for the function; they do not indicate multiplication.

Now try another.

### Example

1. Write the formula for perimeter of a square, $P=4s$, as a function.
2. Write the formula for area of a square, $A=l^{2}$, as a function.

1. Name the function P. P is a function of the length of the sides, s. Perimeter, as a function of side length, is equal to $4$ times side length. $P(s)=4s$
2. Name the function A.  Area, as a function of the length of the sides, is equal to the length squared.$A(l)=l^{2}$.

This would make it easy to graph both functions on the same graph without confusion about the variables. We can also use an algebraic expression as the input to a function. For example $f\left(a+b\right)$ means "first add a and b, and the result is the input for the function f." The operations must be performed in this order to obtain the correct result.

### A General Note: Function Notation

The notation $y=f\left(x\right)$ defines a function named $f$. This is read as "$y$ is a function of $x$." The letter $x$ represents the input value, or independent variable. The letter $y$ or $f\left(x\right)$, represents the output value, or dependent variable.

### Example

Use function notation to represent a function whose input is the name of a month and output is the number of days in that month.

Answer: The number of days in a month is a function of the name of the month, so if we name the function $f$, we write $\text{days}=f\left(\text{month}\right)$ or $d=f\left(m\right)$. The name of the month is the input to a "rule" that associates a specific number (the output) with each input. For example, $f\left(\text{March}\right)=31$, because March has $31$ days. The notation $d=f\left(m\right)$ reminds us that the number of days, $d$ (the output), is dependent on the name of the month, $m$ (the input).

Note that the inputs to a function do not have to be numbers; function inputs can be names of people, labels of geometric objects, or any other element that determines some kind of output. However, most of the functions we will work with in this book will have numbers as inputs and outputs.

### Example

A function $N=f\left(y\right)$ gives the number of police officers, $N$, in a town in year $y$. What does $f\left(2005\right)=300$ represent?

Answer: When we read $f\left(2005\right)=300$, we see that the input year is 2005. The value for the output, the number of police officers, $N$, is 300. Remember, $N=f\left(y\right)$. The statement $f\left(2005\right)=300$ tells us that in the year 2005 there were $300$ police officers in the town.

In the following videos we show two more examples of how to express a relationship using function notation. https://youtu.be/lF0fzdaxU_8 https://youtu.be/nAF_GZFwU1g

## Graphs of Functions

When both the independent quantity (input) and the dependent quantity (output) are real numbers, a function can be represented by a graph in the coordinate plane. The independent value is plotted on the x-axis and the dependent value is plotted on the y-axis. The fact that each input value has exactly one output value means graphs of functions have certain characteristics. For each input on the graph, there will be exactly one output. For a function defined as $y = f(x)$, or y is a function of $x$, we would write ordered pairs $(x, f(x))$ using function notation instead of $(x,y)$ as you may have seen previously. We can identify whether the graph of a relation represents a function because for each x-coordinate there will be exactly one y-coordinate.

When a vertical line is placed across the plot of this relation, it does not intersect the graph more than once for any values of x. If, on the other hand, a graph shows two or more intersections with a vertical line, then an input (x-coordinate) can have more than one output (y-coordinate), and y is not a function of x. Examining the graph of a relation to determine if a vertical line would intersect with more than one point is a quick way to determine if the relation shown by the graph is a function. This method is often called the “vertical line test.” You try it.

### Example

Use the vertical line test to determine whether the relation plotted on this graph is a function.

Answer: This relationship cannot be a function, because some of the x-coordinates have two corresponding y-coordinates.

The vertical line method can also be applied to a set of ordered pairs plotted on a coordinate plane to determine if the relation is a function.

### Example

Consider the ordered pairs $\{(−1,3),(−2,5),(−3,3),(−5,−3)\}$ plotted on the graph below. Use the vertical line test to determine whether the set of ordered pairs represents a function.

Drawing vertical lines through each point results in each line only touching one point. This means that none of the x-coordinates have two corresponding y-coordinates, so this is a function.

Now consider the set of ordered pairs $\{(3,−1),(5,−2),(3,−3),(−3,5)\}$. One of the inputs, $3$, can produce two different outputs, $−1$ and $−3$. You know what that means—this set of ordered pairs is not a function. A plot confirms this.

Notice that a vertical line passes through two plotted points. One x-coordinate has multiple y-coordinates. This relation is not a function. In the following video, we show another example of determining whether a graph represents a function using the vertical line test. https://youtu.be/5Z8DaZPJLKY