Skip to main content
\( \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section2.3Gist of Domain, Range and Piecewise Defined Functions

Subsection2.3.1Domain and Range

Sometimes a formula can only accept certain kinds of input values. For instance the square root function

\begin{equation*} f(x) = \sqrt x \end{equation*}

can only accept values of \(x\) that are not negative, because only non-negative inputs allow the function to yield real-valued outputs.

In math we say

The function \(f\) has a domain such that \(x \geqslant 0\)

meaning whatever values we choose for \(x\text{,}\) they must be greater than or equal to zero. That's the math way of saying “not negative”.

The domain of a function is the set of all inputs a function is allowed to use.


Find the domain of the function

\begin{equation*} f(x) = \frac{x}{{{x^2} - 1}}. \end{equation*}

We know that we cannot divide by zerw. In this function, the denominator would be zero if \(x\) is either \(1\) or \(-1\text{,}\) so the domain of this function is “All numbers except \(x = 1\) or \(x = -1\)”.

In math this can be written many different ways.

We could use set-builder notation:

\begin{equation*} \{x \vert x \neq \pm 1 \} \end{equation*}

This is read, from left-to-right, as “the set of all numbers \(x\text{,}\) such that \(x\) is not equal to positive or negative \(1\)”.

Or, we could use inequalitites:

\begin{equation*} -\infty \lt x \lt -1 \text{ or } -1 \lt x \lt 1 \text{ or } 1 \lt x \lt \infty \end{equation*}

This means that the domain includes all numbers strictly less than \(-1\text{,}\) between \(-1\) and \(1\text{,}\) or strictly greater than \(1\text{.}\)

A third choice is interval notation:

\begin{equation*} (-\infty,-1) \cup (-1,1) \cup (1,\infty) \end{equation*}

Here, the union symbol \(\cup\) means we are bringing together these three intervals.

Note2.3.2Bad Inputs

To find the domain of a function, it is sometimes easiest to find the “bad” input values — numbers which are not in the domain. Then, the domain is all numbers except the bad ones. Typical examples of “bad” inputs are those which cause division by zero or negatives under a radical.

Once we find the domain of a function, we can then consider all the possible outputs for the function. The set of all possible outputs is called the range of the function.


Find the domain and range of the function

\begin{equation*} f(x) = \sqrt {x - 8}. \end{equation*}

Since we cannot take the square root of a negative number, we know that \(x-8\) must be greater than or equal to zero. Solving this inequality for \(x\text{,}\) we can find the domain.

\begin{align*} x - 8 \amp \geqslant 0\\ x \amp \geqslant 8\text{.} \end{align*}

This means that the inputs for this function must be greater than or equal to \(8\text{.}\)

Once the domain is found, we can turn our attention to finding all the possible output values our function can create; this is the range.

The square root function always creates non-negative results. In other words, if you put a number (from the domain) into the square root function, you always get a result that is greater than or equal to zero.

Therefore, the range of \(f(x) = \sqrt x \) is \(y \geqslant 0\)

At this point it is important to note that when we state the domain of a function, we refer to the input variable. So far our inputs have been called \(x\text{,}\) so every domain we have described has had \(x\) in it. For instance, \(f(x) = \frac{x}{{{x^2} - 1}}\) had the domain \(\{x \vert x \neq \pm 1 \}\text{.}\)

When we state the range of a function, we must refer to the output. If \(y=f(x)\) where \(f(x) = \frac{x}{{{x^2} - 1}}\text{,}\) then our range has to refer to \(y\) or to \(f(x)\text{,}\) both of which represent the output. In this case the range could be written \(y \geqslant 0\) or \(f(x) \geqslant 0\text{.}\)

Identifying the domain and range directly from a formula can be difficult. It is often more clear if we look at functions graphically. Below is a graph of \(f(x) = \sqrt {x - 8}\)

Figure2.3.5Graph of \(f(x)=\sqrt{x-8}\)

Notice the graph only appears for input values \(x \geqslant 8\text{.}\) That is the domain of \(f\text{.}\)

Also notice the graph only appears at or above the \(x-\)axis. The graph shows us the range is \(y \geqslant 0\text{.}\)

When you want to find the domain and range of a function, one option is to graph it on a graphing tool. Determine the intervals or boundaries on the horizontal axis where the graph exists. This is the domain.

Next, use the graph to determine if there are vertical intervals or boundaries to how high or low the graph reaches. This is the range.


Find the domain and range of the function \(f(x)\) graphed below.

Figure2.3.7A graph of \(y = f(x)\text{.}\)

The graph only exists when \(x\) is greater than \(-1\) and less than or equal to \(5\text{.}\) This is the domain, and it can be written as an inequality

\begin{equation*} -1 \lt x \leq 5 \end{equation*}

or an interval

\begin{equation*} (-1,5]. \end{equation*}

The graph curves up and down, but it reaches every output value where \(y\) is greater than or equal to \(-27\) and less than or equal to \(25\text{.}\) This is the range, and it can be written as an inequality

\begin{equation*} -27 \leq y \leq 25 \end{equation*}

or an interval

\begin{equation*} [-27,25]. \end{equation*}

In the next exercise, you will manipulate a graph to change its domain and range.

WeBWorK Exercise

Subsection2.3.2Piecewise Defined Functions

A piecewise defined function is actually a collection of two or more functions that tell us how to use an input to get an output. Each function must state the domain on which it is defined, that way you know when to use it.

We start with some easy, everyday examples of piecewise defined functions.


The cost of renting a snowboard is \($25\) per day, or \($60\) for three days, or \($75\) for a week.

The first cost function is \($25\) per day and is good for \(1\) or \(2\) days. The domain of this function is the “\(1\) or \(2\) days”. It tells you when to use this cost function.

On the third day is a new cost function, a simple constant of \($60\text{.}\)

Finally, the constant function \($75\) is used when we keep the snowboard for more than \(3\) days, up to \(7\) days (a full week).

Each rule has its own domain that tells us when to use the rule. In Figure 2.3.10, we see the graph of the price function. Notice the graph has a constant output of \(50\) when \(1 \lt x \leq 2\text{,}\) but it immediately changes to \(60\) when \(x \gt 2\text{.}\)

Figure2.3.10A piecewise defined cost function.

A hot cup of coffee sits on a counter and begins to cool down. The rate at which the coffee cools is related to the temperature of the coffee and the temperature in the room (there's actually a formula for that). The formula is good for as long the situation in the room remains the same.

If you suddenly change the room conditions by turning on the air conditioner, then the rate at which the coffee cools will also change. There would be a new formula to model the coffee's temperature after the air conditioner is switched on.

One formula is good from the time you pour the coffee up until you switch on the air conditioner. Then the other formula takes over after the air conditioner has been turned on.


In the United States there are \(7\) income tax brackets. That means there are \(7\) different functions to tell us how much income tax we owe. The function you use is determined by how much money you make.

In other words, each function has its own domain (income bracket) that tells you when to use the function.

One family's income will put them in a \(25\%\) tax bracket, but another family with a higher income will fall under a higher tax bracket, like \(28\%\text{.}\)

To create a piecewise function, start by finding formulas or rules for all the different functions in the set. Then identify the domain for each function.

When you finally write the piecewise function, write each formula with its corresponding domain to its right.

WeBWorK Exercise
Exercise2.3.14Match the Graph to the Piecewise Formula
WeBWorK Exercise


Domain and Range

WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise

Evaluating Piecewise Functions

WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise

Formulas for Piecewise Functions

WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise
WeBWorK Exercise

Additional Problems

WeBWorK Exercise