## Section 2.3 Gist of Domain, Range and Piecewise Defined Functions

¶### Subsection 2.3.1 Domain and Range

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

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.

###### Example 2.3.1.

Find the domain of the function

We know that we cannot divide by zero. 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:

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

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:

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

###### Note 2.3.2. Bad 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.

###### Example 2.3.3.

Find the domain and range of the function

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.

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}\)

###### Example 2.3.4.

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.

###### Example 2.3.6.

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

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

or an interval

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

or an interval

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

###### Checkpoint 2.3.8.

### Subsection 2.3.2 Piecewise 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.

###### Example 2.3.9.

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{.}\)

###### Example 2.3.11.

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.

###### Example 2.3.12.

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.

###### Checkpoint 2.3.13.

###### Checkpoint 2.3.14. Match the Graph to the Piecewise Formula.

### Subsection 2.3.3 Conclusion

Test your understanding of this chapter with the following exercises.

Student Learning Outcome: *Determine the domain and range of a function.*

###### Checkpoint 2.3.15.

###### Checkpoint 2.3.16.

###### Checkpoint 2.3.17.

###### Checkpoint 2.3.18.

Student Learning Outcome: *Define, distinguish, and apply piecewise-defined functions.*

###### Checkpoint 2.3.19.

###### Checkpoint 2.3.20.

###### Checkpoint 2.3.21.

###### Checkpoint 2.3.22.

###### Checkpoint 2.3.23.

Student Learning Outcome: *Determine from a graph or an equation whether a function is continuous or discontinuous.*

###### Checkpoint 2.3.24.

###### Checkpoint 2.3.25.

###### Checkpoint 2.3.26.

### Exercises 2.3.4 Exercises

Domain and Range

###### 1.

###### 2.

###### 3.

###### 4.

Evaluating Piecewise Functions

###### 5.

###### 6.

###### 7.

###### 8.

###### 9.

###### 10.

###### 11.

###### 12.

###### 13.

Formulas for Piecewise Functions

###### 14.

###### 15.

###### 16.

Additional Problems