Suppose you worked at an animal rescue caring for the dogs, and you wanted to determine the age of each of the dogs in 'dog years', based on the age in human years. Since you would be performing the same calculation over and over, your friend suggests that you write a function. How would you go about setting up such a function? Is a function really different from a two variable, *x = y* form of an equation? In this Concept, you'll learn how to write functions.

### Function Notation

Instead of purchasing a one-day ticket to the theme park, Joseph decided to pay by ride. Each ride costs $2.00. To describe the amount of money Joseph will spend, several mathematical concepts can be used.

First, an expression could be written to describe the relationship between the cost per ride and the number of rides, \begin{align*}r\end{align*}

#### Using Joseph’s situation, write the following:

The variable in this situation is the number of rides Joseph will pay for. Call this \begin{align*}r\end{align*}

a. An expression representing his total amount spent

\begin{align*}2(r)\end{align*}

b. An equation representing his total amount spent

\begin{align*}2(r) = m\end{align*}

c. An equation that shows Joseph wants to spend exactly $22.00 on rides

\begin{align*}2(r) = 22\end{align*}

d. An inequality that describes the fact that Joseph will not spend more than $26.00 on rides

\begin{align*}2(r) \le 26\end{align*}

In addition to an expression, equation, or inequality, Joseph’s situation could be expressed in the form of a function or a table.

**Writing Equations as Functions**

A function is a set of ordered pairs in which the first coordinate, usually \begin{align*}x\end{align*}**dependent variable**, meaning the values of this variable depend upon what is substituted for the other variable.

Consider Joseph’s equation \begin{align*}m = 2r\end{align*}**independent variable.**

\begin{align*}& \quad \ input\\ & \quad \ \ \ \downarrow\\ & \quad \underbrace{f(x)}= y \leftarrow output\\ & \ function\\ & \quad \ \ box\end{align*}

#### Rewrite the following equations in function notation.

a. \begin{align*}y=7x-3\end{align*}

According to the definition of a function, \begin{align*}y=f(x)\end{align*}, so \begin{align*}f(x)=7x-3\end{align*}.

b. \begin{align*}d=65t\end{align*}

This time the dependent variable is \begin{align*}d\end{align*}. Function notation replaces the dependent variable, so \begin{align*}d = f(t) = 65t\end{align*}.

c. \begin{align*}F=1.8C+32\end{align*}

\begin{align*}F = f(C) = 1.8C + 32\end{align*}

Why Use Function Notation?

Why is it necessary to use function notation? The necessity stems from using multiple equations. Function notation allows one to easily decipher between the equations. Suppose Joseph, Lacy, Kevin, and Alfred all went to the theme park together and chose to pay $2.00 for each ride. Each person would have the same equation \begin{align*}m=2r\end{align*}. Without asking each friend, we could not tell which equation belonged to whom. By substituting function notation for the dependent variable, it is easy to tell which function belongs to whom. By using function notation, it will be much easier to graph multiple lines.

#### Write functions to represent the total each friend spent at the park.

\begin{align*}J(r)= 2r\end{align*} represents Joseph’s total,

\begin{align*}L(r)= 2r\end{align*} represents Lacy's total,

\begin{align*}K(r)= 2r\end{align*} represents Kevin's total, and

\begin{align*}A(r)= 2r\end{align*} represents Alfred’s total.

### Examples

Recall the example from a previous Concept where a student organization sells shirts to raise money. The cost of printing the shirts was expressed as \begin{align*}100+7x\end{align*} and for the revenue, we had the expression \begin{align*} 15x\end{align*}, where \begin{align*}x\end{align*} is the number of shirts.

#### Example 1

Write two functions, one for the cost and one for revenue.

The cost function we will write as \begin{align*}C(x)=100+7x\end{align*} and the revenue function we will write as \begin{align*}R(x)=15x\end{align*}.

#### Example 2

Express that the cost must be less than or equal to $800.

Since \begin{align*}C(x)\end{align*} represents the costs, we substitute in $800 for \begin{align*}C(x)\end{align*} and replace the equation with the appropriate inequality symbol

\begin{align*}100+7x \le 800\end{align*}

This reads that \begin{align*}100+7x\end{align*} is less than or equal to $800, so we have written the inequality correctly.

#### Example 3

Express that the revenue must be equal to $1500.

We substitute in $1500 for \begin{align*}R(x)\end{align*}, getting \begin{align*}1500=15x.\end{align*}

\begin{align*}1500=15x.\end{align*}

#### Example 4

How many shirts must the students sell in order to make $1500?

We want to find the value of \begin{align*}x\end{align*} that will make this equation true. It looks like 100 is the answer. Checking this (see below) it is clear that 100 does satisfy the equation. The students must sell 100 shirts in order to have a revenue of $1500.

\begin{align*}1500 & =15(100)\\ 1500 & =1500\end{align*}

Since 1500 = 1500 is a true statement, 100 shirts is the correct number.

### Review

- Rewrite using function notation: \begin{align*}y= \frac{5}{6} x-2\end{align*}.
- Rewrite using function notation: \begin{align*}m=n^2+2n-3\end{align*}.
- What is one benefit of using function notation?
- Write a function that expresses the money earned after working some number of hours for $10 an hour.
- Write a function that represents the number of cuts you need to cut a ribbon in \begin{align*}x\end{align*} number of pieces.
- Jackie and Mayra each will collect a $2 pledge for every basket they make during a game. Write two functions, one for each girl, expressing how much money she will collect.

### Answers for Review Problems

To see the Review answers, open this PDF file and look for section 1.10.