Lesson Explainer: Domain and Range of a Piecewise Function Mathematics

In this explainer, we will learn how to find the domain and range of a piecewise-defined function.

We start by recalling what is meant by the domain and range of a function.

Definition: Domain and Range of a Function

The domain of a function is the set of all input values of the function.

The range of a function is the set of all possible outputs of the function, given its domain.

The domain tells us all of the inputs โ€œallowedโ€ for the function. For example, since we cannot input ๐‘ฅ=0 into the function ๐‘“(๐‘ฅ)=1๐‘ฅ, as it would be undefined, its domain will not include this value of ๐‘ฅ. We can input any other value of ๐‘ฅ, so the domain of this function is โ„โˆ’{0}.

The range of a function tells us all of the possible outputs of this function, given its domain. For example, consider the function ๐‘“(๐‘ฅ)=๐‘ฅ๏Šจ, which has a domain of โ„. Since the square of any real number is nonnegative, ๐‘ฅโ‰ฅ0๏Šจ, therefore, this function only outputs nonnegative real numbers, but we need to check which of these nonnegative real numbers are outputs of the function. To do this, we will show that any nonnegative number is an output of this function. If ๐‘ฆโ‰ฅ0, then ๐‘“๏€บโˆš๐‘ฆ๏†=๏€บโˆš๐‘ฆ๏†=๐‘ฆ.๏Šจ

Hence, the range of this function on โ„ is the set of nonnegative real numbers, given by [0,โˆž[.

We can use different algebraic techniques and the properties of the function to determine its domain and range. However, it is often easier to do this by using a sketch. Consider the following sketch of ๐‘ฆ=๐‘“(๐‘ฅ).

In the sketch of any function, a point on the curve has the form (๐‘ฅ,๐‘“(๐‘ฅ)), where ๐‘ฅ is the input of the function and ๐‘“(๐‘ฅ) is the output. In other words, the ๐‘ฅ-coordinate of every point on the curve tells us an input of the function and the ๐‘ฆ-coordinate tells us an output of the function.

Therefore, we can use the graph of a function to determine its domain and range. To determine the domain of this function, we want to find the ๐‘ฅ-coordinate of every point on the curve. We can do this by considering which vertical lines intersect the curve.

For example, if we sketch the vertical line ๐‘ฅ=2, we see this intersects our curve at the point (2,3). Hence, 2 is in the domain of our function and 3 is in its range. To determine the full domain of our function, we need to do this with every possible vertical line. We can see any vertical line, ๐‘ฅ=๐‘, will intersect this curve. In particular, for ๐‘ฅ=0, we have the following:

Since the graph of ๐‘ฆ=๐‘“(๐‘ฅ) has a solid dot at (0,1), we know the function is defined at this point. So, the vertical line ๐‘ฅ=0 intersects the curve and ๐‘“(0)=1. Therefore, since all vertical lines intersect the curve, its domain is โ„.

We can find the range of this function by considering horizontal lines.

For example, the line ๐‘ฆ=1 intersects the curve at the point (0,1), so 1 is in the range of this function. We can also see that the line ๐‘ฆ=0 does not intersect the curve.

Since the curve has a hollow dot at the origin, it does not intersect this horizontal line; in fact, for any ๐‘โˆˆ[0,1[, the line ๐‘ฆ=๐‘ will not intersect our curve and all other horizontal lines do intersect our curve. Hence, the range of this function is ]โˆ’โˆž,0[โˆช[1,โˆž[.

Before we discuss finding the domain and range of a piecewise-defined function, letโ€™s start by recalling what we mean by these types of functions.

Definition: Piecewise Function

A piecewise function is a function that consists of multiple subfunctions, with each subfunction defined over a subset of the main functionโ€™s domain, called a subdomain.

The equation of a piecewise function is written with a curly bracket to indicate that it is comprised of more than one subfunction. An example of a piecewise function is ๐‘“(๐‘ฅ)=๏ญ๐‘ฅ,๐‘ฅ<0,๐‘ฅ+1,๐‘ฅโ‰ฅ0, where ๐‘“(๐‘ฅ)=๐‘ฅ when ๐‘ฅ<0 and ๐‘“(๐‘ฅ)=๐‘ฅ+1 when ๐‘ฅโ‰ฅ0.

In a piecewise-defined function, the possible inputs of the function are given by the subdomains, in this case ๐‘ฅ<0 and ๐‘ฅโ‰ฅ0. Therefore, to find all the possible inputs of this function, we will need to take the union of all the subdomains. For this piecewise function, we can take inputs of ๐‘ฅ<0 and also ๐‘ฅโ‰ฅ0; combining these, we can see this is any real value of ๐‘ฅ, so its domain is โ„.

To find the range of a piecewise function, we can instead consider the range of each subfunction over its subdomain. Therefore, to find the range of ๐‘“(๐‘ฅ), we consider the range of each subfunction separately.

First, ๐‘“(๐‘ฅ)=๐‘ฅ when ๐‘ฅ<0. Therefore, if we input a value of ๐‘<0 into the function, we get ๐‘“(๐‘)=๐‘.

Hence, all values of ๐‘<0 are in the range of this subfunction.

Second, ๐‘“(๐‘ฅ)=๐‘ฅ+1 when ๐‘ฅโ‰ฅ0. Adding 1 to both sides of the inequality of our subdomain gives us ๐‘ฅ+1โ‰ฅ1. Hence, when ๐‘ฅโ‰ฅ0, ๐‘“(๐‘ฅ)โ‰ฅ1. This is not enough to determine the range of this subfunction; we need to determine which values our subfunction achieves. To do this, we will let ๐‘โ‰ฅ1 so that ๐‘โˆ’1โ‰ฅ0; this means ๐‘“(๐‘โˆ’1)=(๐‘โˆ’1)+1=๐‘.

Therefore, all values of ๐‘โ‰ฅ1 are in the range of this subfunction. Combining the ranges of each subfunction, we get that the range of ๐‘“(๐‘ฅ) is ๐‘<0 and ๐‘โ‰ฅ1; we can represent this in interval notation as ]โˆ’โˆž,0[โˆช[1,โˆž[.

We can summarize the results shown in the example above as follows.

Definition: Domain and Range of a Piecewise Function

The domain of a piecewise-defined function is the union of its subdomains.

The range of a piecewise-defined function is the union of the ranges of each subfunction over its subdomain.

Letโ€™s see some examples of how to find the domain and range of a piecewise-defined function from its graph.

Example 1: Determining the Domain of a Piecewise-Defined Function given Its Graph

Determine the domain and the range of the function ๐‘“(๐‘ฅ)=๏ญ6,๐‘ฅ<0,โˆ’4,๐‘ฅ>0.

Answer

We recall that the domain of a function is the set of all input values of the function and the range of a function is the set of all possible outputs of the function, given its domain.

We can determine both of these from the graph of the function. Remember, any point on the curve is in the form (๐‘ฅ,๐‘“(๐‘ฅ)), where ๐‘ฅ will be in the domain of ๐‘“ and ๐‘“(๐‘ฅ) will be in the range of ๐‘“.

To find the domain of ๐‘“, we need to determine the ๐‘ฅ-coordinates of all points on the curve.

Consider the following vertical lines.

In diagram (1), we can see that any vertical line for ๐‘ฅ<0 intersects the curve. Similarly, in diagram (2), we can see that any vertical line for ๐‘ฅ>0 intersects the line. So, all of these values of ๐‘ฅ must be in the domain of this function. We need to check if ๐‘ฅ=0 is in the domain of this function; we can check this by sketching the line ๐‘ฅ=0.

Since our curve has hollow circles on the line ๐‘ฅ=0, it is not defined at this value of ๐‘ฅ; therefore, 0 is not in the domain of ๐‘“(๐‘ฅ). Hence, the domain of this function is all real values of ๐‘ฅ not equal to 0, which we can write in set notation as โ„โˆ’{0}.

It is worth noting that we can verify that 0 is not in the domain of ๐‘“(๐‘ฅ)by considering the subdomains of the function, ๐‘ฅ<0 and ๐‘ฅ>0, which both do not include 0. The union of these subdomains is also the domain of the function, โ„โˆ’{0}.

To find the range of this function, we could consider which horizontal lines intersect the graph. However, in this case, we can find the range by considering the coordinates of the points on the graph.

We can see that if ๐‘ฅ<0, then ๐‘“(๐‘ฅ)=6. Similarly, if ๐‘ฅ>0, then ๐‘“(๐‘ฅ)=โˆ’4. This means the only possible outputs of our function are 6 and โˆ’4, so the range of this function is {โˆ’4,6}.

Hence, the domain is โ„โˆ’{0}, and the range is {โˆ’4,6}.

Example 2: Determining the Range of a Piecewise-Defined Function given Its Graph

Find the range of the function ๐‘“(๐‘ฅ)=๏ฎ๐‘ฅ+5,๐‘ฅโˆˆ[โˆ’5,โˆ’1],โˆ’๐‘ฅ+3,๐‘ฅโˆˆ]โˆ’1,3].

Answer

We recall that the range of a function is the set of all possible outputs of the function, given its domain. To find the range of this function, we can consider which horizontal lines intersect the graph.

In diagram (1), we can see that the highest output of the function is ๐‘“(โˆ’1)=4. In diagram (2), we can see that the lowest output of the function is ๐‘“(โˆ’5)=๐‘“(3)=0. All the values between these are possible outputs giving us the range [0,4].

Hence, the range is [0,4].

Example 3: Determining the Range of Piecewise-Defined Functions from Their Graphs

Determine the range of the function represented by the given graph.

Answer

We recall that the range of a function is the set of all possible outputs of the function, given its domain. Remember, any point on our graph will be in the form (๐‘,๐‘“(๐‘)), where ๐‘“(๐‘) will be in the range of the function. Therefore, we can find the range of this function by determining the ๐‘ฆ-coordinates of the points on its graph.

In diagram (1), since our graph has a solid dot at (4,โˆ’1), we can see that the lowest output of the function is โˆ’1. In the second diagram, we can see that the largest output of the function is 7.

We can see that any horizontal line between these values also intersects the curve, so the range of this function is any value between โˆ’1 and 7, inclusive. In set notation, this is [โˆ’1,7].

Hence, the range is [โˆ’1,7].

In our next example, we will see how to determine the domain of a piecewise-defined function without being given its graph.

Example 4: Determining the Domain of a Piecewise-Defined Function

Determine the domain of the function ๐‘“(๐‘ฅ)=๏ฎ๐‘ฅ+4,๐‘ฅโˆˆ[โˆ’4,8],7๐‘ฅโˆ’63,๐‘ฅโˆˆ]8,9].

Answer

We recall that the domain of a function is the set of all input values of the function, and for a piecewise-defined function, it is the union of its subdomains.

For this function, the subdomains are [โˆ’4,8] and ]8,9]. We want to take the union of these two sets to find the domain of ๐‘“(๐‘ฅ): [โˆ’4,8]โˆช]8,9]=[โˆ’4,9].

Hence, the domain is [โˆ’4,9].

In our final example, we will see how to determine both the domain and the range of a piecewise-defined function without being given its graph.

Example 5: Determining the Domain and the Range of a Piecewise Function

Determine the domain and range of the function ๐‘“(๐‘ฅ)=๏ฒ๐‘ฅโˆ’36๐‘ฅโˆ’6๐‘ฅโ‰ 6,12๐‘ฅ=6.๏Šจifif

Answer

We recall that the domain of a function is the set of all input values of the function, and for a piecewise-defined function, it is the union of its subdomains.

To find the union of the subdomains, we will start by writing them in terms of sets. First, ๐‘ฅโ‰ 6 is the same as โ„โˆ’{6}. Second, ๐‘ฅ=6 is the same as {6}.

Therefore, the domain is the union of these sets: โ„โˆ’{6}โˆช{6}=โ„.

The range of a function is the set of all possible outputs of the function, given its domain. For a piecewise-defined function, this will be the range of the subfunctions over their subdomains. So, we can determine the range of this function by considering each subfunction separately.

First, if ๐‘ฅโ‰ 6, ๐‘“(๐‘ฅ)=๐‘ฅโˆ’36๐‘ฅโˆ’6=(๐‘ฅโˆ’6)(๐‘ฅ+6)๐‘ฅโˆ’6;๏Šจ since ๐‘ฅโ‰ 6, we can cancel the shared factor of ๐‘ฅโˆ’6: ๐‘“(๐‘ฅ)=๐‘ฅ+6.

We can then sketch this subfunction.

It is the line ๐‘ฆ=๐‘ฅ+6 with the point when ๐‘ฅ=6 removed. The range of this subfunction is all of the possible outputs. The only horizontal line that does not intersect this line is ๐‘ฆ=12, so the range of this subfunction is โ„โˆ’{12}.

The second subfunction is the constant function ๐‘“(๐‘ฅ)=12 on the domain {6}. Since the output is constant, its range is {12}.

Taking the union of the ranges of the subfunctions gives us โ„โˆ’{12}โˆช{12}=โ„.

It is worth noting that we could also sketch the second subfunction on the same graph to fully sketch ๐‘“(๐‘ฅ). The second subfunction is only defined when ๐‘ฅ=6, so it consists of a single point. We have ๐‘“(6)=12, so we add the point (6,12) to our sketch.

We can then see that ๐‘“(๐‘ฅ) is function ๐‘ฅ+6.

Hence, the domain is โ„ and the range is โ„.

Letโ€™s finish by recapping some of the important points of this explainer.

Key Points

  • The domain of a piecewise-defined function is the union of its subdomains.
  • The range of a piecewise-defined function is the union of the ranges of each subfunction over its subdomain.
  • We can find the domain of a function from its graph by considering the intersections of the curve with vertical lines.
  • We can find the range of a function from its graph by considering the intersections of the curve with horizontal lines.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.