### Video Transcript

In this video, we will learn how to
find the domain and the range of a piecewise-defined function. Letβs begin by recalling what we
mean by these terms, domain and range. The domain of a function is the set
of all input values to the function. We can think of this as the set of
all values on which the function acts. The range of a function is the set
of all possible outputs of the function given its domain. We can think of this as the set of
all values the function produces.

On a graph of the function, the
domain and range correspond to the sections of the π₯- and π¦-axes for which the
graph is plotted. For example, if we consider the
function π of π₯ equals π₯ squared, we can see that every single π₯-value in the
real numbers is inputted to the function. And so the domain is the entire set
of real numbers. But if we consider the range of
this function, we can see that there are certain π¦-values, the π¦-values below the
π₯-axis, which are not reached by the graph. Only π¦-values above or on the
π₯-axis are reached by the graph. So we would say that the range of
this function is the set of all values of π¦ or π of π₯ which are greater than or
equal to zero.

Now, in this video, weβre looking
specifically at the domain and range of piecewise functions. So letβs also recall what we mean
by that. A piecewise function is one which
is defined differently over different subsections of its domain. For example, we could have the
function π of π₯, which is defined as being equal to one when π₯ is less than zero
and equal to two when π₯ is greater than or equal to zero. This is a very simple piecewise
function. It has only two subdomains: π₯ is
less than zero and π₯ is greater than or equal to zero. And the subfunctions themselves are
also very straightforward. Theyβre just constants.

There is, however, no limit to the
number of subdomains a piecewise function can have. And the subfunctions themselves
could also be much more complex. They could be polynomials or more
complicated even than that. Formally then, we can say that a
piecewise function is a function that consists of multiple subfunctions, with each
subfunction defined over a subset of the main functionβs domain, which we call the
subdomain.

Letβs look at how we might find the
domain and range of a piecewise function from its graph first of all. So here we have a piecewise
function. We arenβt given the definition of
the function, although we could probably work it out from the graph if we needed
to. To find the domain of this function
first, we need to look at all the π₯-values for which the function has been
plotted. We can see that the graph has two
sections: the horizontal section here and then the diagonal section here. So we want to consider the
π₯-values for each of these, which will give the subdomains of the function.

The open circle here indicates that
the π₯-value at this point, which is negative two, is not included in this subdomain
because this point is not on this part of the graph. We can see though that this blue
line has an arrow on the end pointing towards the negative π₯-values, which
indicates that the line continues infinitely in this direction. The subdomain for this section of
the graph then is all π₯-values strictly less than negative two.

Letβs now consider the other
section of the graph. This starts at an π₯-value of
negative two. And this time, the closed or solid
circle indicates that this point is on the graph for this section. And so this subdomain does include
the value negative two. At the other end, the line extends
to an π₯-value of two. But the open dot here indicates
that this point and, hence, this value of π₯ is not included. So we have all values of π₯ greater
than or equal to negative two but strictly less than positive two.

Now, hereβs an important key
point. The domain of a piecewise function
is the union of all of its subdomains. So any π₯-value thatβs in one of
the subdomains is also in the domain of the overall function. We can use interval notation if we
wish to say that the domain of this function is the union of the open interval from
negative β to negative two and the left-closed, right-open interval from negative
two to positive two. That gives the open interval from
negative β to two. Or we can write this using
inequalities as π₯ is strictly less than two.

So we found the domain of this
function, and now letβs consider the range. To do this, we need to consider all
the π¦-values that are reached by the graph. In a similar way to the domain, the
range of a piecewise function is the union of the ranges of each subfunction over
its subdomain. Looking at the graph, we see that
the first subfunction is constant because the line is horizontal. And the π¦-value is always equal to
negative five. So this is the range of the first
subfunction.

The second subfunction is a
continuous straight line, which extends from a π¦-value of negative three to a
π¦-value of positive five, although the open dot here indicates we can have all
values up to but not including positive five. So the range of this
piecewise-defined function is the union of the value negative five with the left-
closed, right-open interval from negative three to positive five.

For more complicated piecewise
functions, we can find the domain and range by considering where the vertical and
horizontal lines intersect the curve. For example, if we sketch in the
vertical line π₯ equals one and this does intersect the curve, then this tells us
that the π₯ or input value of one is in the domain of the function. If we draw a horizontal line at,
for example, π¦ equals three and this line intersects the curve, then this tells us
that this π¦-value is in the range of the function. If, however, we were to draw a line
at, for example, π¦ equals negative four, then this horizontal line does not
intersect the curve. And so this tells us that the value
of negative four is not in the range of the function.

We need to be able to determine the
domain and the range of a piecewise function both graphically and from its
definition. In our first example, weβll
practice finding the domain and range of a piecewise function given its graph.

Determine the domain and the range
of the function π of π₯ equals six when π₯ is less than zero and negative four when
π₯ is greater than zero.

We recall first that the domain of
a function is the set of all input values to that function. In the case of the
piecewise-defined function we have here, the domain will be the union of all of its
subdomains. We can determine this either from
the definition of the function or from the graph. Looking at the function itself
first, we see that π of π₯ is defined to be equal to six when π₯ is less than zero
and negative four when π₯ is greater than zero. In other words, the function acts
on all negative π₯-values to produce the output six and acts on all positive
π₯-values to produce the output negative four. So the first subdomain of the
function is π₯ is less than zero, and the second subdomain is π₯ is greater than
zero.

The domain of π of π₯ is the union
of these two subdomains, which we can write in interval notation as the union of the
open interval from negative β to zero and the open interval from zero to β. This is the entire set of real
numbers with only the value zero excluded. So we can write this as the set of
real numbers minus the value zero.

Another way to see this is from the
graph. To determine if a value of π₯ is in
the domain of this function, we can draw a vertical line at this π₯-value. If this line intersects the graph,
then this tells us that this value of π₯ is in the domain of the function. The only vertical line we can draw
that doesnβt intersect the graph of π¦ equals π of π₯ is the line π₯ equals
zero. So this is the only value of π₯
excluded from the domain.

Next, letβs consider the range,
which is the set of all output values produced by the function. From the definition of the
function, we see that the function can only take the values six and negative
four. These are, therefore, the only
outputs of the function, and so theyβre the only values in the range. We can also see this from the graph
if we draw horizontal lines at different π¦-values. The only horizontal lines that
intersect the graph are the lines π¦ equals six and π¦ equals negative four. So the range of π of π₯ is the set
of values negative four, six.

Weβve found then that the domain of
this piecewise function is the set of all real numbers minus the value zero and the
range is the set containing the values negative four and six. Letβs now consider another example
in which we find the range of a different piecewise-defined function.

Find the range of the function π
of π₯ equals π₯ plus five for π₯ in the closed interval from negative five to
negative one and π of π₯ equals negative π₯ plus three for π₯ in the left-open,
right-closed interval from negative one to three.

We recall that the range of a
function is the set of all possible output values of the function given its
domain. We have here a piecewise-defined
function. Itβs defined differently over
different subdomains. To find the range of this function
though, we can use its graph. And we can consider which
horizontal lines will intersect the graph. The minimum value of π¦ at which we
can draw a horizontal line that intersects the graph is zero. And the maximum value of π¦ at
which we can draw a horizontal line that intersects the graph is four. Any horizontal line we draw between
these two π¦-values will also intersect the graph, whereas any horizontal line we
draw outside these two π¦-values will not intersect the graph. This tells us that the range of
this piecewise-defined function, which is the set of all possible output values or
π¦-values on its graph, is the closed interval from zero to four.

Letβs now consider a different
example in which weβll determine the domain of a piecewise function, but this time
we wonβt be given its graph.

Determine the domain of the
function π of π₯ equals π₯ plus four when π₯ is in the closed interval from
negative four to eight and π of π₯ equals seven π₯ minus 63 when π₯ is in the
left-open, right-closed interval from eight to nine.

We recall first that the domain of
a function is the set of all input values to that function. And for a piecewise-defined
function, as we have here, it is the union of its subdomains. For this function, the subdomains
are the closed interval from negative four to eight and the left-open, right-closed
interval from eight to nine. So the domain of the function is
the union of these two intervals. Thereβs no gap between these two
intervals, and the value of eight is included because the first interval is closed
at the upper end. So the domain of this piecewise
function, which is the union of its subdomains, is the closed interval from negative
four to nine.

Letβs now consider one final
example in which weβll determine both the domain and the range of a slightly more
complex piecewise-defined function.

Determine the domain and the range
of the function π of π₯ equals π₯ squared minus 36 over π₯ minus six if π₯ is not
equal to six and π of π₯ equals 12 if π₯ is equal to six.

We recall first that the domain of
a function is the set of all input values to that function. And for a piecewise-defined
function, as we have here, it is the union of its subdomains. To find the union of the
subdomains, weβll start by writing them in terms of sets. Firstly, π₯ not equal to six is the
same as the set of all real numbers minus the value six. Second, π₯ equals six is simply the
same as the set containing the value six. So the domain is the union of these
two sets: the real numbers minus the value six union the value six, which is just
the complete set of real numbers.

Next, letβs consider the range of
this function. The range is the set of all
possible outputs given the functionβs 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 the range of each subfunction separately.

First, letβs consider the
definition of π of π₯ when π₯ is not equal to six. The expression in the numerator is
a difference of two squares. And so it can be factored as π₯
minus six multiplied by π₯ plus six. The shared factor of π₯ minus six
in the numerator and denominator can be canceled. And this is why itβs important that
π₯ is not equal to six here, because if it was, then π₯ minus six would be equal to
zero, and weβd be dividing by zero, which is undefined. But as the function is defined
differently when π₯ is equal to six, we can be confident weβre not attempting to
divide by zero here.

So when π of π₯ is not equal to
six, it simplifies to simply π₯ plus six. If we wish, we can then sketch this
subfunction. Itβs the line π¦ equals π₯ plus six
with the point when π₯ is equal to six removed. The range of this subfunction is
all of the possible outputs. The only horizontal line we can
draw that doesnβt intersect this graph is the line π¦ equals 12. So the range of this subfunction is
the set of all real numbers minus the value 12.

However, the second subfunction is
the constant function π of π₯ equals 12 on the domain π₯ equals six. Since the output is constant, the
range of the second subfunction is simply 12. Taking the union of the ranges of
these subfunctions gives the set of real numbers minus the value 12 union the value
12, which is simply the set of all real numbers. Weβve taken the value 12 out and
then put it back in again.

We can also sketch the second
subfunction on the same graph to fully sketch π of π₯. The second subfunction is only
defined when π₯ equals six. So it consists of a single
point. π of six is equal to 12, so we can
add the point six, 12 to our sketch. We filled in the point that was
previously missing from the line. So we can see that the function π
of π₯ is π₯ plus six. We can conclude then that the
domain of this piecewise-defined function is the complete set of real numbers and so
is the range.

Letβs finish by summarizing some of
the key points from this video. First, we saw that the domain of a
piecewise-defined function is the union of its subdomains. In the same way, the range of a
piecewise-defined function is the union of the ranges of each subfunction over its
subdomain. We saw that to find the domain of a
function from its graph, we can consider the intersections of the curve with the
vertical lines. If a vertical line does intersect
the curve, then that π₯-value is included in the domain, whereas if a vertical line
doesnβt intersect the curve, that π₯-value is excluded.

To find the range of a function
from its graph, we can consider the intersections of the curve with horizontal lines
and apply the same principles to determine whether values of π¦ are included or
excluded from the range of the function.