# 1.2: Domain and Range

- Page ID
- 67093

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

\( \newcommand{\Span}{\mathrm{span}}\)

\( \newcommand{\id}{\mathrm{id}}\)

\( \newcommand{\Span}{\mathrm{span}}\)

\( \newcommand{\kernel}{\mathrm{null}\,}\)

\( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\)

\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\)

\( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)

\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)

\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vectorC}[1]{\textbf{#1}} \)

\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)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 those models we create.

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

Circumference, \(c\) | 1.7 | 2.5 | 5.5 | 8.2 | 13.7 |

Height, \(h\) | 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 -3 feet, or a height of 3000 feet. When we identify limitations on the inputs and outputs of a function, we are determining the domain and range of the function.

Definitions: Domain and Range

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

Example \(\PageIndex{1}\)

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

**Solution**

We could combine the data provided with our own experiences and reason to approximate the domain and range of the function \(h = f(c)\). For the domain, possible values for the input circumference \(c\), it doesn’t make sense to have negative values, so \(c > 0\). 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 \(0< c \le 119\) 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 379 feet, so a reasonable range is \(0 < h \le 379\) feet.

Example \(\PageIndex{2}\)

When sending a letter through the United States Postal Service, the price depends upon the weight of the letter (https://pe.usps.com/text/dmm300/Notice123.htm, retrieved August 6, 2018), as shown in the table below. Determine the domain and range.

Weight not Over |
Price |
---|---|

1 ounce |
$0.50 |

2 ounces |
$0.71 |

3 ounces |
$0.92 |

3.5 ounces |
$1.13 |

Suppose we notate Weight by \(w\) and Price by \(p\), and set up a function named \(P\), where Price, \(p\) is a function of Weight, \(w. p = P(w).\)

Since acceptable weights are 3.5 ounces or less, and negative weights don’t make sense, the domain would be \(0< w \le 3.5\). Technically 0 could be included in the domain, but logically it would mean we are mailing nothing, so it doesn’t hurt to leave it out.

Since possible prices are from a limited set of values, we can only define the range of this function by listing the possible values. The range is \(p\) = $0.50, $0.71, $0.92, or $1.13.

Try it now

The population of a small town in the year 1960 was 100 people. Since then the population has grown to 1400 people reported during the 2010 census. Choose descriptive variables for your input and output and use interval notation to write the domain and range.

**Answer**-
Domain; \(y =\) years [1960, 2010]

Range, \(p =\) population, [100, 1400]

## Notation

In the previous examples, we used inequalities to describe the domain and range of the functions. This is one way to describe intervals of input and output values, but is not the only way. Let us take a moment to discuss notation for domain and range.

Using inequalities, such as \(0 < c \le 163\), \(0 < w \le 3.5\), and \(0 < h \le 379\) imply that we are interested in all values between the low and high values, including the high values in these examples.

However, occasionally we are interested in a specific list of numbers like the range for the price to send letters, \(p\) = $0.44, $0.61, $0.78, or $0.95. These numbers represent a set of specific values: {0.44, 0.61, 0.78, 0.95}

Representing values as a set, or giving instructions on how a set is built, leads us to another type of notation to describe the domain and range.

Suppose we want to describe the values for a variable *x* that are 10 or greater, but less than 30. In inequalities, we would write \(10 \le x < 30\).

When describing domains and ranges, we sometimes extend this into **set-builder notation**, which would look like this: \(\{x\ |\ 10 \le x < 30\}\). The curly brackets {} are read as “the set of”, and the vertical bar is read as “such that”, so altogether we would read \(\{x\ |\ 10 \le x < 30\}\) as “the set of *x*-values such that 10 is less than or equal to \(x\) and \(x\) is less than 30.”

When describing ranges in set-builder notation, we could similarly write something like \(\{f(x)\ |\ 0 < f(x) < 30\}\), or if the output had its own variable, we could use it. So for our tree height example above, we could write for the range \(\{h\ |\ 0 < h \le 379\}\). In set-builder notation, if a domain or range is not limited, we could write {\(t\) | \(t\) is a real number}, or \(\{t\ |\ t \in \mathbb{R}\}\), read as “the set of *t*-values such that \(t\) is an element of the set of real numbers.

A more compact alternative to set-builder 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 \(\infty\) and - \(\infty\). The table below will help you see how inequalities correspond to set-builder notation and interval notation:

Inequality |
Set Builder Notation |
Interval notation |
---|---|---|

\(5 < h \le 10\) | \(\{h\ |\ 5 < h \le 10\}\) | (5, 10] |

\(5 \le h < 10\) | \(\{h\ |\ 5 \le h < 10\}\) | [5, 10) |

\(5 < h < 10\) | \(\{h\ |\ 5 < h < 10\}\) | (5, 10) |

\(h < 10\) | \(\{h\ |\ h < 10\}\) | \((-\infty ,10)\) |

\(h \ge 10\) | \(\{h\ |\ h \ge 10\}\) | \([10, \infty )\) |

all real numbers | \(\{h\ |\ h \in \mathbb{R}\}\) | \((-\infty, \infty )\) |

To combine two intervals together, using inequalities or set-builder notation we can use the word “or”. In interval notation, we use the union symbol, \(\cup\), to combine two unconnected intervals together.

Example \(\PageIndex{3}\)

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: \[1 \le x \le 3\quad \text{or} \quad x > 5 \nonumber\]
- In set builder notation: \[\{x|1 \le x \le 3 \quad \text{or} \quad x > 5\} \nonumber\]
- In interval notation: \[[1,3] \cup (5, \infty ) \nonumber\]

Remember when writing or reading interval notation:

Using a square bracket [ means the start value is included in the set;

Using a parenthesis ( means the start value is not included in the set.

Try it now

Given the following interval, write its meaning in words, set builder notation, and interval notation.

**Answer**-
a. Values that are less than or equal to -2, or values that are greater than or equal to -1 and less than 3

b. \(\{x\ |\ x \le -2\ or \ -1 \le x < 3\}\)

c. \((-\infty, -2] \cup [-1, 3)\)

## Domain and Range from Graphs

We can also talk about domain and range based on graphs. Since domain refers to the set of possible input values, the domain of a graph consists of all the input values shown on the graph. Remember that input values are almost always shown along the horizontal axis of the graph. Likewise, since range is the set of possible output values, the range of a graph we can see from the possible values along the vertical axis of the graph.

Be careful – if the graph continues beyond the window on which we can see the graph, the domain and range might be larger than the values we can see.

Example \(\PageIndex{4}\)

Determine the domain and range of the graph below.

**Solution**

In the graph above (http://commons.wikimedia.org/wiki/Fi...Production.PNG, CC-BY-SA, July 19, 2010), the input quantity along the horizontal axis appears to be “year”, which we could notate with the variable *y*. The output is “thousands of barrels of oil per day”, which we might notate with the variable *b*, for barrels. The graph would likely continue to the left and right beyond what is shown, but based on the portion of the graph that is shown to us, we can determine the domain is \(1975\le y\le 2008\), and the range is approximately \(180\le b\le 2010\).

In interval notation, the domain would be [1975, 2008] and the range would be about [180, 2010]. For the range, we have to approximate the smallest and largest outputs since they don’t fall exactly on the grid lines.

Remember that, as in the previous example, *x* and *y* are not always the input and output variables. Using descriptive variables is an important tool to remembering the context of the problem.

Try it now

Given the graph below write the domain and range in interval notation

**Answer**-
Domain; \(y =\) years, [1952, 2002]; Range, \(p =\) population in millions, [40, 88]

**Domains and Range from Formulas**

Most basic formulas can be evaluated at an input. Two common restrictions are:

- The square root of negative values is non-real.
- We cannot divide by zero.

Example \(\PageIndex{5}\)

Find the domain of each function:

- \(f(x)=2\sqrt{x+4}\)
- \(g(x)=\dfrac{3}{6-3x}\)

**Solution**

a) Since we cannot take the square root of a negative number, we need the inside of the square root to be non-negative.

\(x + 4 \ge 0\) when \(x \ge -4\).

The domain of \(f(x)\) is \([-4, \infty)\).

b) We cannot divide by zero, so we need the denominator to be non-zero.

\(6 - 3x = 0\) when *x* = 2, so we must exclude 2 from the domain.

The domain of *g(x)* is \((-\infty , 2) \cup (2, \infty)\).

## Piecewise Functions

Some functions cannot be described by a single formula.

Definition: Piecewise Function

A **piecewise function** is a function in which the formula used depends upon the domain the input lies in. We notate this idea like:

\[f(x) = \begin{cases} \text{formula 1 if domain to use formula 1} \\ \text{formula 2 if domain to use formula 2} \\ \text{formula 3 if domain to use formula 3} \end{cases}\nonumber \]

Example \(\PageIndex{6}\)

A museum charges $5 per person for a guided tour with a group of 1 to 9 people, or a fixed $50 fee for 10 or more people in the group. Set up a function relating the number of people, \(n\), to the cost, \(C\).

**Solution**

To set up this function, two different formulas would be needed. *C* = 5*n* would work for *n* values under 10, and *C* = 50 would work for values of *n* ten or greater. Notating this:

\[C(n) = \begin{cases} 5n & if & 0 < n < 10 \\ 50 & if & n \ge 10 \end{cases}\nonumber \]

Example \(\PageIndex{7}\)

A cell phone company uses the function below to determine the cost, *C*, in dollars for *g* gigabytes of data transfer.

\[C(g)=\left\{\begin{array}{ccc} {25} & {if} & {0<g<2} \\ {25+10(g-2)} & {if} & {g\ge 2} \end{array}\right.\nonumber \]

Find the cost of using 1.5 gigabytes of data, and the cost of using 4 gigabytes of data.

**Solution**

To find the cost of using 1.5 gigabytes of data, \(C(1.5)\), we first look to see which piece of domain our input falls in. Since 1.5 is less than 2, we use the first formula, giving \(C(1.5)\) = $25.

The find the cost of using 4 gigabytes of data, \(C(4)\), we see that our input of 4 is greater than 2, so we’ll use the second formula. \(C(4)\) = 25 + 10(4 - 2) = $45.

Example \(\PageIndex{1}\)

Sketch a graph of the function

\[f(x) = \left\{ {\begin{array}{*{20}{c}} 0&{if}&{x \leqslant 1} \\ {x - 1}&{if}&{1 < x \leqslant 4} \\ 2&{if}&{x > 4}\end{array}} \right.\nonumber\]

**Solution**

We can imagine graphing each function, then limiting the graph to the indicated domain. At the endpoints of the domain, we put open circles to indicate where the endpoint is not included, due to a strictly-less-than inequality, and a closed circle where the endpoint is included, due to a less-than-or-equal-to inequality. The first and last parts are constant functions, where the output is the same for all inputs. The middle part we might recognize as a line, and could graph by evaluating the function at a couple inputs and connecting the points with a line.

Now that we have each piece individually, we combine them onto the same graph. When the first and second parts meet at *x* = 1, we can imagine the closed dot filling in the open dot. Since there is no break in the graph, there is no need to show the dot.

Try It Now

At Pierce College during the 2009-2010 school year tuition rates for in-state residents were $89.50 per credit for the first 10 credits, $33 per credit for credits 11-18, and for over 18 credits the rate is $73 per credit (www.pierce.ctc.edu/dist/tuit...ition_rate.pdf, retrieved August 6, 2010). Write a piecewise defined function for the total tuition, \(T\), at Pierce College during 2009-2010 as a function of the number of credits taken, \(c\). Be sure to consider a reasonable domain and range

**Answer**-
\(T(c) = \begin{cases} 89.5c & if & c \le 10 \\ 895 + 33(c - 10) & if & 10 < c \le 18 \\ 1159 + 73(c - 18) & if & c > 18 \end{cases}\) Tuition, \(T\), as a function of credits, \(c\).

Reasonable domain should be whole numbers 0 to (answers may vary), e.g. [0, 23]

Reasonable range should be $0 – (answers may vary), e.g. [0,1524]

## Important Topics of this Section

- Definition of domain
- Definition of range
- Inequalities
- Interval notation
- Set builder notation
- Domain and Range from graphs
- Domain and Range of toolkit functions
- Piecewise defined functions