 piecewise functions are those made from pieces of other functions. It's kind of like Dr. Frankenstein making his monster by taking the spleen of a radical function plus the pinky toe of an exponential function plus the liver of, you know, a power function or something like that, right? We piece together and make this monster function. So as piecewise functions are made from pieces of other ones, we have to specify which domain applies to which part, right? So you look at what's on the screen right now. This is a piecewise function with two parts. f of x is given as the square root of x minus four and eight minus two x. Well, when does it look like the radical function square root of x minus four? Well, when x is greater than equal to four. Okay. When does it look like a linear function eight minus two x? Well, that happens when x is less than four. When it comes to a piecewise function, we have to be very specific about the domain. So finding the domain of a piecewise function is relatively straightforward because they're telling you what the domain is. It's like, I wish they always would do that, but they have to tell you that the ambiguity cannot survive for a piecewise function. But questions of the range can be very challenging because when it comes to these pieces, when you look at eight minus two x, this would look like a line that is decreasing with negative two. So it looks something like this. Its domain and range are all real numbers. But when you look at the graph of f over here, its domain is not all real numbers. So how do we pull this apart? Well, you're going to have to look at it by pieces, right? And as you get good at graphing these functions, we can start graphing these pieces, right? So let's start off with how would you graph the square root of x minus four? So in my mind, when you start off with that piece right there, it's like, okay, I'm going to start off with the graph y equals the square root of four, right? Its domain is going to be zero to infinity. Its range is going to be zero to infinity. I know that because it's one of the standard graphs. Then you replace the square root of x with the square root of x minus four, that causes a shift to the right by four units. That'll change the domain to be four to infinity. But a horizontal shift doesn't change the range, so the range would still be zero to infinity. And so if I ever graph that, so when your four, greater than or equal to four, hey, that's the domain of this whole piece, I'm going to grab the whole chunk. And so by taking x to be greater than or equal to four, I'm actually graphing the entire square root function, which you can see right there. So you put that on the screen. So if I were to do this kind of side by side, let's see if I can get a way of doing this. So if I try to graph this thing over here, for which let's say that the y-axis is right here, and the x-axis is right there. And so counting this thing off, one, two, three, four, you're going to get this picture like the square root over there. That's what's happening, okay? So coming back to the main picture over here, what do you get from this other chunk? So this was our square root of x minus four. The other chunk came from 8 minus 2x, when x is less than four. So in this situation, our basic function we could think of is that's just as a line, right? It's just y equals x. What transformations did we do to it? Well, you're going to get 8 minus 2x, you know, that's going to be some type of shifting and reflecting and such. As it's just a line, I might actually prefer instead of thinking of transformations per se, just think of it as like mx plus b, the slope intercept form, where my y-intercept is going to be 8, which although that's off my screen, that would be somewhere up here, right? One, one, two, three, four, five, six, seven, eight, something like this. So that's your y-intercept. And then as it's a line, a line is determined by two points. So if I was graphing this thing, I include the y-intercept, which I did, then what happens when x equals 4, right? If I plug it into the function 8 minus 2 times 4, that will give you 8 minus 8, which is 0. Oh, 4 is the x-intercept of this line that gives you this point right here. And so kind of connecting the dots, you think of this is what your graph looks like right here. And so for our function, because they tell you the domain is less than 4, that becomes the domain of this function, right? So that the domain is just negative infinity up to 4, because that's what we said it has to be. The range, though, can get a little bit tricky. As we think about this thing, well, I'm going, going, going, going, going, going off towards infinity in that direction. So the range of this function, it's going to go off towards infinity. But it goes down until we get to almost 0, right? We don't quite touch 0, because since we don't include the number 4, but up to number 4, we don't actually get 0. So the linear part of this graph right here, its domain will be negative infinity to 4, its range will be 0 to infinity. Then when we look at the square root part of the graph, its domain is going to be, I'm going to put these together here, its domain is going to be 4 to infinity. So if you glue these things together, the domain of f, this is going to look like negative infinity to 4, union 4 to infinity. When you put those things together, that gives you all real numbers, negative infinity to infinity, right? The range, though, is a little bit more interesting, okay? When you take the range, we're going to take 0 to infinity, that's the range for the square root part, and then we union that with 0 to infinity. And so putting those together, 1 goes from 0 to infinity, includes 0, 1 goes from 0 to infinity, it doesn't include 0, we see the range is going to be 0 to infinity, like we saw on the picture right here. In which case, if we were trying to draw our picture right here, we would have then connected the dots with our line, like so. Let's look at another example. This one's a little bit more involved. There are three parts to our picture this time, but we'll just take it step by step by step. In terms of our function, we're going to have our blue part, we're going to have a green part, and we're going to have a yellow part. So I guess yellow is the picture of the graph on the screen, so I'm going to do a red part to help us see this part. So the blue part, when x is less than 1, that's going to be the line x plus 1. So if we deal with that, we look at the function y equals x plus 1, its domain is given as, well, negative infinity to 1, because that's what we're told. What is its range? Well, that we have to think about for a second, it's a line. So if I was to graph this thing, I'd be very interested in, well, what's the y-intercept? I know that the y-intercept is going to be y equals 1. I can see that. I'm also interested in what happens at the point, the switching number. Notice how it switches from one function to the other at 1. What happens at 1? So if you look at that, you look at y equals 1 plus 1, that's equal to 2. So I anticipate the point, the point 1 comma 2 should be on that graph, but notice the domain does not actually include 1. So I wouldn't include the point 1 comma 2. I would actually go up until it. So it's actually open point 1 comma 2. And so then we connect the dots because we get a line. And so we see that the line as we go to the left, since it was an increasing line, it goes all the way down to a negative infinity, that's its range. And then it goes up until 2, although 2 is not included. And that gives me the domain and range of the blue part and the graph. If we move on to the green part, this is a parabola, right? It's the parabola that goes from 1 to 3. And so that's going to be the domain of this thing, y equals x squared minus 3x plus 4. And its domain is specifically given 1 to 3 right here. What happens to this parabola? Well, if I was to graph it, some things I'd do is first, what happens at 1? What happens at the switching number? So if I compute that y equals 1 squared minus 3 times 1 plus 4, you'll notice that adds up to b, 1 minus 3 plus 4, that's going to give me a 2, right? So the point 1 comma 2 is on the graph. Now, 1 is included in the domain here. So this actually tells us that when I look at this point right here, 1 comma 2, I actually can fill in the dot now. And so this is a connection, right? These things touch each other, 1 comma 2 from one side, 1 comma 2 on the other side. This means there's this continuous graph. There's no breaker hole right there. On the other hand, what happens at 3, when x equals 3, you're going to get 3 squared minus 3 times 3 plus 4. That gives you 9 minus 9 plus 4, which is equal to 4. This would give us the point 3 comma 4 on the graph, like so, like so. And as I'm trying to graph a parabola, I probably care about the vertex. Remember, the vertex is going to equal h, that is h is equal negative b over 2a. So this would look like we're going to get a negative, negative 3 over 2 times 1. So we end up with a positive 3 halves or 1.5 if you prefer. And so that's going to be about right here, where the vertex of that thing should lie. Then the k value is just going to be evaluate the function at 3 halves there or 1.5, whichever you prefer. So we're going to get 3 halves, squared minus 3 times 3 halves plus 4. That gives me a 9 over 4 minus a 9 over 2, which I'm going to rewrite that as 4. So that's going to give me 18 force. So we're going to write the 4 as 16 force like here. And so 18 take away the 16 is going to give you a negative 2 force plus the 9 there. That should give us 7 force, which would equal 1.75, which you can see that right here. This is our vertex, 1.5 comma 1.75. And so then connecting those dots together, we get a parabola that looks something like this. In terms of its range, because the range of a parabola is determined by its vertex and its concavity, we see that the range of this thing is going to look like 1.75 going off towards infinity. But we have to kind of stop, right? We don't go all the way to infinity. We're bounded by this point at this point. So we actually only go up to 4 like so. But we get all the numbers between those. So for the last sector, we're going to do another line right here, right? This is a line which notice it as its x intercept 5. That's helpful. Then I'm kind of curious what happens at 3 when you plug in x equals 3 into the function there. You get 5 minus 3, which is equal to 2. So that gives us the point right here, 3 comma 2. Notice this point is not on the graph. We can connect the dots to make the line, which we do right here. But for the red function, we see that our domain is given to us. It's going to be 3 to infinity. But in terms of the range, the range is given us to us by 2 towards negative infinity. I should write the other way around. Negative infinity to 2 since it's decreasing. And so we want to put this all together. When we put all the domains together, the domain is pretty easy. The domain of g here is going to equal all real numbers. Negative infinity to infinity. We can see that listed here. We can go up to 1. We go from 1 to 3. We go to 3. No big deal. The range, though, we have to put this all together, right? What do we get on the range? Well, the blue part, remember, it goes all the way down to negative infinity. So does the red part. So we can go all the way down to negative infinity. There is this gap right here. There's this jump discontinuity at happening at s equals 3. But notice we actually do get all the values between y equals 2 and y equals 4 because the parabola will take care of that as well. So we get everything up to 4, for which then in the end, we would say that the range will be negative infinity to 4. And 4 is included inside of the range. So it can be a little trickier to find the range of a function. But if we can graph it, particularly piecewise functions, we can find the range. And that really is the best strategy to finding the range of a function. Think of the graph.