Lesson Video: Graphs of Piecewise Functions | Nagwa Lesson Video: Graphs of Piecewise Functions | Nagwa

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.

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

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