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.

Main content

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.

Want to join the conversation?

  • leafers tree style avatar for user CupOfAwesome
    How can a certain graph 'look like' a certain function? Is this something you have to know by heart or start recognizing over time?
    EDIT: thanks for all the help. I'd just like to add that one can use Desmos Graphing Calculator (online, free) to easily draw these graphs.
    (36 votes)
    Default Khan Academy avatar avatar for user
  • female robot grace style avatar for user **RJ**
    if the graph was shifted to the left 2, then why is the graph sqrt(x +2)? similarly if the graph was shifted to the right 4, then why is the graph (x-4)^3?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Sumaya Hassan
    where can i find practice problems for this?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • hopper happy style avatar for user singhalm10
    So what is the official definition of a piece-wise function and how can they be applied to the real world?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • aqualine sapling style avatar for user YMarshall
    Does anyone have a method for determining this answer quicker? I know that there are questions like these on tests, and Sal seems to be testing all of the options, but what if the correct answer was the last one? The method seems to be a bit time-consuming, and I just wanted to know if anyone had any tips.
    (3 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Ed Miller
      Yes. If you scan down the answers, you will see that all of them describe two sub-functions, and in every case the sub-functions are of a similar form, i.e. based on √x and x³.
      Therefore, the answer must include a √x and a x³ type function over parts of the domain of x.
      You can also see that, in the case of the √x type function, each answer is dissimilar from the others. In each case, either the form of the function, or the interval over which it is defined is different from the others. This means that you need only concentrate on the √x type sub-functions to identify the correct answer.
      You may probably recognise the shape of the graph of a √x function, but even if you had never seen one, you know for example that the function will not increase as steeply as x³ for large values of x (those greater than one), and that it will be undefined for negative values of x. This will tell you that you need to focus on the graph that you see defined on the interval -2 < x <= 2 (see as in see the picture of the graph and read off the interval from the x-axis)
      Only f(x) and h(x) are defined over this interval with a √x type sub-function, so if you can distinguish between √(x-2) and √(x+2), you wll know the answer.
      You can know immediately that when x=2, f(x) will be zero, but h(x) will be √4. Looking at the graph, the graphed function is not zero when x = 2, so h(x) must be the answer.
      You could also look at the points where the graphed function has a zero value, at x= -2 and x=4 (although x = -2 is technically just beyond the boundary of the domain of x), and see which of the answers would provide those zero values. Only p(x) and h(x) do so, but we have established that p(x) isn't defined over the correct interval for the √x type sub-function.
      (2 votes)
  • blobby green style avatar for user Natalie Solorio
    what does it mean when the point is an open circle?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • aqualine sapling style avatar for user YMarshall
      It means that that function does not include that value. For example, if you were graphing x<0, there would be an open circle on zero, since zero is not included. If you were graphing x</= (greater than or equal to) 0, you would use a filled circle because zero is now included.
      (3 votes)
  • aqualine sapling style avatar for user YMarshall
    What exactly is a piecewise function? When would it be used in real life?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user mikerah14
    Why is it (x-4)^3 instead of (x+4)^3?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • duskpin tree style avatar for user Kat Lyon
    What does it mean if a point is an open circle?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • leaf red style avatar for user Noble Mushtak
      If a point is an open circle, then it is not included in the function. Here, there are two open circles. These circles signify that the function goes through or to there somehow so everything before or after it is part of the function, but the open circle itself is not part of the function. (-2, 0) and (2, -8) are not part of this function since there are open circles there, but the blue lines after those points are part of the function.
      (2 votes)
  • blobby green style avatar for user Cameron Williams
    I'm having a lot of problems with this. How am I supposed to know what a function looks like. I've been doing KH since Algebra and I'm confused. I watched the videos in this section. Did a miss a video where it explains what functions are supposed to be look like graphed. Please assist.

    Thanks
    (2 votes)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user Liam
      What I always do to check a function with a graph is to give the function the value x=0. This helps me A LOT and probably will to you as well. This basically tells us where on Y axis the point is situated when x=0.

      In this case for instance, try plotting x=0 into √(x-2). This will give us √-2 which is an imaginary number and cannot be displayed on a graph. Thus we know that one of the functions is √(x+2).

      By inputting x's will give you acquaintance of the form and eventually, you will know approximately (just as Sal) how a function will look like! It's all about practice :)
      (1 vote)

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.