1.1 Review of Functions

Learning Objectives

In this section, you will learn to:
  • Use functional notation to evaluate a function.
  • Determine the domain and range of a function.
  • Draw the graph of a function.
  • Find the zeros of a function.
  • Recognize a function from a table of values.
  • Make new functions from two or more given functions.
  • Describe the symmetry properties of a function.

In this section, we lay out a formal definition of a function and look at several ways we can write one down — tables, formulas, and graphs. We also nail down the vocabulary mathematicians use when they talk about functions, define what it means to compose two functions, and explore what it means for a function to be symmetric. Most of this will be a refresher, but it is a useful reference: a lot of the algebra moves you will see in calculus come straight out of this section.

1.1.1 Functions

Definition 1.1.1: Function

Think of a function like a strict cafeteria worker: every student (input) gets exactly one entrée (output). Two students might be handed the same dish, but no single student walks away with two entrées. That "exactly one" rule is what separates a function from any old relation.

A function \(f\) consists of a set of inputs, a set of outputs, and a rule for assigning each input to exactly one output. The set of inputs is called the domain of the function. The set of outputs is called the range of the function.

For example, take the function \(f\) whose domain is all real numbers and whose rule is "square the input." Then \(f(3) = 3^2 = 9\). Every nonnegative real number is the square of some real number, so every nonnegative number lives in the range. No real number squares to a negative value, so negative numbers are excluded. The range is therefore the set of nonnegative reals.

For a general function \(f\) with domain \(D\), we usually use \(x\) for the input and \(y\) for the output paired with \(x\). We call \(x\) the independent variable and \(y\) the dependent variable (because \(y\) depends on \(x\)). In function notation, we write \(y = f(x)\) and read it as "y equals f of x." For the squaring function above, we write \(f(x) = x^2\).

We can picture the idea of a function using Figure 1.2, Figure 1.3, and Figure 1.4.

Figure 1.2 — A function can be visualized as an input/output device. Figure 1.2 — A function can be visualized as an input/output device.

Figure 1.2 — A function can be visualized as an input/output device.

Figure 1.3 — A function maps every element in the domain to exactly one element in the range. Figure 1.3 — A function maps every element in the domain to exactly one element in the range.

Figure 1.3 — A function maps every element in the domain to exactly one element in the range. Although each input can be sent to only one output, two different inputs can be sent to the same output.

Figure 1.4 — A graph of f with domain {1,2,3} and range {1,2}. Figure 1.4 — A graph of f with domain {1,2,3} and range {1,2}.

Figure 1.4 — In this case, a graph of a function \(f\) has a domain of \(\{1, 2, 3\}\) and a range of \(\{1, 2\}\). The independent variable is \(x\) and the dependent variable is \(y\).

We can also visualize a function by plotting points \((x, y)\) in the coordinate plane, where \(y = f(x)\). The graph of a function is the set of all such points. For example, take the function \(f\) with domain \(D = \{1, 2, 3\}\) and rule \(f(x) = 3 - x\). Figure 1.5 shows its graph.

Figure 1.5 — Graph of f(x) = 3 − x on domain {1,2,3}. Figure 1.5 — Graph of f(x) = 3 − x on domain {1,2,3}.

Figure 1.5 — Here we see a graph of the function \(f\) with domain \(\{1, 2, 3\}\) and rule \(f(x) = 3 - x\). The graph consists of the points \((x, f(x))\) for all \(x\) in the domain.

Every function has a domain. But sometimes a function is given by an equation like \(f(x) = x^2\) without any domain specified. In that case we use the natural domain: the set of all real numbers \(x\) for which \(f(x)\) gives back a real number. Any real number can be squared, so the natural domain of \(f(x) = x^2\) is all real numbers. The square-root function \(f(x) = \sqrt{x}\), on the other hand, gives a real output only when \(x\) is nonnegative, so its natural domain is \(\{x \mid x \ge 0\}\).

For the functions \(f(x) = x^2\) and \(f(x) = \sqrt{x}\), the domains are infinite sets — we cannot list every element. Two compact ways to describe infinite sets of real numbers are set-builder notation and interval notation. In set-builder notation, using \(\mathbb{R}\) for the set of all real numbers, we write

$$ \{x \mid x \text{ has some property}\} $$

and read it as "the set of real numbers \(x\) such that \(x\) has some property." For the real numbers strictly between \(1\) and \(5\), we would write

$$ \{x \mid 1 < x < 5\}. $$

That same set can be written using interval notation as \((a, b)\) for "all numbers between \(a\) and \(b\), exclusive." So

$$ (1, 5) = \{x \mid 1 < x < 5\}. $$

The numbers \(1\) and \(5\) are the endpoints of this set. If we want to include the endpoints, we write

$$ [1, 5] = \{x \mid 1 \le x \le 5\}. $$

We can include one endpoint and not the other using a mix of brackets and parentheses. To describe the set of nonnegative reals — no upper bound — we use the symbol \(\infty\) (positive infinity):

$$ [0, \infty) = \{x \mid 0 \le x\}. $$

Important: \(\infty\) is not a real number; it is a symbol that says "this set keeps going forever in the positive direction." Similarly, for all nonpositive numbers we write

$$ (-\infty, 0] = \{x \mid x \le 0\}. $$

The notation \(-\infty\) means negative infinity, indicating we include all numbers no matter how small. The set of all real numbers is

$$ (-\infty, \infty) = \{x \mid x \text{ is any real number}\}. $$

Summary of interval notation. The table below collects the forms introduced above for quick reference.

IntervalSet-builderIn words
\((a, b)\)\(\{x \mid a < x < b\}\)Between \(a\) and \(b\), endpoints excluded
\([a, b]\)\(\{x \mid a \le x \le b\}\)Between \(a\) and \(b\), endpoints included
\([a, b)\)\(\{x \mid a \le x < b\}\)Includes \(a\), excludes \(b\)
\((a, b]\)\(\{x \mid a < x \le b\}\)Excludes \(a\), includes \(b\)
\([a, \infty)\)\(\{x \mid a \le x\}\)\(a\) and everything above
\((-\infty, b]\)\(\{x \mid x \le b\}\)\(b\) and everything below
\((-\infty, \infty)\)\(\{x \mid x \in \mathbb{R}\}\)All real numbers

Some functions are defined by different equations on different parts of their domain. These are called piecewise-defined functions. For example, suppose we want a function \(f\) on all of \(\mathbb{R}\) such that \(f(x) = 3x + 1\) when \(x \ge 2\) and \(f(x) = x^2\) when \(x < 2\). We write

$$ f(x) = \begin{cases} 3x + 1 & x \ge 2 \\ x^2 & x < 2 \end{cases}. $$

To evaluate, we pick the equation that matches our input. Since \(5 \ge 2\), we use \(f(x) = 3x + 1\) and get \(f(5) = 3(5) + 1 = 16\). For \(x = -1 < 2\), we use \(f(x) = x^2\) and get \(f(-1) = 1\).

Given two sets \(A\) and \(B\), a set whose elements are ordered pairs \((x, y)\) — where \(x\) is from \(A\) and \(y\) is from \(B\) — is called a relation from \(A\) to \(B\). A relation simply describes some kind of pairing between the two sets. A function is a stricter kind of relation: each element of the first set is paired with exactly one element of the second set. We call the element from the first set the input and the element from the second set the output.

Functions are everywhere in math because they capture the idea that knowing one quantity lets you pin down another. The area of a square depends on its side length, so we say area is a function of side length. The velocity of a ball thrown in the air is a function of how long it has been in the air. The cost of mailing a package is a function of the package's weight. To study these relationships precisely, we need precise vocabulary.

Try It Now 1.1.1

For \(f(x) = x^2 - 3x + 5\), evaluate \(f(1)\) and \(f(a + h)\).

Solution

\(f(1) = (1)^2 - 3(1) + 5 = 1 - 3 + 5 = 3\).

For \(f(a + h)\), substitute \(a + h\) wherever \(x\) appears, then expand:

$$ \begin{aligned} f(a + h) &= (a + h)^2 - 3(a + h) + 5 \\ &= a^2 + 2ah + h^2 - 3a - 3h + 5. \end{aligned} $$

Answer: \(f(1) = 3\); \(f(a + h) = a^2 + 2ah + h^2 - 3a - 3h + 5\).

Example 1.1.1: Evaluating Functions

For the function \(f(x) = 3x^2 + 2x - 1\), evaluate:

  1. 1. \(f(-2)\)
  2. 2. \(f(\sqrt{2})\)
  3. 3. \(f(a + h)\)
Solution

Substitute the given value for \(x\) into the formula for \(f(x)\).

1. \(f(-2) = 3(-2)^2 + 2(-2) - 1 = 12 - 4 - 1 = 7\).

2. \(f(\sqrt{2}) = 3(\sqrt{2})^2 + 2\sqrt{2} - 1 = 6 + 2\sqrt{2} - 1 = 5 + 2\sqrt{2}\).

3. Expand carefully — \((a + h)^2 = a^2 + 2ah + h^2\):

$$ \begin{aligned} f(a + h) &= 3(a + h)^2 + 2(a + h) - 1 \\ &= 3(a^2 + 2ah + h^2) + 2a + 2h - 1 \\ &= 3a^2 + 6ah + 3h^2 + 2a + 2h - 1. \end{aligned} $$

Answer: \(f(-2) = 7\), \(f(\sqrt{2}) = 5 + 2\sqrt{2}\), \(f(a + h) = 3a^2 + 6ah + 3h^2 + 2a + 2h - 1\).

Example 1.1.2: Finding Domain and Range

For each function, determine the (i) domain and (ii) range.

  1. 1. \(f(x) = (x - 4)^2 + 5\)
  2. 2. \(f(x) = \sqrt{3x + 2} - 1\)
  3. 3. \(f(x) = \dfrac{3}{x - 2}\)
Solution

1. \(f(x) = (x - 4)^2 + 5\).

Domain: \((x - 4)^2 + 5\) is a real number for every real \(x\), so the domain is \((-\infty, \infty)\).

Range: \((x - 4)^2 \ge 0\), so \(f(x) \ge 5\). The range sits inside \(\{y \mid y \ge 5\}\). To confirm every \(y \ge 5\) is hit, solve \((x - 4)^2 + 5 = y\):

$$ (x - 4)^2 = y - 5 \quad\Rightarrow\quad x - 4 = \pm\sqrt{y - 5}. $$

Since \(y \ge 5\), the square root is defined, and \(x = 4 \pm \sqrt{y - 5}\) gives valid inputs. So the range is \(\{y \mid y \ge 5\}\).

2. \(f(x) = \sqrt{3x + 2} - 1\).

Domain: We need \(3x + 2 \ge 0\), so \(x \ge -\tfrac{2}{3}\). Domain: \(\{x \mid x \ge -\tfrac{2}{3}\}\).

Range: \(\sqrt{3x + 2} \ge 0\), so \(f(x) \ge -1\). For any \(y \ge -1\), set \(\sqrt{3x + 2} - 1 = y\). Then \(\sqrt{3x + 2} = y + 1\); squaring, \(3x + 2 = (y + 1)^2\), so

$$ x = \tfrac{1}{3}(y + 1)^2 - \tfrac{2}{3}. $$

This value is at least \(-\tfrac{2}{3}\), so it lies in the domain. Range: \(\{y \mid y \ge -1\}\).

3. \(f(x) = \dfrac{3}{x - 2}\).

Domain: The denominator is nonzero whenever \(x \ne 2\). Domain: \(\{x \mid x \ne 2\}\).

Range: Solve \(\dfrac{3}{x - 2} = y\) for \(x\): \(x = \dfrac{3}{y} + 2\). As long as \(y \ne 0\), such an \(x\) exists. Range: \(\{y \mid y \ne 0\}\).

Answer: 1. Domain \((-\infty, \infty)\); range \(\{y \mid y \ge 5\}\). 2. Domain \(\{x \mid x \ge -\tfrac{2}{3}\}\); range \(\{y \mid y \ge -1\}\). 3. Domain \(\{x \mid x \ne 2\}\); range \(\{y \mid y \ne 0\}\).

1.1.2 Representing Functions

Definition 1.1.2: Increasing and Decreasing Functions

We say that a function \(f\) is increasing on the interval \(I\) if for all \(x_1, x_2 \in I\),

$$ f(x_1) \le f(x_2) \text{ when } x_1 < x_2. $$

We say \(f\) is strictly increasing on \(I\) if for all \(x_1, x_2 \in I\),

$$ f(x_1) < f(x_2) \text{ when } x_1 < x_2. $$

We say that a function \(f\) is decreasing on \(I\) if for all \(x_1, x_2 \in I\),

$$ f(x_1) \ge f(x_2) \text{ if } x_1 < x_2. $$

We say that \(f\) is strictly decreasing on \(I\) if for all \(x_1, x_2 \in I\),

$$ f(x_1) > f(x_2) \text{ if } x_1 < x_2. $$

Plain-English unpacking. Walk left to right along the graph. If the height never drops as you move right, the function is increasing; if it always strictly rises, it is strictly increasing. If the height never rises, it is decreasing; if it always strictly falls, it is strictly decreasing. The word "strictly" rules out flat stretches.

For example, \(f(x) = 3x\) is increasing on \((-\infty, \infty)\) because \(3x_1 < 3x_2\) whenever \(x_1 < x_2\). The function \(f(x) = -x^3\) is strictly decreasing on \((-\infty, \infty)\) because \(-x_1^3 > -x_2^3\) whenever \(x_1 < x_2\) (Figure 1.11).

Figure 1.11 — (a) The function \(f(x) = 3x\) is increasing on the interval \((-\infty, \infty)\). (b) The function \(f(x) = -x^3\) is decreasing on the interval \((-\infty, \infty)\).

Typically a function is represented using one or more of the following tools:

We can recognize a function in any of these forms, and they often work better together — we plot points from a table, or build a table from a formula and then graph it.

Tables

Functions described by a table show up constantly in real-world data. Suppose we record the outside temperature every hour for a 24-hour period starting at midnight. Let the input \(x\) be the number of hours past midnight, and the output \(y\) be the temperature in degrees Fahrenheit at that time. We can summarize the data in Table 1.1.

Functions are how we talk about cause-and-effect with numbers. Drop a coin into a vending machine, push a button, get a soda — that vending machine is a function: input (your button choice) goes in, exactly one output (your soda) comes out. Throughout calculus, every rate of change, every area under a curve, every optimization problem you will solve starts with a function. Getting comfortable here pays dividends for the entire course.

Table 1.1 — Temperature (°F) as a function of hours after midnight.

Hours after midnight \(x\) 0 1 2 3 4 5 6 7 8 9 10 11
Temperature °F \(y\) 58 55 53 52 52 53 55 60 64 70 75 78
Hours after midnight \(x\) 12 13 14 15 16 17 18 19 20 21 22 23
Temperature °F \(y\) 80 85 85 84 83 80 77 73 69 65 60 58

We can see from the table that temperature is a function of time. The temperature decreases, then increases, then decreases again. Without a graph, though, it is hard to picture the overall shape of the function.

Graphs

Given a function \(f\) described by a table, we can give a visual picture of \(f\) by plotting its points on a graph. Graphing the temperatures from Table 1.1 makes the pattern of the day much clearer. Figure 1.6 shows the plot.

Figure 1.6 — Temperature as a function of time (scatter). Figure 1.6 — Temperature as a function of time (scatter).

Figure 1.6 — The graph of the data from Table 1.1 shows temperature as a function of time.

From the plotted points we can imagine the general shape of the graph. It is often useful to connect the dots. We can't say for certain what the temperature was between recorded hours, but with this many data points and a clear trend, it is reasonable to suspect the in-between values followed a similar curve, as shown in Figure 1.7.

Figure 1.7 — Connecting the dots in Figure 1.6 shows the general pattern. Figure 1.7 — Connecting the dots in Figure 1.6 shows the general pattern.

Figure 1.7 — Connecting the dots in Figure 1.6 shows the general pattern of the data.

Algebraic Formulas

Sometimes a function comes to us not as a table but as an explicit formula. Formulas crop up in almost every applied setting. The area of a circle with radius \(r\) is \(A(r) = \pi r^2\). When an object is thrown upward from the ground with initial velocity \(v_0\) ft/s, its height above the ground until it lands is \(s(t) = -16t^2 + v_0 t\). When \(P\) dollars are invested at an annual rate \(r\) compounded continuously, the account balance after \(t\) years is \(A(t) = P e^{rt}\). Algebraic formulas are useful for computing exact values; we also like to picture them as graphs.

Why bother with all three representations — table, graph, formula? Because each one is good at a different thing. Tables are honest about real data. Graphs make shape and trend pop out. Formulas let you predict values you never measured. A practicing engineer or scientist switches between them all day long.

Given an algebraic formula for a function \(f\), the graph of \(f\) is the set of points \((x, f(x))\) for all \(x\) in the domain. To graph by hand, start by building a small table of inputs and outputs. The domain may be infinite, but listing a handful of strategic points is a great start.

When building that table, we usually check whether zero is ever an output. The values of \(x\) where \(f(x) = 0\) are called the zeros of a function. For example, the zeros of \(f(x) = x^2 - 4\) are \(x = \pm 2\). Zeros are exactly the places where the graph of \(f\) crosses the \(x\)-axis. A graph might never cross the \(x\)-axis, or cross it many times — even infinitely often.

Another point worth checking is the \(y\)-intercept, if it exists. The \(y\)-intercept is the point \((0, f(0))\).

A function has at most one \(y\)-intercept: if \(x = 0\) is in the domain there is exactly one, and if not, there is none. More generally, for any real \(c\) in the domain, there is exactly one output \(f(c)\), and the vertical line \(x = c\) meets the graph exactly once. If \(c\) is not in the domain, the vertical line \(x = c\) does not meet the graph at all. This observation gives a quick visual test:

Rule: Vertical Line Test

A set of points in the plane is the graph of a function of \(x\) if and only if every vertical line intersects the set at most once.

We can use this test on a picture to decide whether a set of plotted points is the graph of a function (Figure 1.8).

Figure 1.8 — (a) The set of plotted points represents the graph of a function because every vertical line intersects the set of points, at most, once. (b) The set of plotted points does not represent the graph of a function because some vertical lines intersect the set of points more than once.

Try It Now 1.1.2

Find the domain and range for \(f(x) = \sqrt{4 - 2x} + 5\).

Solution

Domain: We need \(4 - 2x \ge 0\), so \(x \le 2\). Domain: \(\{x \mid x \le 2\}\), or \((-\infty, 2]\).

Range: \(\sqrt{4 - 2x} \ge 0\), so \(f(x) \ge 5\). For any target \(y \ge 5\), solve \(\sqrt{4 - 2x} + 5 = y\) for \(x\):

$$ \sqrt{4 - 2x} = y - 5 \;\Rightarrow\; 4 - 2x = (y - 5)^2 \;\Rightarrow\; x = 2 - \tfrac{1}{2}(y - 5)^2. $$

This \(x\) is at most \(2\), so it lies in the domain. Range: \(\{y \mid y \ge 5\}\), or \([5, \infty)\).

Answer: Domain \((-\infty, 2]\); range \([5, \infty)\).

When tracing a function's graph from left to right, its output either rises, falls, or stays flat as the input increases. The following definition captures these two behaviors precisely.

Try It Now 1.1.3

Find the zeros of \(f(x) = x^3 - 5x^2 + 6x\).

Solution

Factor: \(x^3 - 5x^2 + 6x = x(x^2 - 5x + 6) = x(x - 2)(x - 3)\). Set each factor to zero.

Answer: \(x = 0,\ 2,\ 3\).

Example 1.1.3: Finding Zeros and \(y\)-Intercepts of a Function

Consider the function \(f(x) = -4x + 2\).

  1. 1. Find all zeros of \(f\).
  2. 2. Find the \(y\)-intercept (if any).
  3. 3. Sketch a graph of \(f\).
Solution

1. Solve \(-4x + 2 = 0\): \(x = \tfrac{1}{2}\). So \(f\) has one zero at \(x = \tfrac{1}{2}\).

2. The \(y\)-intercept is \((0, f(0)) = (0, 2)\).

3. \(f\) is a linear function passing through \((\tfrac{1}{2}, 0)\) and \((0, 2)\):

Figure 1.9 — The function f(x) = -4x + 2 is a line with x-intercept (1/2, 0) and y-intercept (0, 2). Figure 1.9 — The function f(x) = -4x + 2 is a line with x-intercept (1/2, 0) and y-intercept (0, 2).

Figure 1.9 — The function f(x) = -4x + 2 is a line with x-intercept (1/2, 0) and y-intercept (0, 2).

Answer: Zero at \(x = \tfrac{1}{2}\); \(y\)-intercept at \((0, 2)\); the graph is the line through those two points.

Example 1.1.4: Using Zeros and \(y\)-Intercepts to Sketch a Graph

Consider the function \(f(x) = \sqrt{x + 3} + 1\).

  1. 1. Find all zeros of \(f\).
  2. 2. Find the \(y\)-intercept (if any).
  3. 3. Sketch a graph of \(f\).
Solution

1. Solve \(\sqrt{x + 3} + 1 = 0\), i.e. \(\sqrt{x + 3} = -1\). Since \(\sqrt{x + 3} \ge 0\) for every \(x\) in the domain, this has no solution. So \(f\) has no zeros.

2. \(y\)-intercept: \((0, f(0)) = (0, \sqrt{3} + 1)\).

3. Build a table. We need \(x + 3 \ge 0\), i.e. \(x \ge -3\). Pick \(x\) values that make the square root clean:

\(x\) \(-3\) \(-2\) \(1\)
\(f(x)\) \(1\) \(2\) \(3\)

Table 1.2

The graph is a shifted square-root curve:

Figure 1.10 — The graph of f(x) = √(x+3) + 1 has a y-intercept but no x-intercepts. Figure 1.10 — The graph of f(x) = √(x+3) + 1 has a y-intercept but no x-intercepts.

Figure 1.10 — The graph of f(x) = √(x+3) + 1 has a y-intercept but no x-intercepts.

Answer: No zeros; \(y\)-intercept \((0, \sqrt{3} + 1)\); graph is the standard \(\sqrt{x}\) curve shifted left 3 and up 1.

Example 1.1.5: Finding the Height of a Free-Falling Object

If a ball is dropped from a height of \(100\) ft, its height \(s\) at time \(t\) is given by \(s(t) = -16t^2 + 100\), where \(s\) is in feet and \(t\) is in seconds. The domain is restricted to \([0, c]\), where \(t = 0\) is when the ball is dropped and \(t = c\) is when it hits the ground.

  1. 1. Create a table showing \(s(t)\) at \(t = 0, 0.5, 1, 1.5, 2,\) and \(2.5\). From the table, determine the domain — that is, find the time \(c\) when the ball hits the ground.
  2. 2. Sketch a graph of \(s\).
Solution

1. Plug each \(t\) into \(-16t^2 + 100\):

\(t\) \(0\) \(0.5\) \(1\) \(1.5\) \(2\) \(2.5\)
\(s(t)\) \(100\) \(96\) \(84\) \(64\) \(36\) \(0\)

Table 1.3 — Height \(s\) as a function of time \(t\).

The ball hits the ground when \(s(t) = 0\), at \(t = 2.5\). So the domain is \([0, 2.5]\).

2.

Graph of s(t) = -16t² + 100, the height of a free-falling ball on [0, 2.5]. Graph of s(t) = -16t² + 100, the height of a free-falling ball on [0, 2.5].

Graph of s(t) = -16t² + 100, the height of a free-falling ball on [0, 2.5].

Figure — Graph of \(s(t) = -16t^2 + 100\), the height of a free-falling ball, on the interval \([0, 2.5]\).

Answer: Domain \([0, 2.5]\); graph is the portion of \(s = -16t^2 + 100\) from \(t = 0\) to \(t = 2.5\).

1.1.3 Combining Functions

Definition 1.1.3: Composite Function

Consider the function \(f\) with domain \(A\) and range \(B\), and the function \(g\) with domain \(D\) and range \(E\). If \(B\) is a subset of \(D\), then the composite function \((g \circ f)(x)\) is the function with domain \(A\) such that

$$ (g \circ f)(x) = g(f(x)). $$

Plain-English unpacking. Two steps:

  1. 1. \(f\) takes \(x\) in its domain to \(f(x)\) in its range.
  2. 2. Because the range of \(f\) lives inside the domain of \(g\), we can hand \(f(x)\) to \(g\) and get \(g(f(x))\) in the range of \(g\).

That two-step pipeline is what we mean by "composition." Figure 1.12 (in the Function Composition subsection below) visualizes it.

Now that we have reviewed the basics of functions, we can ask what happens when we glue functions together to make new ones. For example, if a company's cost to make \(x\) items is \(C(x)\) and its revenue from selling those \(x\) items is \(R(x)\), then profit is \(P(x) = R(x) - C(x)\). Subtraction of two functions produced a brand-new function.

Another way to build a new function is to compose two existing ones — feed the output of one into the input of the other. Given \(f(x) = x^2\) and \(g(x) = 3x + 1\), the composite \(f \circ g\) is defined by

$$ (f \circ g)(x) = f(g(x)) = (g(x))^2 = (3x + 1)^2. $$

Compose the other way and we get a different function:

$$ (g \circ f)(x) = g(f(x)) = 3 f(x) + 1 = 3x^2 + 1. $$

Note carefully: \(f \circ g\) and \(g \circ f\) are not the same. Order matters.

Combining Functions with Mathematical Operators

To combine functions using arithmetic, just write them with the operator between them and simplify. Given functions \(f\) and \(g\), we get four new functions:

$$ \begin{aligned} (f + g)(x) &= f(x) + g(x) && \text{(Sum)} \\ (f - g)(x) &= f(x) - g(x) && \text{(Difference)} \\ (f \cdot g)(x) &= f(x)\, g(x) && \text{(Product)} \\ \left(\tfrac{f}{g}\right)\!(x) &= \dfrac{f(x)}{g(x)} \text{ for } g(x) \ne 0 && \text{(Quotient)} \end{aligned} $$

Combining functions is just combining their outputs, point by point. If at \(x = 4\) we have \(f(4) = 7\) and \(g(4) = 2\), then \((f + g)(4) = 9\), \((f \cdot g)(4) = 14\), and \((f / g)(4) = 3.5\). The variable is along for the ride; the arithmetic happens to the outputs.

For the sum, difference, and product, we just need both \(f\) and \(g\) to accept the input — addition, subtraction, and multiplication never fail on individual numbers. So the domain is exactly the inputs where both \(f\) and \(g\) are defined.

The quotient is the picky one. It also needs both functions defined, but it has one extra rule we can never break: dividing by zero is not allowed. So even if \(f\) is perfectly happy at some \(x\), we still throw that \(x\) out if \(g(x) = 0\). That's why \((f/g)\) is the only combination that needs an extra domain check — division is the only operation that can fail on individual numbers.

To actually compute a combined function at some input \(x\), we just go in steps. Plug \(x\) into \(f\) and get the number \(f(x)\). Plug \(x\) into \(g\) and get the number \(g(x)\). Then add, subtract, multiply, or divide those two outputs — whichever combination we want. To get a single formula that works for all valid inputs, we keep \(x\) as a variable and do the same arithmetic on the expressions. The result might look longer than either of the originals, but at any specific input it's still the same thing: two outputs, one arithmetic step.

Try It Now 1.1.4

For \(f(x) = x^2 + 3\) and \(g(x) = 2x - 5\), find \((f / g)(x)\) and state its domain.

Solution

\((f/g)(x) = \dfrac{f(x)}{g(x)} = \dfrac{x^2 + 3}{2x - 5}\). The denominator is zero when \(2x - 5 = 0\), i.e. \(x = \tfrac{5}{2}\), so we exclude that one value.

Answer: \((f/g)(x) = \dfrac{x^2 + 3}{2x - 5}\), domain \(\{x \mid x \ne \tfrac{5}{2}\}\).

Example 1.1.6: Combining Functions Using Mathematical Operations

Given \(f(x) = 2x - 3\) and \(g(x) = x^2 - 1\), find each new function and state its domain.

  1. 1. \((f + g)(x)\)
  2. 2. \((f - g)(x)\)
  3. 3. \((f \cdot g)(x)\)
  4. 4. \(\left(\dfrac{f}{g}\right)\!(x)\)
Solution

1. \((f + g)(x) = (2x - 3) + (x^2 - 1) = x^2 + 2x - 4\). Domain: \((-\infty, \infty)\).

2. \((f - g)(x) = (2x - 3) - (x^2 - 1) = -x^2 + 2x - 2\). Domain: \((-\infty, \infty)\).

3. \((f \cdot g)(x) = (2x - 3)(x^2 - 1) = 2x^3 - 3x^2 - 2x + 3\). Domain: \((-\infty, \infty)\).

4. \(\left(\dfrac{f}{g}\right)\!(x) = \dfrac{2x - 3}{x^2 - 1}\). Since \(x^2 - 1 = 0\) when \(x = \pm 1\), domain: \(\{x \mid x \ne \pm 1\}\).

Answer: sum \(x^2 + 2x - 4\); difference \(-x^2 + 2x - 2\); product \(2x^3 - 3x^2 - 2x + 3\); quotient \(\dfrac{2x - 3}{x^2 - 1}\) with \(x \ne \pm 1\).

Function Composition

Figure 1.12 — For g∘f we have (g∘f)(1)=4, (g∘f)(2)=5, (g∘f)(3)=4. Figure 1.12 — For g∘f we have (g∘f)(1)=4, (g∘f)(2)=5, (g∘f)(3)=4.

Figure 1.12 — For the composite function \(g \circ f\), we have \((g \circ f)(1) = 4\), \((g \circ f)(2) = 5\), and \((g \circ f)(3) = 4\).

When we compose functions, we take a function of a function. For example, suppose the temperature \(T\) on a given day is a function of time \(t\) (in hours past midnight), as in Table 1.1. And suppose the cost \(C\) to heat or cool a building for an hour is a function of the temperature \(T\). Combining these, we describe the cost of climate-controlling the building as a function of time by evaluating \(C(T(t))\). This new function is written \(C \circ T\), defined by \((C \circ T)(t) = C(T(t))\) for every \(t\) in the domain of \(T\). It is called a composite function. We note: cost is a function of temperature, and temperature is a function of time, so \(C \circ T\) makes sense. But \(T \circ C\) does not — temperature is not a function of cost.

Try It Now 1.1.5

Let \(f(x) = 2 - 5x\) and \(g(x) = \sqrt{x}\). Find \((f \circ g)(x)\).

Solution

\((f \circ g)(x) = f(g(x)) = f(\sqrt{x}) = 2 - 5\sqrt{x}\). The domain comes from \(g\), so \(x \ge 0\).

Answer: \((f \circ g)(x) = 2 - 5\sqrt{x}\), domain \([0, \infty)\).

Example 1.1.7: Compositions of Functions Defined by Formulas

Consider \(f(x) = x^2 + 1\) and \(g(x) = 1/x\).

  1. 1. Find \((g \circ f)(x)\) and state its domain and range.
  2. 2. Evaluate \((g \circ f)(4)\) and \((g \circ f)(-1/2)\).
  3. 3. Find \((f \circ g)(x)\) and state its domain and range.
  4. 4. Evaluate \((f \circ g)(4)\) and \((f \circ g)(-1/2)\).
Solution

1. \((g \circ f)(x) = g(f(x)) = g(x^2 + 1) = \dfrac{1}{x^2 + 1}\).

Since \(x^2 + 1 \ne 0\) for every real \(x\), domain: all real numbers, \((-\infty, \infty)\).

For the range: \(x^2 + 1 \ge 1\), so \(0 < \dfrac{1}{x^2 + 1} \le 1\). Range sits inside \((0, 1]\). To confirm every value in \((0, 1]\) is hit, solve \(\dfrac{1}{x^2 + 1} = y\): \(x^2 + 1 = \dfrac{1}{y}\), so \(x = \pm\sqrt{\dfrac{1}{y} - 1}\). For \(y \in (0, 1]\), the radical is nonnegative, so a real \(x\) exists. Range: \((0, 1]\).

2. \((g \circ f)(4) = g(4^2 + 1) = g(17) = \dfrac{1}{17}\).

\((g \circ f)\!\left(-\tfrac{1}{2}\right) = g\!\left((-\tfrac{1}{2})^2 + 1\right) = g\!\left(\tfrac{5}{4}\right) = \dfrac{4}{5}\).

3. \((f \circ g)(x) = f(g(x)) = f\!\left(\dfrac{1}{x}\right) = \left(\dfrac{1}{x}\right)^2 + 1\).

Domain: all real \(x\) with \(x \ne 0\). For the range, set \(\left(\dfrac{1}{x}\right)^2 + 1 = y\); then \(\left(\dfrac{1}{x}\right)^2 = y - 1\), so \(\dfrac{1}{x} = \pm\sqrt{y - 1}\) and finally

$$ x = \pm\dfrac{1}{\sqrt{y - 1}}. $$

This is real if and only if \(y > 1\). Range: \(\{y \mid y > 1\}\).

4. \((f \circ g)(4) = f\!\left(\tfrac{1}{4}\right) = \left(\tfrac{1}{4}\right)^2 + 1 = \tfrac{17}{16}\).

\((f \circ g)\!\left(-\tfrac{1}{2}\right) = f(-2) = (-2)^2 + 1 = 5\).

Answer: \((g \circ f)(x) = \dfrac{1}{x^2 + 1}\), domain \((-\infty, \infty)\), range \((0, 1]\); \((f \circ g)(x) = \dfrac{1}{x^2} + 1\), domain \(\{x \ne 0\}\), range \(\{y > 1\}\); specific evaluations as above.

Example 1.1.7 confirms in concrete terms that \((f \circ g)(x) \ne (g \circ f)(x)\) in general — order of composition matters.

Try It Now 1.1.6

If items are on sale for \(10\%\) off their original price, and a customer has a coupon for an additional \(30\%\) off, what will be the final price for an item that is originally \(x\) dollars, after applying the coupon to the sale price?

Solution

Sale price: \(f(x) = 0.90 x\). Post-coupon price: \(g(y) = 0.70 y\). Composing,

$$ g(f(x)) = 0.70 \cdot (0.90 x) = 0.63 x. $$

Answer: \(0.63 x\) dollars — a \(37\%\) total discount.

Example 1.1.8: Composition of Functions Defined by Tables

Consider the functions \(f\) and \(g\) described by Table 1.4 and Table 1.5.

  1. 1. Evaluate \((g \circ f)(3)\) and \((g \circ f)(0)\).
  2. 2. State the domain and range of \((g \circ f)(x)\).
  3. 3. Evaluate \((f \circ f)(3)\) and \((f \circ f)(1)\).
  4. 4. State the domain and range of \((f \circ f)(x)\).
Solution

1. \((g \circ f)(3) = g(f(3)) = g(-2) = 0\). \((g \circ f)(0) = g(f(0)) = g(4) = 5\).

2. Domain of \(g \circ f\): \(\{-3, -2, -1, 0, 1, 2, 3, 4\}\). Since the range of \(f\) is \(\{-2, 0, 2, 4\}\), the range of \(g \circ f\) is \(\{0, 3, 5\}\).

3. \((f \circ f)(3) = f(f(3)) = f(-2) = 4\). \((f \circ f)(1) = f(f(1)) = f(-2) = 4\).

4. Domain of \(f \circ f\): \(\{-3, -2, -1, 0, 1, 2, 3, 4\}\). Range of \(f\) is \(\{-2, 0, 2, 4\}\), so range of \(f \circ f\) is \(\{0, 4\}\).

Answer: Results as listed in each part above.

Example 1.1.9: Application Involving a Composite Function

A store advertises a sale of \(20\%\) off all merchandise. Caroline has a coupon for an additional \(15\%\) off any item, including sale merchandise. If Caroline buys an item with an original price of \(x\) dollars, how much will she pay after applying the coupon to the sale price? Solve using a composite function.

Solution

The sale price is \(20\%\) off the original, so if the original price is \(x\), the sale price is

$$ f(x) = 0.80 x. $$

The coupon takes \(15\%\) off whatever price is shown, so if the shown price is \(y\), the post-coupon price is

$$ g(y) = 0.85 y. $$

Applying the coupon to the sale price means evaluating \(g(f(x))\):

$$ g(f(x)) = 0.85 \cdot (0.80 x) = 0.68 x. $$

Answer: Caroline pays \(0.68 x\) dollars — a \(32\%\) total discount.

1.1.4 Symmetry of Functions

Definition 1.1.4: Even and Odd Functions

If \(f(-x) = f(x)\) for all \(x\) in the domain of \(f\), then \(f\) is an even function. An even function is symmetric about the \(y\)-axis.

If \(f(-x) = -f(x)\) for all \(x\) in the domain of \(f\), then \(f\) is an odd function. An odd function is symmetric about the origin.

"Even" and "odd" come from polynomial behavior. Pure even powers like \(x^2, x^4, x^6\) are even functions (\((-x)^n = x^n\) when \(n\) is even). Pure odd powers like \(x, x^3, x^5\) are odd functions (\((-x)^n = -x^n\) when \(n\) is odd). Add constants or mixed terms and you can break either property — which is exactly why most polynomials are neither.

The graphs of certain functions have symmetry properties that help us understand the shape of the curve. Consider \(f(x) = x^4 - 2x^2 - 3\) in Figure 1.13(a). Take the part of the curve to the right of the \(y\)-axis, flip it across the \(y\)-axis, and it lays exactly on top of the part to the left of the \(y\)-axis. We say the function is symmetric about the \(y\)-axis. Now consider \(f(x) = x^3 - 4x\) in Figure 1.13(b). Rotate the graph \(180^\circ\) about the origin and it looks identical. We say the function is symmetric about the origin.

Figure 1.13 — (a) A graph that is symmetric about the \(y\)-axis. (b) A graph that is symmetric about the origin.

We can spot these symmetries from a graph easily — but how can we detect them algebraically, with no picture in hand? Look at Figure 1.13 again: since \(f\) is symmetric about the \(y\)-axis, whenever \((x, y)\) is on the graph, so is \((-x, y)\). In other words, \(f(-x) = f(x)\). A function with this property is called an even function. For example, \(f(x) = x^2\) is even because

$$ f(-x) = (-x)^2 = x^2 = f(x). $$

By contrast, if \(f\) is symmetric about the origin, whenever \((x, y)\) is on the graph, so is \((-x, -y)\). In other words, \(f(-x) = -f(x)\). A function with this property is called an odd function. For example, \(f(x) = x^3\) is odd because

$$ f(-x) = (-x)^3 = -x^3 = -f(x). $$
Try It Now 1.1.7

Determine whether \(f(x) = 4x^3 - 5x\) is even, odd, or neither.

Solution

\(f(-x) = 4(-x)^3 - 5(-x) = -4x^3 + 5x = -(4x^3 - 5x) = -f(x)\).

Answer: \(f\) is odd.

Example 1.1.10: Even and Odd Functions

Determine whether each function is even, odd, or neither.

  1. 1. \(f(x) = -5x^4 + 7x^2 - 2\)
  2. 2. \(f(x) = 2x^5 - 4x + 5\)
  3. 3. \(f(x) = \dfrac{3x}{x^2 + 1}\)
Solution

To check, plug in \(-x\) and compare to \(f(x)\) and \(-f(x)\).

1. \(f(-x) = -5(-x)^4 + 7(-x)^2 - 2 = -5x^4 + 7x^2 - 2 = f(x)\). So \(f\) is even.

2. \(f(-x) = 2(-x)^5 - 4(-x) + 5 = -2x^5 + 4x + 5\). Compare: \(f(x) = 2x^5 - 4x + 5\) and \(-f(x) = -2x^5 + 4x - 5\). \(f(-x) \ne f(x)\) and \(f(-x) \ne -f(x)\), so \(f\) is neither.

3. \(f(-x) = \dfrac{3(-x)}{(-x)^2 + 1} = \dfrac{-3x}{x^2 + 1} = -\dfrac{3x}{x^2 + 1} = -f(x)\). So \(f\) is odd.

Answer: (1) even; (2) neither; (3) odd.

One symmetric function that comes up constantly is the absolute value function, written \(|x|\). It is piecewise-defined:

$$ f(x) = \begin{cases} -x, & x < 0 \\ x, & x \ge 0 \end{cases}. $$

Some students describe this function by saying "it makes everything positive." That's almost right. From the definition: if \(x < 0\), then \(|x| = -x > 0\); if \(x > 0\), then \(|x| = x > 0\). But at \(x = 0\), \(|x| = 0\). So a more accurate description is: for every nonzero input the output is positive, and at zero the output is zero. The range is therefore \(\{y \mid y \ge 0\}\). Figure 1.14 shows that \(|x|\) is symmetric about the \(y\)-axis — so it is an even function.

Figure 1.14 — The graph of f(x) = |x| is symmetric about the y-axis. Figure 1.14 — The graph of f(x) = |x| is symmetric about the y-axis.

Figure 1.14 — The graph of \(f(x) = |x|\) is symmetric about the \(y\)-axis.

Try It Now 1.1.8

For \(f(x) = |x + 2| - 4\), find the domain and range.

Solution

Domain: \(|x + 2|\) is defined for every real number, so the domain is \((-\infty, \infty)\).

Range: \(|x + 2| \ge 0\), so \(f(x) \ge -4\). For any target \(y \ge -4\), we can solve \(|x + 2| - 4 = y\) by taking \(x + 2 = \pm(y + 4)\), giving \(x = -2 \pm (y + 4)\). So every value \(y \ge -4\) is hit.

Answer: Domain \((-\infty, \infty)\); range \(\{y \mid y \ge -4\} = [-4, \infty)\).

Example 1.1.11: Working with the Absolute Value Function

Find the domain and range of \(f(x) = 2|x - 3| + 4\).

Solution

The absolute value function is defined for every real number, so the domain is \((-\infty, \infty)\).

Since \(|x - 3| \ge 0\) for every \(x\), we have \(f(x) = 2|x - 3| + 4 \ge 4\). So the range sits inside \(\{y \mid y \ge 4\}\). To check that every \(y \ge 4\) is actually achieved, solve \(2|x - 3| + 4 = y\):

$$ |x - 3| = \tfrac{1}{2}(y - 4). $$

Since \(y \ge 4\), the right-hand side is nonnegative, so a solution can exist. Recall

$$ |x - 3| = \begin{cases} -(x - 3) & x < 3 \\ x - 3 & x \ge 3 \end{cases}. $$

So we get two solutions:

$$ x = \pm \tfrac{1}{2}(y - 4) + 3. $$

The range is therefore \(\{y \mid y \ge 4\}\).

Answer: Domain \((-\infty, \infty)\); range \(\{y \mid y \ge 4\}\), i.e. \([4, \infty)\).

Problem Set 1.1

Source: OpenStax Calculus Volume 1

For the following exercises, (a) determine the domain and the range of each relation, and (b) state whether the relation is a function.

Problem 1. Relation given by the table

\(x\) \(y\)
\(-3\) \(9\)
\(-2\) \(4\)
\(-1\) \(1\)
\(0\) \(0\)
\(1\) \(1\)
\(2\) \(4\)
\(3\) \(9\)

Problem 2. Relation given by the table

\(x\) \(y\)
\(-3\) \(-2\)
\(-2\) \(-8\)
\(-1\) \(-1\)
\(0\) \(0\)
\(1\) \(1\)
\(2\) \(8\)
\(3\) \(-2\)

Problem 3. Relation given by the table

\(x\) \(y\)
\(1\) \(-3\)
\(2\) \(-2\)
\(3\) \(-1\)
\(0\) \(0\)
\(1\) \(1\)
\(2\) \(2\)
\(3\) \(3\)

Problem 4. Relation given by the table

\(x\) \(y\)
\(1\) \(1\)
\(2\) \(1\)
\(3\) \(1\)
\(4\) \(1\)
\(5\) \(1\)
\(6\) \(1\)
\(7\) \(1\)

Problem 5. Relation given by the table

\(x\) \(y\)
\(3\) \(3\)
\(5\) \(2\)
\(8\) \(1\)
\(10\) \(0\)
\(15\) \(1\)
\(21\) \(2\)
\(33\) \(3\)

Problem 6. Relation given by the table

\(x\) \(y\)
\(-7\) \(11\)
\(-2\) \(5\)
\(-2\) \(1\)
\(0\) \(-1\)
\(1\) \(-2\)
\(3\) \(4\)
\(6\) \(11\)

a) \(f(0)\)

b) \(f(1)\)

c) \(f(3)\)

d) \(f(-x)\)

e) \(f(a)\)

f) \(f(a + h)\)

Solutions 1–6

Problem 1

Step 1 — Read off the domain:

The domain is the set of all \(x\)-values that appear in the table.

$$\text{Domain} = \{-3,\, -2,\, -1,\, 0,\, 1,\, 2,\, 3\}$$

Step 2 — Read off the range:

The range is the set of distinct \(y\)-values that appear in the table. The values \(9,\, 4,\, 1,\, 0,\, 1,\, 4,\, 9\) reduce (after removing duplicates) to:

$$\text{Range} = \{0,\, 1,\, 4,\, 9\}$$

Step 3 — Check the function test:

A relation is a function exactly when every input \(x\) is paired with only one output \(y\). Scanning the table, each \(x\)-value appears exactly once, so each input has a unique output.

Answer: Domain \(= \{-3,-2,-1,0,1,2,3\}\), Range \(= \{0,1,4,9\}\). The relation is a function.