In this section, we consider how functions are defined on different sets. We learn about the domain of the function and how to find the domain given a formula. Finding the natural domain of a function involves solving inequalities using sign analysis. Sometimes, we need to restrict a function to use a rule only on a particular set, called the explicit domain. Other times, we need the function to use different rules on different sets, creating a piecewise function. With piecewise functions, a function might not be continuous. We learn about limit notation as a way of evaluating what a rule to the left or right of a point would have given at a point. Continuity requires that the function is defined and that the left- and right-limits both agree with the actual function value.

Subsection4.4.1Functions and Sets

We earlier learned that sequences are functions. A sequence \(x\) defined a map \(n \mapsto x_n\) from the value of the index to the value in the sequence list at that index position. An explicit definition of the sequence might even use a formula, say \(x_n = 2n+5\text{.}\) An interactive figure below illustrates this mapping. As you move the value on the \(n\)-axis, an arrow shows the corresponding value on the \(x_n\)-axis. However, because \(n\) must be an integer, the sequence value is not defined for any other values on the axis.

We also learned that if we had an equation involving two variables, say \(x\) and \(y\text{,}\) and could solve that equation for \(y\) as a dependent variable being equal to an expression in \(x\text{,}\) then the map \(x \mapsto y\) also defined a function. For example, we might have \(y=2x+5\text{.}\)

The equations \(x_n = 2n+5\) and \(y=2x+5\) involve the same operations or rule for going from the independent variable to the dependent variable. Nevertheless, we think of these as fundamentally different functions. The sequence only allows \(n\) to have integer values, but the dependent variable \(y\) would allow \(x\) to have any real value. In order to distinguish functions at this level, we must extend the definition of a function to include the domain and codomain.

Definition4.4.3Function

A function \(f\) is a rule or relation from a given set \(D\) (the domain) to another set \(D'\) (the codomain) such that every value \(a \in D\) is related (mapped) to a unique value \(b \in D'\text{.}\) We write \(f : D \to D'\text{.}\)

Our notation for a function involving sets uses a different arrow \(f:D \to D'\) than the mapping arrow we used earlier for independent variable to dependent variable, \(f : x \mapsto y\text{.}\) Think of the set arrow (\(\to\)) as specifying sets and the mapping arrow (\(\mapsto\)) as specifying variables. When a function is described in terms of both sets and variables, we can use both to completely characterize the function.

Example4.4.4

The sequence \(x=(2n+5)_{n=0}^{\infty}\) is a function from a domain \(D=\mathbb{N}_0=\{0,\ldots,\infty\}\) to a codomain of the real numbers \(\mathbb{R}\text{.}\) The notation that gives indicates all of this would be

\begin{equation*}
x : \mathbb{N}_0 \to \mathbb{R}; n \mapsto x_n = 2n+5.
\end{equation*}

Sets relating to functions used in calculus, including domains, are usually expressed as a union of intervals. An interval represents all real numbers from a connected segment of the real number line. The left end-point of the segment is listed first and the right end-point is listed second, using infinity if the segment continues indefinitely. A square bracket is used when the end-point is included (closed) and a round parenthesis is used when the end-point is not included (open). For a review of interval notation, see Subsection A.1.2.

Example4.4.5

The function \(f(x)=2x+5\) is a function corresponding to \(y=2x+5\text{.}\) To indicate that the value of \(x\) is allowed to be any real number, we could write

\begin{equation*}
f : \mathbb{R} \to \mathbb{R}; x \mapsto 2x+5\text{.}
\end{equation*}

The set of all real numbers can also be represented as an interval, \((-\infty,\infty)\text{,}\) so the function could also have been written

\begin{equation*}
f : (-\infty,\infty) \to (-\infty,\infty); x \mapsto 2x+5\text{.}
\end{equation*}

Instead of using mapping notation for the formula, we could also have written

\begin{equation*}
f : (-\infty,\infty) \to (-\infty,\infty); f(x)= 2x+5\text{.}
\end{equation*}

When we want to restrict the domain to a set smaller than the natural domain, we can use mapping notation as described above, or we can use a conditional statement on the formula. A conditional statement provides the condition for when the equation or rule should be applied.

Example4.4.6

The function \(f\) defined by

\begin{equation*}
f:[0,1] \to \mathbb{R}; x \mapsto 2x+5
\end{equation*}

has a domain \(D=[0,1]\text{.}\) The interval corresponds to values \(x\) that satisfy \(0 \le x \le 1\text{.}\) Consequently, we could also write the function using a conditional statement as

The graphical representations of \(f\) as a map and as a graph are shown in the interactive figures below. Note how the value of the dependent variable is undefined for values of the independent variable outside of the restricted domain.

Restricting a domain is necessary to define inverse functions when a function is not one-to-one. For example, we have earlier noted that \(y=x^2\) is not one-to-one because when solving for \(x\text{,}\) we get two solutions \(x=\pm\sqrt{y}\text{.}\) The next example explores this in more depth.

Example4.4.9

We intuitively, but incorrectly, think of \(f(x)=x^2\) and \(g(x)=\sqrt{x}\) as inverse functions. The composition \(g \circ f(x) = \sqrt{x^2}\) is not the identity because \(\sqrt{x^2} = |x|\text{.}\) This is illustrated in the figure below. For \(x \lt 0\text{,}\) \(g \circ f(x) \ne x\text{;}\) but for \(x \ge 0\text{,}\) \(g \circ f(x)=x\text{.}\)

The function restricted to this domain, \(f:[0,\infty) \to \mathbb{R}; x \mapsto x^2\text{,}\) can be written using a standard equation with a constraint as

\begin{equation*}
f(x) = x^2, \quad x \ge 0\text{.}
\end{equation*}

The restricted function is the inverse of the square root.

Subsection4.4.2Finding the Domain and Range

When a function is defined by a formula, as in \(f(x)=2x+5\text{,}\) if the domain is not specified, then the largest domain consistent with the formula is assumed. We call this the natural domain of the function. Related to the domain is a set known as the range, which is the set of all output values. The range is always a subset of the codomain.

Definition4.4.11

For a function \(f\) defined by a formula, such as \(y=f(x)\text{,}\) the natural domain is the set of all real numbers for which the formula is defined.

Definition4.4.12

For a function \(f : D \to D'\text{,}\) the range is the set of all values \(y\) for which there exists a state \((x,y)\text{.}\) That is, there exists \(x \in D\) so that \(f(x)=y\text{.}\)

We find the natural domain by identifying which operations might not be defined for all values and then solve either equations or inequalities that will identify where the function is defined. Our elementary operations and functions use the following constraints to find the domain.

Division is undefined if the denominator equals zero.

Even roots (e.g., square roots) and irrational powers are undefined if the inner expression is negative.

Logarithms are undefined if the inner expression is non-positive (zero or negative).

Example4.4.13

Determine the domain of \(\displaystyle f(x) = \frac{2x+3}{x^2-4}\text{.}\)

Because \(f(x)\) is defined as a quotient, the domain will be the set of all values except where \(x^2-4=0\text{.}\) We solve this equation by factoring, since a product can only equal zero if one of the factors equals zero.

This means \(f(x)\) is defined for all inputs except \(x=-2\) or \(x=2\text{.}\)

To describe the domain using intervals, we think of the real number line and remove \(x=\pm 2\text{.}\) A graphical representation of the set using a number line is shown below. Intervals are read from the line left-to-right. It starts at \(-\infty\) and continues until \(-2\text{,}\) then goes from \(-2\) to \(2\text{,}\) and finally goes from \(2\) until \(+\infty\text{.}\) We write

\begin{equation*}
D = (-\infty,-2) \cup (-2, 2) \cup (2,+\infty)\text{.}
\end{equation*}

Sometimes finding the domain of a function involves solving an inequality (such as for a square root or a logarithm). To solve the inequality, we perform sign analysis. We identify end points of intervals where the expression of interest might change sign by solving equations. These end points only occur where the expression equals zero or where the expression itself is undefined (a discontinuity). We test the sign of the expression in each of the resulting intervals by using test points.

Example4.4.14

Find the domain of the function \(\displaystyle g(x)=\log_{4}(x^2-x-6)\text{.}\)

The logarithm in \(g(x)\) will only have a real value when the input expression is positive, \(x^2-x-6 \gt 0\text{.}\) Our task becomes determining the signs of the expression \(x^2-x-6\text{.}\) First, we find possible sign-changing points. The expression is always defined (no discontinuities) so we just solve for zeros \(x^2-x-6=0\text{.}\)

If we mark these points on a number line, we can easily identify the intervals to test for signs. It is helpful to use the same number line to record the resulting signs, so we can label \(x\)-values below the line and the resulting sign or value of the expression above the line.

The number line shows we need to test the intervals \((-\infty,-2)\text{,}\) \((-2,3)\text{,}\) and \((3,\infty)\text{.}\) Choosing one value from each interval, we can evaluate the expression at that point and identify the sign.

We can now update the number line we started by recording either \(+\) or \(-\) above each interval that we tested.

We were finding the domain of \(g(x)=\log_4(x^2-x-6)\text{,}\) which requires \(x^2-x-6 \gt 0\text{.}\) Based on our summary, we need to find all values which result in the expression having a positive sign. So our solution is the set \(D\) formed from the union of intervals \((-\infty,-2)\) and \((3,\infty)\text{,}\)

\begin{equation*}
D = (-\infty,-2) \cup (3,\infty)\text{.}
\end{equation*}

A visualization of the domain on the number line might also help solidify the connections between the sign analysis number line and the domain set.

Example4.4.15

Find the domain of the function \(\displaystyle h(x) = \sqrt{\frac{4x}{x^2-9}}\text{.}\)

A square root (any even root) requires that the input expression is non-negative. Our domain is to solve the inequality

\begin{equation*}
D = \{ x : \frac{4x}{x^2-9} \ge 0 \}\text{.}
\end{equation*}

To use sign analyis, we need to know the zeros and discontinuities and then test each resulting interval. Discontinuities occur when we try to divide by zero.

Zeros for a quotient require that the numerator equals zero.

\begin{gather*}
4x=0\\
x=0
\end{gather*}

Our sign analysis number line will have three points.

Checking one point in each resulting interval gives us the sign. Because we only need to know the sign, it is simpler to think of factors of positive or negative values.

We interpret our analysis to find the domain of \(h(x)\text{.}\) The domain must include intervals where the inner expression is positive, \((-3,0)\) and \((3,\infty)\text{,}\) along with points where the expression equals zero, \(x=0\text{.}\) The set is visualized below. We do not include the points where the expression was undefined, \(x=\pm3\text{.}\) The domain is the set

\begin{equation*}
D = (-3,0] \cup (3,\infty)\text{.}
\end{equation*}

When a function is one-to-one, it has an inverse. Because the input and output values for a function and its inverse exactly switch roles, we can find the range of a function by finding the domain of its inverse.

Theorem4.4.16

Suppose \(f : D \to D'\) is one to one, and let \(R\) be the range of \(f\text{.}\) Then the domain of \(f^{-1}\) is \(R\) and the range of \(f^{-1}\) is \(D\text{.}\)

Example4.4.17

Find the range of \(\displaystyle f(x)=\frac{3x}{x+4}\text{.}\)

We see if \(f\) is one-to-one by finding the inverse. Start with the equation \(\displaystyle y=\frac{3x}{x+4}\) and solve for \(x\text{.}\) First, clear the fraction by multiplying both sides by \(x+4\text{.}\) Then collect terms involving \(x\text{.}\)

Now factor out the common factor of \(x\) and finish solving.

\begin{gather*}
x(y - 3) = -4y\\
x = \frac{-4y}{y-3}
\end{gather*}

The inverse function is \(\displaystyle f^{-1}(y) = \frac{-4y}{y-3}\text{.}\)

The domain of \(f^{-1}\) is the set of all numbers \(y\) so \(y-3 \ne 0\text{.}\) That is, \(y \ne 3\text{.}\) In interval notation, this is \((-\infty,3) \cup (3,\infty)\text{.}\) Because the domain of the inverse function is the range of the original function, we know that the range of \(f\) is \((-\infty,3) \cup (3,\infty)\text{.}\)

When a function is not one-to-one, we will need to know how to find extreme values to find the range of a function. That will have to wait until we know about derivatives.

When different rules or formulas are used for different conditions, we have a piecewise-defined function. The standard notation for piecewise function is to create a list of rules using an equation with conditional statements on the domain for each given rule. To satisfy the unique-output property of a function, the conditional statements should ensure that each value in the domain only gets one output value.

Example4.4.18

Describe the piecewise function

\begin{equation*}
f(x) = \begin{cases}
3, & x \lt 0, \\
x^2, & 0 \lt x \le 2, \\
4-x, & x \gt 2.
\end{cases}
\end{equation*}

The function \(f:x \mapsto y\) is listed with three different rules. For inputs \(x \in (-\infty,0)\) (i.e., \(x \lt 0\)), we use the rule \(y=3\text{;}\) for inputs \(x \in (0,2]\text{,}\) we use the rule \(y=x^2\text{;}\) and for \(x \in (2,\infty)\text{,}\) we use the rule \(y=4-x\text{.}\) Notice that for \(x=0\text{,}\) there is no rule provided. The domain of \(f\) is the union of the component domains, so

The graph of the relation \(y=f(x)\) is created by pasting the graphs \(y=3\text{,}\) \(y=x^2\text{,}\) and \(y=4-x\) into a single graph, but including only that portion of the graphs that is relevant for the constrained domains of those rules. For points at the edge of a domain interval, we use filled circles only when the point is explicitly included.

In the previous example, the graph of the function had breaks. Those breaks occurred at the edges of the constrained domains of the rule. We call such a break a discontinuity. When a function is connected, we say it is continuous. For a piecewise function to be continuous at a point, the rule used to the left and right of a point need to give the same value as the rule at the point.

We need a notation that says to use the different rules around a point. Function evaluation notation \(f(x)\) finds the value using the rule at the point. We use a new notation, called limit notation, to apply the rules coming from the left or from the right to predict the value at a point.

Definition4.4.19Intuitive Meaning of Limit Notation

For a piecewise function using otherwise continuous expressions around a point \(x=c\text{,}\)

the left- and right-limits of \(f(x)\) at \(c\) are the values of the expressions \(f_{\text{left}}(c)\) and \(f_{\text{right}}(c)\) and are written using limit notation,

Around \(x=0\text{,}\) the function \(f(x)\) uses \(f(x)=3\) to the left of \(x=0\) and \(f(x)=x^2\) immediately to the right of \(x=0\text{.}\) Using limit notation, we write

In the earlier example using this same function, we included a filled circle at the point \((2,4)\) for the value \(f(2)=2^2=4\text{.}\) When a limit is different from the value of the function (or the function value doesn't exist), we can include an empty circle to show the limit of either the left or the right branch. The limits at \(x=0\) leads to two empty points at \((0,3)\) (left-limit) and at \((0,0)\) (right-limit). The limits at \(x=2\) leads to one empty point at \((2,2)\text{,}\) since the left-limit matches the value of the function at \((2,4)\text{.}\) This improved graph is shown below.

At a point away from break points of piecewise functions, the same rule is applied on the left and on the right. Consequently, we can compute left- and right-limits for formulas that are not defined piecewise as well.

Continuity captures the idea of connectedness. The rule for a function to either side of a point should perfectly match up with the rule for the point itself. We express this with limits.

Definition4.4.22Continuity at a Point

The statement “the function \(f\) is continuous at a point \(x=c\)” means that the left-limit and right-limit at \(x=c\) are equal to the value \(f(c)\text{,}\)

Our definition for continuity is, at the moment, a bit circular because our intuitive definition of limits (Definition 4.4.19) indicated that we needed “otherwise continuous expressions”. We will need a definition for limits that captures the same idea but does not require continuous expressions. We will then show that every simple algebraic expression is continuous using that new definition.

The parameters \(a\) and \(b\) for these formulas set the \(y\)-intercepts of the lines, allowing us to slide the lines up or down. We are looking for values that make these lines intersect at the point \((2,1)\text{.}\) We use limit notation to create the equations we need to solve.

To make the rule \(f(x)=2x+a\) (to the left of \(x=2\)) reach the correct point, we use the left-limit.

is continuous at \(x=2\text{.}\) A graph of this function is shown below.

Subsection4.4.4Summary

A complete definition of a function must specify the domain, namely the set of all possible inputs to the function. Functions using the same rule on different domains are different functions.

Sets are often defined as the union of intervals. An open interval \((a,b)\) describes a set that is a solution to \(a \lt x \lt b\text{.}\) A closed intervals \([a,b]\) includes the endpoints, \(a \le x \le b\text{.}\)

The natural domain of a function is found by determining the set of inputs for which the function output is defined.

A quotient \(\frac{u}{w}\) is defined for non-zero denominator \(w \ne 0\text{.}\)

An even root (e.g., square root) \(\sqrt{u}\) is defined for a non-negative input \(u \ge 0\text{.}\)

A logarithm \(\log_b{u}\) is defined for a positive input \(u \gt 0\text{.}\)

Inequalities related to zero can be solved by sign analysis: (1) create intervals separated by zeros and discontinuities of the expression, (2) test the sign of the relevant expression on the resulting intervals, and (3) interpret the results.

An explicit domain for a function can be specified using mapping notation,

\begin{equation*}
f:D \rightarrow \mathbb{R}; x \mapsto f(x),
\end{equation*}

or using a constraint.

The range of a one-to-one function is the domain of the inverse function.

A piecewise function uses different rules for different sets of the domain. The boundaries of these sets are the break-points of the function.

Continuity of functions is introduced as a concept to guarantee that piecewise functions are connected. At each break-point, we need to verify using limits that the formula to the left and the formula to the right both match the value at the break-point.

Limit notation indicates that we use a function rule to the left or right of a point and find the value if that rule were extended continuously to the point of interest.

\begin{gather*}
\lim_{x \to c^-} f(x) = \text{value from rule on left} \\
\lim_{x \to c^+} f(x) = \text{value from rule on right}
\end{gather*}

Subsection4.4.5Exercises

1

Write the function

\begin{equation*}
f:[0,3) \to \mathbb{R}; x \mapsto 2x-3
\end{equation*}