Chapter 1: Algebra Review

# Section 1.1 Functions

Learning Objectives

**What Is a Function?**

The natural world is full of relationships between quantities that change. When we see these relationships, it is natural for us to ask, If I know one quantity, can I then determine the other?

This establishes the idea of an input quantity, or independent variable, and a corresponding output quantity, or dependent variable. From this we get the notion of a functional relationship in which the output can be determined from the input.

For some quantities, like height and age, there are certainly relationships between these quantities. Given a specific person and any age, it is easy enough to determine their height, but if we tried to reverse that relationship and determine the height from a given age, that would be problematic, since most people maintain the same height for many years.

#### Function

A **function** is a rule for a relationship between input, or independent, quantity and output, or dependent, quantity in which each input value uniquely determines one output value. We say the output is a function of the input.

Example 1

In the height and age example above, is height a function of age? Is age a function of height?

In the height and age example above, it would be correct to say that height is a function of age, since each age uniquely determines a height. For example, on my [latex]18[/latex]th birthday, I had exactly one height of [latex]69[/latex] inches.

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 [latex]70[/latex] inches, there is more than one output of age, since I was [latex]70[/latex] inches at the age of [latex]20[/latex] and [latex]21[/latex].

**Video**

**Function Notation**

To simplify writing out expressions and equations involving functions, a simplified notation is often used. We also use descriptive variables to help us remember the meaning of the quantities in the problem.

Rather than write height is a function of age,

we could use the descriptive variable [latex]h[/latex] to represent height and we could use the descriptive variable [latex]a[/latex] to represent age.

“height is a function of age” | if we name the function [latex]f[/latex], we write |

“[latex]h[/latex] is [latex]f[/latex] of [latex]a[/latex]“ | or more simply |

[latex]h[/latex] = [latex]f(a)[/latex] | we could instead name the function [latex]h[/latex] and write |

[latex]h(a)[/latex] | which is read “[latex]h[/latex] of [latex]a[/latex]“ |

Remember we can use any variable to name the function; the notation [latex]h(a)[/latex] shows us that [latex]h[/latex] depends on [latex]a[/latex]. The value [latex]a[/latex]

must be put into the function [latex]h[/latex]

to get a result. Be careful – the parentheses indicate that age is input into the function. (Note: do not confuse these parentheses with multiplication!)

#### Function Notation

The notation output = [latex]f[/latex](input) defines a function named [latex]f[/latex]. This would be read as output is [latex]f[/latex] of input.

#### Example 2

A function [latex]N = f(y)[/latex] gives the number of police officers, [latex]N[/latex], in a town in year [latex]y[/latex]. What does [latex]f(2005) = 300[/latex] tell us?

When we read [latex]f(2005) = 300[/latex], we see the input quantity is [latex]2005[/latex], which is a value for the input quantity of the function, the year [latex]y[/latex]. The output value is [latex]300[/latex], the number of police officers [latex]N[/latex], a value for the output quantity. Remember [latex]N=f(y)[/latex]. So this tells us that in the year [latex]2005[/latex], there were [latex]300[/latex] police officers in the town.

**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.

This table represents the age of children in years and their corresponding heights. While some tables show all the information we know about a function, this particular table represents just some of the data available for height and ages of children.

(input) [latex]a[/latex], age in years | [latex]4[/latex] | [latex]5[/latex] | [latex]6[/latex] | [latex]7[/latex] | [latex]8[/latex] | [latex]9[/latex] | [latex]10[/latex] |

(output) [latex]h[/latex], height in inches | [latex]40[/latex] | [latex]42[/latex] | [latex]44[/latex] | [latex]47[/latex] | [latex]50[/latex] | [latex]52[/latex] | [latex]54[/latex] |

Example 3

Which of these tables define a function (if any)?

Input | Output |

[latex]2[/latex] | [latex]1[/latex] |

[latex]5[/latex] | [latex]3[/latex] |

[latex]8[/latex] | [latex]6[/latex] |

Input | Output |

[latex]-3[/latex] | [latex]5[/latex] |

[latex]0[/latex] | [latex]1[/latex] |

[latex]4[/latex] | [latex]5[/latex] |

Input | Output |

[latex]1[/latex] | [latex]0[/latex] |

[latex]5[/latex] | [latex]2[/latex] |

[latex]5[/latex] | [latex]4[/latex] |

The first and second tables define functions. In both, each input corresponds to exactly one output. The third table does not define a function, since the input value of 5 corresponds with two different output values.

**Video**

**Solving and Evaluating Functions**

When we work with functions, there are two typical things we do: evaluate and solve. Evaluating a function is what we do when we know an input and use the function to determine the corresponding output. Evaluating will always produce one result, since each input of a function corresponds to exactly one output.

Solving equations involving a function is what we do when we know an output and use the function to determine the inputs that would produce that output. Solving a function could produce more than one solution, since different inputs can produce the same output.

Example 4

Using the table shown, where [latex]Q=g(n)[/latex]

[latex]n[/latex] | 1 | 2 | 3 | 4 | 5 |

[latex]Q[/latex] | 8 | 6 | 7 | 6 | 8 |

a) Evaluate [latex]g(3)[/latex]

b) Solve [latex]g(n)=6[/latex]

a) Evaluate [latex]g(3)[/latex]: Evaluating [latex]g(3)[/latex] (read: g of 3

) means that we need to determine the output value, [latex]Q[/latex], of the function g given the input value of [latex]n=3[/latex]. Looking at the table, we see the output corresponding to [latex]n=3[/latex] is [latex]Q=7[/latex], allowing us to conclude [latex]g(3) = 7[/latex].

b) Solve [latex]g(n)=6[/latex]: Solving [latex]g(n) = 6[/latex] means we need to determine what input values, [latex]n[/latex], produce an output value of 6. Looking at the table we see there are two solutions: [latex]n = 2[/latex] and [latex]n = 4[/latex]. When we input [latex]2[/latex] into the function [latex]g[/latex], our output is [latex]Q = 6[/latex]. When we input [latex]4[/latex] into the function [latex]g[/latex], our output is also [latex]Q = 6[/latex].

** 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.

Example 5

Which of these graphs defines a function [latex]y=f(x)[/latex]?

Looking at the three graphs above, the first two define a function [latex]y=f(x)[/latex], since for each input value along the horizontal axis there is exactly one output value corresponding, determined by the y-value of the graph. The third graph does not define a function [latex]y=f(x)[/latex], since some input values, such as [latex]x=2[/latex], correspond with more than one output value.

#### Vertical Line Test

The vertical line test is a handy way to think about whether a graph defines the vertical output as a function of the horizontal input. Imagine drawing vertical lines through the graph. If any vertical line would cross the graph more than once, then the graph does not define only one vertical output for each horizontal input.

**Video**

Evaluating a function using a graph requires taking the given input and using the graph to look up the corresponding output. Solving a function equation using a graph requires taking the given output and looking on the graph to determine the corresponding input.

Example 6

Given the graph below,

a) Evaluate [latex]f(2)[/latex].

b) Solve [latex]f(x) = 4[/latex].

a) To evaluate [latex]f(2)[/latex], we find the input of [latex]x=2[/latex] on the horizontal axis. Moving up to the graph gives the point [latex](2, 1)[/latex], giving an output of [latex]y=1[/latex]. So [latex]f(2) = 1[/latex].

b) To solve [latex]f(x) = 4[/latex], we find the value [latex]4[/latex] on the vertical axis because if [latex]f(x) = 4[/latex], then [latex]4[/latex] is the output. Moving horizontally across the graph gives two points with the output of [latex]4: (-1,4)[/latex] and [latex](3,4)[/latex]. These give the two solutions to [latex]f(x) = 4[/latex]: [latex]x = -1[/latex] or [latex]x = 3[/latex]. This means [latex]f(-1)=4[/latex] and [latex]f(3)=4[/latex], or when the input is [latex]-1[/latex] or [latex]3[/latex], the output is [latex]4[/latex].

Notice that while the graph in the previous example is a function, getting two input values for the output value of 4 shows us that this function is not one-to-one.

** Formulas as Functions**

When possible, it is very convenient to define relationships using formulas. If it is possible to express the output as a formula involving the input quantity, then we can define a function.

Example 7

Express the relationship [latex]2n + 6p = 12[/latex] as a function [latex]p = f(n)[/latex] if possible.

To express the relationship in this form, we need to be able to write the relationship where [latex]p[/latex] is a function of [latex]n[/latex], which means writing it as [latex]p =[/latex] [something involving [latex]n[/latex]].

[latex]2n + 6p = 12[/latex] | subtract [latex]2n[/latex] from both sides |

[latex]6p = 12 - 2n[/latex] | divide both sides by 6 and simplify |

[latex]p=\frac{12-2n}{6}=\frac{12}{6}-\frac{2n}{6}=2-\frac{1}{3}n[/latex]

Having rewritten the formula as [latex]p=[/latex], we can now express [latex]p[/latex] as a function: [latex]p=f(n)=2-\frac{1}{3}n[/latex]

Not every relationship can be expressed as a function with a formula.

As with tables and graphs, it is common to evaluate and solve functions involving formulas. Evaluating will require replacing the input variable in the formula with the value provided and calculating. Solving will require replacing the output variable in the formula with the value provided, and solving for the input(s) that would produce that output.

Example 8

Given the function [latex]k(t)=t^3+2[/latex]:

a) Evaluate [latex]k(2)[/latex].

b) Solve [latex]k(t)=1[/latex].

a) To evaluate [latex]k(2)[/latex], we plug in the input value [latex]2[/latex] into the formula wherever we see the input variable [latex]t[/latex], then simplify:

[latex]\begin{align*}k(2)=&2^3+2\\k(2)=&8+2 \end{align*}.[/latex] So [latex]k(2) = 10[/latex].

b) To solve [latex]k(t) = 1[/latex], we set the formula for [latex]k(t)[/latex] equal to 1, and solve for the input value that will produce that output:

[latex]\begin{align*} k(t)=&1 & \\ t^3+2=&1 &\text{substitute the original formula} \\ t^3=&-1 &\text{subtract 2 from each side} \\ t=&-1 &\text{take the cube root of each side} \end{align*}[/latex]

When solving an equation using formulas, you can check your answer by using your solution in the original equation to see if your calculated answer is correct.

We want to know if [latex]k(t) = 1[/latex] is true when [latex]t=-1[/latex]: [latex]\begin{align*}k(-1)=&(-1)^3+2\\=& -1+2\\=&1,\end{align*},[/latex] which was the desired result.

** Basic Toolkit Functions**

There are some basic functions that it is helpful to know the name and shape of. We call these the basic toolkit of functions.

For these definitions we will use [latex]x[/latex] as the input variable and [latex]f(x)[/latex] as the output variable.

### Video

**Toolkit Functions**

Constant: | [latex]f(x)=c[/latex], where [latex]c[/latex] is a constant (number) |

Identity: | [latex]f(x)=x[/latex] |

Absolute value: | [latex]f(x)=|x|[/latex] |

Quadratic: | [latex]f(x)=x^2[/latex] |

Cubic: | [latex]f(x)=x^3[/latex] |

Reciprocal: | [latex]f(x)=\frac{1}{x}[/latex] |

Reciprocal squared: | [latex]f(x)=\frac{1}{x^2}[/latex] |

Square root: | [latex]f(x)=\sqrt[2]{x}=\sqrt{x}[/latex] |

Cube root: | [latex]f(x)=\sqrt[3]{x}[/latex] |

**Graphs of the Toolkit Functions**

**Domain and Range**

One of our main goals in mathematics is to model the real world with mathematical functions. In doing so, it is important to keep in mind the limitations of the models we create.

This table shows a relationship between the circumference and height of a tree as it grows.

Circumference, [latex]c[/latex] | 1.7 | 2.5 | 5.5 | 8.2 | 13.7 |

Height, [latex]h[/latex] | 24.5 | 31 | 45.2 | 54.6 | 92.1 |

While there is a strong relationship between the two, it would certainly be ridiculous to talk about a tree with a circumference of [latex]-3[/latex] feet, or a height of [latex]3000[/latex] feet. When we identify limitations on the inputs and outputs of a function, we are determining the domain and range of the function.

#### Domain and Range

**Domain:** The set of possible input values to a function

**Range:** The set of possible output values of a function

Example 9

Using the tree table above, determine a reasonable domain and range.

We could combine the data provided with our own experiences and reason to approximate the domain and range of the function [latex]h = f(c)[/latex]. For the domain, possible values for the input circumference c, it doesn’t make sense to have negative values, so [latex]c > 0[/latex]. We could make an educated guess at a maximum reasonable value, or look up that the maximum circumference measured is about 119 feet. With this information we would say a reasonable domain is feet.

Similarly for the range, it doesn’t make sense to have negative heights, and the maximum height of a tree could be looked up to be [latex]379[/latex] feet, so a reasonable range is feet.

A more compact alternative to inequality notation is **interval notation**, in which intervals of values are referred to by the starting and ending values. Curved parentheses are used for strictly less than,

and square brackets are used for less than or equal to.

Since infinity is not a number, we can’t include it in the interval, so we always use curved parentheses with [latex]\infty[/latex] and [latex]-\infty[/latex]. The table below will help you see how inequalities correspond to interval notation:

Inequality | Interval notation |

[latex]5 \lt h \leq10[/latex] | (5, 10] |

[latex]5\leq h \lt10[/latex] | [5, 10) |

[latex]5 \lt h \lt 10[/latex] | (5, 10) |

[latex]h \lt10[/latex] | [latex](-\infty,10)[/latex] |

[latex]h\geq10[/latex] | [latex][10,\infty)[/latex] |

All real numbers ([latex]\mathbb{R}[/latex]) | [latex](-\infty,\infty)[/latex] |

Example 10

Describe the intervals of values shown on the line graph below using set builder and interval notations:

To describe the values, x, that lie in the intervals shown above, we would say, x is a real number greater than or equal to 1 and less than or equal to 3, or a real number greater than 5.

As an inequality it is [latex]1\leq x\leq 3[/latex] or [latex]x \gt 5[/latex]

. In interval notation it is [latex][1,3]\cup(5,\infty)[/latex]

.

Example 11

Find the domain of each function:

a) [latex]f(x)=2\sqrt{x+4}[/latex]

b) [latex]g(x)=\dfrac{3}{6-3x}[/latex]

a) Since we cannot take the square root of a negative number, we need the inside of the square root to be non-negative. [latex]x+4\geq 0[/latex] when [latex]x\geq -4[/latex], so the domain of [latex]f(x)[/latex] is [latex][-4,\infty)[/latex].

b) We cannot divide by zero, so we need the denominator to be non-zero. [latex]6-3x=0[/latex] when [latex]x = 2[/latex], so we must exclude 2 from the domain. The domain of [latex]g(x)[/latex] is [latex](-\infty,2)\cup(2,\infty)[/latex].

**Video**

The domain of a function is the set of all possible input values for which the function is defined.

The range of a function is the set of all possible output values that the function can produce.

A function ** f** is a mathematical relation that maps elements from a set called the domain

**to a set called the codomain**

*X***. It associates each input element**

*Y**in the domain with a unique output element*

**x****in the codomain. The function can be defined using various notations, such as a formula, equation, or a set of rules. For example, we can define a function**

*f(x)**as follows:*

**f****f : X -->Y, f(x) = some expression involving x**

where ** f(x)** represents the value obtained by applying the function

**to the input**

*f***. The notation**

*x***indicates that the function**

*f: X--> Y**maps elements from the domain*

**f****to the codomain**

*X***. The specific expression or rule defining the function may vary depending on the context and the nature of the function.**

*Y*Consider a function ** f** defined by

**, where**

*f(x) = 2x + 3***is the input variable. It can also be written as**

*x**and we say*

**y = 2x +3***is a function of*

**y**

*x*The vertical line test is a way to check if a graph represents a function. Imagine drawing a vertical line anywhere on the graph. If that line touches the graph at only one point, then the graph represents a function. However, if the line touches the graph at multiple points, then the graph does not represent a function

The horizontal line test is a way to check if a function has a one-to-one relationship. Imagine drawing horizontal lines across the graph of a function. If any horizontal line intersects the graph at more than one point, then the function is not one-to-one because multiple inputs have the same output. However, if every horizontal line intersects the graph at most one point, then the function is one-to-one because each input has a unique output.