If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Algebra (all content)

### Unit 7: Lesson 25

Graphing nonlinear piecewise functions (Algebra 2 level)

# Graphs of nonlinear piecewise functions

Sal is given the graph of a piecewise function and several possible formulas. He determines which is the correct formula. Created by Sal Khan.

## Video transcript

Select the piecewise function whose graph is shown below. Or I guess we should say to the right. I copied and pasted it so it's on the right now. So we have this piecewise continuous function. So it's not defined for x being negative 2 or lower. But then starting at x greater than negative 2, it starts being defined. It's continuous all the way until we get to the point x equals 2 and then we have a discontinuity. And then it starts getting it defined again down here. And then it is continuous for a little while all the way. And then when x is greater than 6, it's once again undefined. So let's think about which of these functions describe this one over here. So this one looks like a radical function shifted. So square root of x would look like this. Let me do it in a color that you could see. Square root of x would look like this. So the square root of x looks like this. And this just looks like square root of x shifted 2 to the left. So this looks like square root of x plus 2. This one right over here looks like square root of x plus 2. And you could verify that. When x is negative 2, negative 2 plus 2, square root of that is going to be 0. And it's not defined there, but we see that if we were to continue it would have been defined there. Let's try some other points. When x is negative 1, negative 1 plus 2 is 1. Principal root of 1 is 1. Let's try 2. When x is equal to 2, 2 plus 2 is 4. Principal root of 4 is positive 2. So this just looks like a pretty good candidate. So it looks like our function. So let's see, it looks like our function would be-- and I'm not going to call it anything because it could be p, h, g, or f. But our function, if I were to write it out, it looks like over this first interval. So it looks like it's the square root of x plus 2 for negative 2 being less than x-- it's not defined at negative 2, but as long as x is greater than negative 2 and x is less than or equal to 2. And x is less than or equal to 2. So that's this part of the function. And then it jumps down. Now, this looks like x to the third. x to the third looks something like this. So x to the third power looks something like that. So let's see, negative 2 to the third power is negative 8. So it looks something like that. That's what x to the third looks like. So 2 to the third power is 8. So x to the third looks something like that. This looks like x to the third shifted over 4. So I'm guessing that this is x minus 4 to the third power. But we can verify that. When x is equal to 4, 4 minus 4 to the third power, we do indeed get the value of this expression being equal to 0. When x is 6, 6 minus 4 is 2 to the third power is indeed 8. When x is 2, 2 minus 4 is negative 2 to the third power is indeed negative 8. So this over this interval, it is x minus 4 to the third power. So we could say so this part of the function right over here, we could say is x minus 4 to the third power for 4x being greater than 2, or we could say 2 is less than x. And it's defined all the way to x being equal to 6, but not being greater than. So x is less than or equal to 6. So which of these choices are what we just put in? So the square root of x plus 2-- well, that's not-- let's see. Square root of x plus 2 for negative 2 is less than x is less than or equal to 2. X minus 4 to the third for 2 is less than x, which is less than or equal to 6. So I would go with that one.