Transcript for:
Piecewise Functions and Absolute Value

hey everyone welcome back to wrath of math in today's video we'll be answering the question what is a piecewise function a piecewise function is quite intuitively a function that is defined in pieces I'm sure we're all familiar with a function like this f of X is equal to 2x with a function like this we have the same rule being applied to every single input value every value we input will be multiplied by 2 and that is the output so this function is going to look something like this so this is very nice and very simple we have the same rule for every input value in the functions domain piecewise functions of course are a bit more complicated and here is an example of a piecewise function we have one rule for all input values that are less than or equal to zero and we have a different input rule for all input values that are greater than zero so let's go ahead and sketch the graph of this function and don't let graphing a piecewise function scare you it's a lot like just graphing multiple functions on the same Cartesian plane for starters we'll graph the line 2x but only 4x is less than or equal to zero when x equals zero we know that 2x is also equal to zero so we'll have a point right at the origin let's have x equals negative two for our next point this still falls under this rule because negative 2 is less than or equal to zero so f of negative 2 is going to be 2 times negative 2 which is negative 4 so we'll graph that point negative 2 negative 4 that's right about here now I've covered up the negative sign on the 4 so let me just draw that on the other side negative 4 so when X is less than or equal to 0 our function looks something like that so that's one piece of the function what about the next piece for the next piece when x is greater than 0 the function is equal to 3 so that's very simple we can just draw a line here going from y equals three all the way off to infinity because for every x value greater than zero f of X is equal to three however there is one complication here we have to pay close attention to these inequalities our function is not equal to 3 at x equals 0 because when x equals 0 this is the rule we have to apply which would mean that f of 0 is equal to 0 that of course is our point at the origin so how can we indicate in our graph that this line does not include x equals 0 well the standard way to do that is to just put an empty circle at x equals 0 let me draw that again so it's more clear that it's an empty circle one more time yeah that's alright and then we'll draw the line just as before this empty circle at x equals 0 tells us that 0 3 is not actually part of this function because again when X is equal to 0 the function actually evaluates to 0 so you can see there is a sort of jump right there at x equals 0 in our piecewise function which is not something we're used to seeing in non piecewise functions so that's what a piecewise function is and one example on how to graph such a function it is a function that's defined differently at different parts of its domain it's defined in pieces now before we go let's just check out a piecewise function that we're all probably familiar with but haven't thought about as a piecewise function and that is the absolute value function the absolute value of a number basically just gets rid of the negative if there is one so the absolute value for is just for the absolute value of negative 3 though is positive 3 it tells us a numbers distance from zero and this is actually a piecewise function because if we input a negative number into the absolute value so if X is less than zero then the absolute value flips the sign of the number that we input so it outputs negative X for example when we input negative three since negative three is less than zero the absolute value function multiplies it by negative one in order to flip its sign negative three multiplied by negative one is of course positive three however if we input a number greater than or equal to zero into our absolute value function the sign of that does not need to be changed so it just outputs the input value if we input a value of four four is greater than or equal to zero so the absolute value just spits out four and you might be familiar with the graph of the absolute value function like with the last piecewise function we looked at in the graph of the absolute value function we see a sudden change in the appearance of the function it goes from this line with a negative slope y equals negative x to this line with a positive slope y equals positive x and I certainly think that's pretty cool we see the function getting closer and closer to zero but then it hits zero and boink it starts going up and remains non-negative so hopefully seeing a piecewise function you're familiar with helps a little bit I hope this video helped you understand what piecewise functions are and maybe a bit about how to graph them but we can go over more examples of graphing them in a later video if you'd like be sure to let me know in the comments if you have any questions need anything clarified or of any other video requests thank you very much for watching I'll see you next time and be sure to subscribe for the swankiest math lessons on the Internet and a big thanks to valo who upon my request kindly gave me permission to use his music in my math lessons linked to his music in the description [Music] it's inside to see kwasind for parties [Music]