In this explainer, we will learn how to identify the domain and range of functions from their equations.

Recall that when we want to represent a function, we typically use the following notation:

For a function , we call the *domain* of the function and
the *codomain* of the function.

In essence, a function is an operation that can take any element belonging to the domain and send it to some element belonging to the codomain . Mathematically, we write this as , where and . Therefore, we can think of the domain as being all possible valid inputs of the function.

On the other hand, the *range* of a function is the set of all possible values
that can be obtained from applying to an element in . Another way to think of
this is that the range is all the possible outputs of the function. That is to say, if we calculated
for every possible in the domain and collected those numbers
into a set, that set would be the range. Typically, we denote this set by , and it
is a subset of the codomain.

Let us illustrate this idea in the diagram below.

Here, we have a function with a of and a of . takes elements of and maps them to specific elements of . Specifically, we have

So, the of the function is ,
since only 2 and 5 can be obtained by applying to elements in . Note that in
this case, the range is a *proper* subset of the codomain, since it contains fewer elements.

Additionally, we note that we can also represent this function as a set of *ordered pairs* as follows:

In general, to write a function as a set of ordered pairs, we construct a set containing elements of the form , for every in the domain.

Having seen a basic example of the domain and range of a function, let us now concretely define them.

### Definition: Domain and Range of a Function

For a function , the *domain* is the set of all
possible values such that is valid. We can define it mathematically as

The *range* is the set of all values we can get from applying
to elements of . Mathematically it is defined by

It is worth emphasizing that in the above definition, we specify that the domain has to only contain values such that is valid. This raises the question, in what situation might not be valid? One simple example of that is the function

Since we can only take the square root of a nonnegative number, this function is not defined for any negative values. Hence, the domain has to be the nonnegative numbers, .

We note that in some cases, as in the previous example, we can arbitrarily restrict the domain
of a function to a small set of numbers, or an interval (in this case it is not the *true* domain; rather it is
a subset of the complete domain). In many cases, however, we want to be the largest possible set
of values for which is valid. To present a much more typical example of a domain
and range we might encounter, suppose we have the function defined by

Here, the domain is the **largest** set of values such that is a defined operation for every in . Were we to take the
set we considered above, , we would naturally see that
is defined for every element of this set. However, since this function clearly works for any real number, it
makes more sense to take , the set of real numbers, so
can be applied to any number we want.

What about the range? The range is always dependent on whatever the domain is. If it had been , the resulting range would have been

On the other hand, if we had chosen , the range would be too. This is because every real number can be written in the form ; that is, given a real number , there is always a real number , such that .

As a side note, the codomain can be any set big enough to contain the range. In this instance, we can see that is sufficient, and in almost all instances this will be the default value we take. However, choosing the codomain to be equal to the range is in many cases the best option, as it eliminates any ambiguity.

For our first example, let us return to the idea of writing a function as a set of ordered pairs that we touched on earlier and make use of what we have learned about the domain and range.

### Example 1: Identifying the Ordered Pairs of a Function given its Domain and Equation

and are two sets of numbers where and . The function , where . Find the ordered pairs that satisfy the function and its range.

### Answer

To find the set of ordered pairs that represents , we just take each element in the domain , apply to them one by one, and make pairs of the form . The domain is the elements

Let us take the first element 10. Applying to it, where , we get

Therefore, the first ordered pair is . For the second pair, we repeat this for every element in the set. This gives us the pairs

Now, the range is the set of all values we get from applying to elements of . Specifically, these values are the second elements in each of the above pairs:

Putting this together, the function is and the range .

Just as we can find the range of a function given its domain and equation, we can also use its graph to find the domain and the range. This can be done by examining the graph closely and finding what values the points or lines correspond to. We demonstrate this below.

### Example 2: Identifying the Range of a Discrete Function given its Graph

The figure below shows the graph of a function .

What is the range of the function?

### Answer

We note that in this example, the -axis corresponds to the domain, , and the -axis corresponds to the range, . Every point on this graph is one instance of being mapped to . For instance, take the leftmost point, shown below.

Here, the -value is 1 and the -value is . This corresponds to the following relation between the input and the output:

To get the range of this function, we take the -value of every point on the graph and form a set. Altogether, the four points give us four -values:

Thus, the range is the set of these values, after removing the repeated numbers:

### Note

We can also find the domain of the function in a similar way. The domain is the set of -values of points on the graph. That is,

So far we have mostly looked at discrete functions in our examples (ones where we have a finite number of values in the domain and range). Mostly, however, we want to consider continuous functions (ones with an infinite number of values in the domain and range). When considering continuous functions, we often have to consider intervals of values. Recall that an interval is the set of all real numbers between two values. For example, is the interval of all real numbers between 5 and 7, with 5 included. We can also use the notation to mean all the real numbers between 4 and , that is, all the numbers greater than 4.

In the next example, we will consider the domain and range of a continuous function, where we have to consider the correct intervals based on the graph.

### Example 3: Identifying the Domain of a Continuous Function given its Graph

Determine the domain of the function represented in the graph below.

### Answer

Let us denote the above function by . Following the usual convention, we note that the -axis in this question corresponds to the domain of the function, , and the -axis corresponds to the range of the function, . Each point on the curve relates a point to a point . We also note that the arrow on the curve shows that as increases toward , continues in the same direction, that is, remains constant. On the other end, the curve ends in a solid dot, signifying that is included in the curve.

We can determine the domain of this function by considering how the points on the curve correspond to the -axis, as shown below.

As we can see, the domain corresponds exactly to the -values that are underneath the graph. The curve starts at , and it continues onward as increases. Thus, the domain is the interval

### Note

Although not required by the question, just as we found the domain of the function, we can find the range by projecting the curve on to the -axis. We can see that the curve starts at , then increases to , where it remains constant. Thus, the range of is the interval given by

We have now seen examples where we are given the domain of a function and need to calculate the range, but what about the opposite case? If we are given the equation for a function, and its range, can we calculate the domain?

The answer is, yes we can, by working backward and figuring out what values make sense. Suppose we had a function, and we were given that the range is . Well, we know that the range is the possible values we can get out of the equation after applying to any in the domain. The easiest way to see this is with a diagram.

Here, we can see that on the -axis, the has been mapped out. Upon following this region to the line and projecting it to the -axis, we can find that the of the function is (we note that this is not the full domain for this function of ).

Note that it is not strictly necessary to draw a diagram to find this; we could make use of the fact that is an increasing function and that the endpoints and correspond to and , so the domain has to lie between 2 and 6. However, it is always useful to be able to see what is going on.

In our next example, we will apply this and consider a problem where we have to find the domain of a function (possibly restricted), given its range.

### Example 4: Identifying the Domain of a Function given its Range and Equation

Find the domain of the function , given that the range is .

### Answer

The best way to approach this kind of question is to start off by determining what possible values can go into the function and drawing a graph of it.

When taking the square root of a number, it is necessary for that number to be nonnegative for the result to be a real number. Thus, we have the requirement

Let us now sketch the graph of this function. It does not need to be exact, but to get an idea of what this graph looks like, we could plot some preliminary points and see how they join up. For example, we have

0 | 1 | 2 | 3 | |||

0 | 1 | 2 |

and so on. Seeing that the curve continues upward, with a slope that is decreasing, we get the following diagram.

Now recall that the is . The range corresponds to the -axis on the graph, so we begin by marking , and everything above it, on the -axis. We note that the interval is closed on the left; hence, 2 is included in this region.

We then draw a line segment from the -axis to the curve and project this region on to the -axis. This region corresponds to the . Putting this information on the diagram, we get the following.

The dotted line segment, which represents the lower bound of the domain/range, intersects the -axis at 2 and the -axis at 2. This point corresponds to , which we calculated in the table above. Since is included in the range, 2 must be included in the domain too. On the other hand, the domain and range clearly have no upper bound.

In conclusion, we can say that the domain must be .

Now, we have seen that it is possible to find the domain of a function given its range and equation, but what if we
only have the equation? Previously, we have dealt with questions where the domain and/or range may be restricted
compared to the full domain and range. However, typically speaking, the domain refers to the **largest possible**
valid set of inputs for a function, and the range corresponds to that.

Let us consider an example of this below.

### Example 5: Identifying the Domain and Range of a Function given its Equation

Determine the domain and the range of the function .

### Answer

Here we are effectively being asked to find the largest possible set of input values of the function and the resulting set of outputs.

First of all, we have to ask ourselves, are there any values of for which is not defined? That is, given some , can we follow the steps below?

Both of the above operations can be done for any . Therefore, the domain is the largest set possible, .

To find the range, we need to find the possible range of outputs after applying to any . Probably the best way to do this is to draw a graph to see how behaves for different values of . Since it might not be immediately obvious how to draw it, we begin by marking some preliminary points:

0 | 1 | 2 | |||

5 | 2 | 1 | 2 | 5 |

If we join these points up and continue the graph onward, we get the following graph.

We note that seems to be the lowest point on the curve, giving , and that, on either side, the curve continues upward. We can confirm that this is the case by noting the fact that for all . Consequently,

So, must be the minimum point. To find the range, we have to find all the possible values can take. Since is the smallest value and as increases (or decreases), increases, we can conclude that the range must be the interval from 1 to infinity. That is,

In conclusion, the domain of is and the range is .

Let us recap the key points we have learned during this explainer.

### Key Points

- For a function , the
*domain*is the set of all possible values such that is valid: - The
*range*is the set of all values we can get from applying to elements of : - We can find the domain by figuring out what values of are valid for .
- We can find the range by calculating the possible values can take, given its domain.
- Graphs can be crucial for helping us to find the domain and range of a function. The -axis typically corresponds to the domain and the -axis to the range.