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.