# Lesson Video: Graphs of Piecewise Functions Mathematics

In this video, we will learn how to graph and analyze a piecewise-defined function and study its different characteristics.

16:27

### Video Transcript

In this lesson, we’ll learn how to graph and analyze a piecewise-defined function and study it’s different characteristics.

Sometimes we come across a function that requires more than one function in order to obtain the given output. We call this a piecewise function. And these are functions in which more than one function is used to define the output over different parts of the domain. Each subfunction is then individually defined over its own domain.

For instance, let’s take 𝑓 of 𝑥, which is a piecewise-defined function. And it’s given by two 𝑥 plus one if 𝑥 is less than negative one and three 𝑥 if 𝑥 is greater than or equal to negative one. We see that for values of 𝑥 strictly less than negative one, we use the function 𝑓 of 𝑥 equals two 𝑥 plus one. For instance, 𝑓 of negative two would be evaluated as two times negative two plus one, which is negative three. But then, with values of 𝑥 greater than or equal to negative one, we use the function 𝑓 of 𝑥 equals three 𝑥. So, for instance, 𝑓 of zero would be three times zero, which is simply zero.

We need to make sure that we can identify the graphs of these functions as well as sketch them and define the function when given a graph. So let’s see what that would look like with an example.

What kind of function is depicted in the graph? Is it (A) an even function, (B) a logarithmic function, (C) a piecewise function, or (D) a polynomial function?

Let’s begin by providing a definition for each of these terms. If a function 𝑓 of 𝑥 satisfies the criteria 𝑓 of negative 𝑥 equals 𝑓 of 𝑥 for all 𝑥 within the domain of the function, then it’s said to be even. We also know that these functions have reflectional symmetry about the 𝑦-axis or the line 𝑥 equals zero. Then we look at logarithmic functions. These are of the form log base 𝑎 of 𝑥. They’re the inverse to exponential functions. It’s worth also noting that the domain of a logarithmic function is the set of positive real numbers, and then the range is the set of all real numbers.

Then we have piecewise functions. And these are functions in which more than one subfunction is used to define the output over different parts of the domain. Each subfunction is then individually defined over its own domain. Finally, we have polynomial functions. Now, these are ones made up of the sum or difference of constant terms, variables, and positive integer exponents such as two 𝑥 cubed plus five 𝑥. The domain of a polynomial function is the set of all real numbers. And we know that their graphs are both continuous and smooth. In other words, there are no gaps in the graph, which we might call a discontinuity, and there are no sharp corners on the graph. So let’s look at our graph and compare these definitions to it.

Firstly, we note that there is no symmetry about the line 𝑥 equals zero. And so we see that the function cannot be an even function. We also see that our graph is certainly defined for values of 𝑥 greater than or equal to negative 10 and less than or equal to eight. It might even be defined outside of this interval, but we can’t be sure at this stage. What this does tell us is that the domain is different to that of a logarithmic function, which is simply positive real numbers. And so our graph cannot be the graph of a logarithmic function.

And so we’re limited to piecewise functions and polynomial functions. Now, in fact, we said that the graph of a polynomial function is smooth; there are no sharp corners. And that means it’s differentiable at every point. We can quite clearly see that our graph has two sharp corners. And so it’s not smooth. Our graph cannot therefore be a polynomial function. And so we’re left with (C) a piecewise function. In fact, if we look carefully, we see that there are three parts to this piecewise function. The first part is for values of 𝑥 less than negative three. We then have values of 𝑥 between negative three and zero. And finally, our third subfunction is values of 𝑥 greater than zero and certainly, from what we can see, up to eight.

So we’ve seen what the graph of a piecewise-defined function might look like. We’re now going to see how we might determine the domain of a piecewise-defined function given its graph.

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

Let’s begin by recalling what we mean by the word “domain.” The domain of a function is the set of possible inputs that will yield real outputs. In other words, it’s the set of 𝑥-values that we can substitute into the function. Now, when we look at the graph of a function, we can establish its domain by considering the spread of values in the 𝑥-direction. We will need to be a little bit careful because if we look at the graph of our function, we notice we have these empty circles. Sometimes called an open circle, it tells us that the function can’t be defined by this part of the line at this point. Since we have a piecewise-defined function, that is, a function that’s defined by more than one subfunction, we’ll find the domain of each subfunction first.

We see we have one subfunction that takes values less than negative four. Then we have another subfunction that takes values greater than negative four. Since the initial or starting point of each line of our subfunction is represented by that open circle, we see that 𝑥 equals negative four is not defined within the domain of our function. And so the domain is actually going to be the set of real numbers not including this number. One way to represent that would be to use inequality notation and write 𝑥 can be less than negative four and 𝑥 can be greater than negative four.

Alternatively, we can use set notations, where this funny-looking ℝ represents the set of real numbers and these squiggly brackets or braces tell us the set contains one single element, and that’s negative four. And so the domain of this function is the set of real numbers not including the set containing the element negative four.

Now that we’ve established that the spread of values in the 𝑥-direction tells us the domain of the function, let’s look at how to find the range of a piecewise-defined function.

Find the range of the function.

Let’s begin by recalling what we mean by the range of a function. Just as the domain is the set of possible inputs to our function, the range is the set of possible outputs. In other words, it’s the set of 𝑦-values we achieve when the domain of 𝑥-values have been substituted into the function. This means that graphically we’re looking at the spread of values in the 𝑦-direction to help us calculate the range of the function.

Looking at the graph, we see that the values of 𝑦 begin at negative one. And that’s when we input 𝑥-values less than or equal to four. Then at 𝑥 equals four, the values of 𝑦 steadily increase, and this arrow here tells us that the increase to ∞. We can therefore say that the range, the set of possible outputs, is all values of 𝑦 greater than or equal to negative one. To use set notation to define the same interval, we use the left-closed right-open interval from negative one to ∞. Note that the round bracket tells us that ∞ isn’t really a defined number. And so the range of this function, which is the set of possible 𝑦-values, is the left-closed right-open interval from negative one to ∞.

Up until this stage, we’ve considered what it means for a function to be piecewise-defined and how to determine its domain and range from its graph. We’ll now look at how to define the entire piecewise function given the graph of that function.

Give the piecewise definition of the function ℎ whose graph is shown.

We’re told that the graph we’re given is a piecewise-defined function. And we know that a piecewise-defined function is made up of multiple subfunctions. In fact, by looking at the graph of this function, we might notice that there are going to be two subfunctions. These are also going to be linear since the graph of each subfunction is a straight line. And so this means that if we can calculate the slope 𝑚 and find one point which each line passes through, we can use the equation 𝑦 minus 𝑦 one equals 𝑚 times 𝑥 minus 𝑥 one to find the equation of each line.

Let’s begin with the first part of this subfunction. We notice that this subfunction is defined up to and including 𝑥-values of two. So that will give us a hint as to what its domain is. Then we could use the formula for slope 𝑚 equals 𝑦 two minus 𝑦 one over 𝑥 two minus 𝑥 one to find the slope of this line. Alternatively, we can use the triangle method. Choosing a point on the line, in this case, the 𝑦-intercept, and then moving exactly one unit to the right, we see we have to move one unit down to get back to our point on the line. That means the slope of this line must be negative one. It also passes through the point zero, three. Remember, this is the 𝑦-intercept of the line.

And so substituting everything we know about this first function into our equation for a straight line, we get 𝑦 minus three equals negative one times 𝑥 minus zero. Distributing the parentheses on the right-hand side, and we get negative 𝑥. And then we’re going to make 𝑦 the subject by adding three to both sides. Remember, 𝑦 is the output. So it’s going to be ℎ of 𝑥 essentially. And so the first line is defined by the equation 𝑦 equals three minus 𝑥.

Let’s repeat this process with the second line. Now we always need to be a little bit careful using the triangle method for fractional slope values. In this case, when we pick a point on the line, move one unit to the right, we then have to move a half a unit up to get back to our point on the line, meaning that the slope of our second line is one-half. To convince ourselves that this is true, we could choose the two points given on the line, which have coordinates four, two and six, three, respectively. Then 𝑦 two minus 𝑦 one over 𝑥 two minus 𝑥 one, which is change in 𝑦 over change in 𝑥, is three minus two over six minus four, which is one-half as we saw.

Then let’s pick this point. We know our line passes through the point with coordinates two, one. And so the equation of our line is 𝑦 minus one equals a half times 𝑥 minus two. Then when we distribute the parentheses on the right-hand side, we get that one-half times 𝑥 minus two is the same as one-half 𝑥 or 𝑥 over two minus one. We can then finally add one to both sides, eliminating that negative one. And so the second line has the equation 𝑦 equals 𝑥 over two. Now that we have the equations that represent our subfunctions, we’re going to pop this back together using piecewise definition.

ℎ is given by three minus 𝑥 for values of 𝑥 less than two. And 𝑥 over two of 𝑥 is greater than or equal to two, which of course is the same as writing two is less than or equal to 𝑥. Note, of course, that the function could have been defined at the point 𝑥 equals two by either subfunction. It’s generally convention that we choose the second function to define that point, although it would have been just as correct to write three minus 𝑥 if 𝑥 is less than or equal to two and 𝑥 over two if 𝑥 is greater than two. The piecewise definition of ℎ is three minus 𝑥 if 𝑥 is less than two and 𝑥 over two if two is less than or equal to 𝑥.

In our final example, we’ll look at how to define a piecewise function given a graph that also includes a discontinuity.

Give the piecewise definition of the function 𝑓 whose graph is shown.

We’re told that this graph represents the graph of a piecewise-defined function. And this makes a lot of sense. We see that it’s made up of three different parts. We have a linear function over here given by a single straight line and a other linear function here given by another straight line. But then we have something really strange here. We have a single dot at this point. And we’ll consider what that means for our piecewise definition in a moment.

For now, we’re going to begin by finding the equation of our two straight lines. We use the formula 𝑦 minus 𝑦 one equals 𝑚 times 𝑥 minus 𝑥 one, where 𝑚 is the slope of the graph and 𝑥 one, 𝑦 one is a single point it passes through. Then the slope is given by change in 𝑦 divided by change in 𝑥, which is 𝑦 two minus 𝑦 one over 𝑥 two minus 𝑥 one. And so let’s begin by finding the slope of our first line, we can choose any two points on this line. Let’s choose the points with coordinates negative three, six and one, two. Then change in 𝑦 divided by change in 𝑥 is six minus two over negative three minus one. Of course, we could write two minus six over one minus negative three and get the same result.

This gives us four divided by negative four, which is negative one. Then substituting everything we know about our first straight line into the formula for a straight line, and we get 𝑦 minus six equals negative one times 𝑥 minus negative three. Distributing the parentheses on the right-hand side, and this simplifies to negative 𝑥 minus three. Finally, we add six to both sides, and we find 𝑦 is equal to negative 𝑥 plus three or three minus 𝑥. And so for values of 𝑥 strictly less than two, we can use the equation 𝑦 equals three minus 𝑥 to draw its graph.

Next, we choose two points on our second line. Let’s choose the points with coordinates four, four and six, five. Change in 𝑦 divided by change in 𝑥 here is five minus four over six minus four, which is equal to one-half. So the slope of our second line is one-half. Substituting then 𝑚 equals one-half and 𝑥 one, 𝑦 one equals four, four into our formula for a straight line, and we get 𝑦 minus four equals a half times 𝑥 minus four. And that right-hand side simplifies to 𝑥 over two minus two. Then we add four to both sides. And we see that our second line has the equation 𝑦 equals 𝑥 over two plus two. Now, this time, that’s for values of 𝑥 strictly greater than two. So we now have the equations of our two straight lines. These are three minus 𝑥 if 𝑥 is less than two and 𝑥 over two plus two if 𝑥 is greater than two.

We’re not finished though; there was a third subfunction that we’re interested in. And this subfunction is represented graphically by a single point. This point has coordinates two, two. In other words, if 𝑥 is exactly equal to two, the function yields an output of two. And so that is our third subfunction. Noting that we can alternatively write the domain on our third line as two is less than 𝑥, we now have the piecewise definition of our function. It’s 𝑓 of 𝑥 is equal to three minus 𝑥 if 𝑥 is less than two, two of 𝑥 is equal to two, and 𝑥 over two plus two if two is less than 𝑥.

We’ll now recap some of the key points from our lesson. In this lesson, we learned that a piecewise-defined function is a function defined by multiple subfunctions. We then saw how each one of those subfunctions is defined over a given interval of the main functions domain. We can call that a subdomain. And we saw how by carefully considering their definition, we can identify the domain and range from a function and from its graph.

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