 This is gonna be our last video for lecture three in our series here. And in this video, we're gonna introduce the notion of a piecewise function. So sometimes one single algebraic expression is insufficient to describe a function, maybe because the output needs, it needs to be computed differently at different locations in the domain. I mean, think for example, like federal taxes and income brackets and such, right? It turns out that there's a lot of different factors to determine how much one would pay in US income tax, federal income tax and things like that. And so it depends on how much money you make, right? And so it changes, the formula changes based upon your income in a given year. This is an example of a piecewise function where a piecewise function is a function that's broken into two or more pieces. When you're reading a piecewise function, like say f of x equals, you'll typically see first like this large brace, this curly brace that everything to the right of it will be part of the function. And so you'll be given, like everything to the right of the brace will be into two columns, right? You'll have some type of formula. So you'll have something like x squared plus x plus one. Then you might have something like two times three to the x plus five. And then you might have something like the square root of one minus x. You know, you'll have some functions provided to you. This is in the first column. So these are different formulas that will describe the same function f right here, but just at different parts. In the second column, where they're gonna specify the domains of those pieces. So if we say something like when x is greater than five, this is the domain for this piece right here when x is greater than five. We might say something like, well, when x is between one and less than equal to four, that determined you'll use this segment. And then we might say something like otherwise for everything else. That's a good way of doing it. Or maybe we wanna be more specific and we say something like, okay, when x is less than or equal to one, we get the following, right? And so we then specify the domain here. And notice that things could be missing from the domain, right? I never actually told you what happens between four and five on this function. That's outside the domain. You can do that with a piecewise function. You have to be explicit on what the domain is. Implication doesn't work very well. Inference doesn't work very well unless you do have a statement that says otherwise at the bottom. Now, because of the nature of a piecewise function, you have all these very different function pieces put together, the term that comes into play here is the idea of a continuous function. We say that a function is continuous. It has no gaps or holes in its graph. Because what we will see very shortly is it's very easy for a piecewise function to have gaps and holes in it. If we don't stitch it together very carefully, I like to think of piecewise functions as the Frankenstein of functions because we'll take the spleen of one function and stitch it to the intestines of another function and we'll take the left pinky toe of another function. We stitch it all together and make this monster of a function. Let's look at a few examples of this. So our first one here, f of x here is given as a piecewise function has two pieces. The first piece will be x plus one exactly when x doesn't equal one. So when x doesn't equal one, we define the function to be x plus one. But then when x does equal one, we define the function to be three. And so we can see a picture of the graph over here of the function f. Now, if you're looking at the graph, y equals x plus one, this should look like just a linear function. It's slope is one, it's y intercept one. It should look like what you see here in yellow, perfectly fine. But for whatever reason, we've redefined what the function does at one. When x equals one, the y-coordinate is a three and you see that point right here. Again, for whatever reason, x equals one was moved so that the y-coordinate was three. On the other hand, if you actually plugged in x equals one into this expression here, y equals one plus one, you would kind of expect the function to be two, right? When you look at here, there's like this hole on the screen there. You kind of expect the point one comma two to be a point on the graph, but for some reason we redefined it to be something else. There could be a good reason for that, but we don't have a verbal description to tell us what context would justify this. But for whatever reason, someone's removed the point. And as such, this function is discontinuous at x equals one. So this function is discontinuous because it's not continuous. It's discontinuous at x equals one because there's a hole. There's a hole there at x equals one. Let's see. And then that defines our function for us here, right? I could say some other things. This graph, of course, is increasing. It's increasing, making some connections to things we talked before. It's increasing on the interval negative infinity to one, union one to infinity. The problem is at that discontinuity, we really can't say it increased or not because it kind of jumped around there. So we could say some things about this function. Domain will be all real numbers because it's defined for all real numbers, right? The domain of f is equal to all real numbers. There is no number that it's not defined at. It is defined at x equals one. It's just something different than what the picture might expect you to have. Let's look at another example. Like I said, these things are kind of freaks, Frankensteins of the math world here. Consider the function g of x, which is given by the following. g of x will look like the square root of x minus four when x is greater than or equal to four, and it'll behave like eight minus two x when x is less than four. And so we can see what's happening here. When x is greater than or equal to four, it'll look like the function, the square root of x minus four, which looks like this blue portion highlighted right now. Why that's what the graph looks like is something we'll talk about a little bit more, but basically it's the standard square root function that has been shifted to the right by four units. Then when you're less than four, this graph will look like eight minus two x. This is a line, which has a slope of negative two, one or seven, eight. It's x intercepted before, and it looks like this portion right here. And so some things we can mention is that this graph is in fact continuous. It's continuous because there's no gaps or rips or breaks in the graph whatsoever. You notice that as it's switched from one part to another, it's connected, and that's what we mean by continuous. Continuous is to suggest that we could draw this picture with one continuous stroke of our pen without ever having to pick it up to draw the picture. That's what a continuous graph is. It's domain, of course, is gonna be all real numbers. This thing is defined for all real numbers, no exceptions to that. It is, let's see, it's increasing on the interval four to infinity and it's decreasing. It's decreasing on the interval from negative infinity to four. We can say that the graph is concave upward never, right? It is concave downward on the interval four to infinity, and it's also straight on the interval negative infinity to four, because it's just a line in that context. And I want you to be aware of that function evaluation here. It's like playing with a coin machine, a coin sorter. Like you put nickels and dimes. It'll automatically sort these things into different categories. If you want to do, for example, g of zero, well, zero is less than four, so use the second part right here. You're gonna get eight minus two times zero, you get eight as the wide intercept. Which if we continue on this trajectory, that's what you're gonna get there. If you wanted to do g of one as another example, again, one is in the category less than four, so you're gonna get eight minus two times one, which is equal to six this time. If you wanted to do g of, say, oh, it's another one, eight, right, g of eight. Now this time g of eight is greater than or equal to four, so we're gonna use the other compartment. We're gonna get the square root of eight minus four, which is the square root of four, which is two. So the evaluation depends on which interval are you in when you're looking at this thing, all right? And let's do one more example of these piecewise functions. This one's sort of an interesting creature. We have three different pieces here. When the function, when x is less than one, we will look like the line x plus one. When we're between one and three inclusive, it'll look like the parabola x squared minus three x plus four. And then finally, when x is greater than three, it'll look like the line five minus x. At this moment, don't be too worried about how to graph these things. This'll be things we will talk about in the future, although you might already be knowing how to do this. It's not like it's necessarily new information. But looking at the graph right here, right, what are some things we can say? Like if we take h of zero, h of zero would be in the compartment x less than one. So we're gonna take zero plus one and we get one. If you want to do, for example, h of one, well, where does h of one fall? Notice one is not less than one, one is equal to one. So you use the middle piece. You're gonna get one squared minus three times one plus four, which is going to give you one minus three is negative two plus four, which equals two. The evaluation right there. What if you wanna do h of two? Well, h of two is, again, two falls in this middle compartment. So you plug in two right there, two squared minus three times two plus four. We get four minus six plus four, which gives us two again. H of three, well, where is h of three? So notice one and three are kind of significant for this function, because these are the switching numbers. It switches behavior at one and it switches behavior at three. Who decides what happens at three? Well, that's because it's less than or equal to three. It'll look like the parabola again. Three squared minus three times three plus four. You're gonna end up with nine minus nine plus four, which gives you four in that situation. And then lastly, if we did one more, like say h of four, for example, four is greater than three, so we use the line to determine what happens. We get five minus four, which is equal to one. We can do all those evaluations. And notice that when you take x equals five, one, two, three, four, five, let's see. Sorry, we're doing four. I meant to do one, two, three, four. You get the point right here of four comma one. We ended up doing h of three. We ended up with this point right here, three comma four. This point right here, where it switched between the line and the parabola, this would be one comma two. We did that one. We did two comma two, which is this point right here. We also end up doing the y-intercept, zero comma one. And we could do much more if we wanted to. Be aware that graphing a function is essentially just plotting a lot of points. It's about doing a whole lot of evaluation and playing connect the dots. Believe it or not, that skill we learned in kindergarten is college level mathematics. This is college algebra, after all. Connecting the dots is how we essentially graph functions. We just get a lot of points and we connect the dots here. This function, of course, is not continuous. We do have this discontinuity right here. There's a discontinuity. It's discontinuous. I feel like there should be another letter in there. I don't know, I'll probably embarrass myself. What you do here is whenever you don't have to spell something, just abbreviate it. And then no one knows the wiser, right? It's discontinuous at the value x equals two. Because you'll notice there's this break, this jump that happened in the graph. The function at three is defined to be four, but part of it wants to look like two right here, right? Y equals two. That comes from this piece right here. If you plug in x equals two there, sorry, x equals three, you end up with five minus three, which is two. So the function is discontinuous. It's increasing from negative infinity to one. It's then decreasing until this value, wherever that is, they'll start increasing again and it starts decreasing. We can do all those analyses for piecewise functions. It's just sometimes you need a more exotic function like this. And if you're careful, you can actually piece it together to make it continuous. But oftentimes if you just throw random functions on the screen to make a piecewise function, it looks like this Frankenstein freak and it'll be a discontinuous mess. And so that brings us to the end of lecture three. We'll talk some more about functions, of course, in our next lecture, so take a look at the link that you should hopefully see on the screen right now. If you learned something, by all means, hit the like button. If you'd like to learn more about mathematics in the future, subscribe to get updates about future videos. And as always, if you have any questions whatsoever about the mathematics, if anything was unclear, if you just want to get deeper and deeper into the material, ask your questions and post them in the comments below. I'd be happy to answer them. And until then, I'll see you next time. Bye everyone.