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

Scaling functions horizontally: examples

The function f(k⋅x) is a horizontal scaling of f. See multiple examples of how we relate the two functions and their graphs, and determine the value of k.

Want to join the conversation?

  • leaf orange style avatar for user Brendan
    Its just so round about, it does not make too much sense.
    I am going to attempt to explain this just so I can better understand it.

    g(x) = f(2x)
    means: in this case the input of g is twice as big as input of f or f input has to be multiplied by two for it to equal g input. This is the same as g(x/2) = f(x) (we have to divide input of g by two just for it to equal input of f)

    In summary, if we want to graph g, we should explain what g does to make more intuitive sense.
    Since g(x/2) = f(x), then g does the following.
    g(takes in input of f and divide it by two)

    so
    g(f(-4/2)) = (x = -2, y = is the same)
    g(f(4/2)) = (x = 2, y = is the same)

    since we are only changing x (input) and not touching the f(x) (output) we just keep the output the same for g(x) and f(x).
    (9 votes)
    Default Khan Academy avatar avatar for user
  • male robot johnny style avatar for user Mohamed Ibrahim
    Transformations of functions is the most trickier and interesting topic I've seen since joining khan academy. Scaling vertically and horizontally have connection, don't they ? if we scale by the same factor, are they the same in the linear function y=x and different in y=x^2
    (12 votes)
    Default Khan Academy avatar avatar for user
  • duskpin sapling style avatar for user JJ
    This is so confusing, I wish they had made summary/clarification/FAQ for this particular lesson like what they do for the lessons previously.
    (8 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user wonderbookworm820
    Does anyone understand how he got the x values for the table? Why are the 1/2x values the one used in the graph? Why aren't those just the x values?
    (5 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Elvis Chidera
      Explanation 1:
      Look carefully at both function f(x) and g(x).

      You will see that the only difference between them is that in g(x), x is multiplied by (1/2).

      So, g(x) = f(x/2).

      Explanation 2:
      f(x) = (x - 4)^2 - 4 ---- {Given in the question).
      Define a new variable b. Let b = (x/2).
      Substitute b into function f.
      f(b) = (b - 4)^2 - 4
      Since b = x/2.
      f((x/2)) = ((x/2) - 4)^2 - 4
      This is the exact same function as g(x).

      ----------------------------------------

      He used those x values because they have an easy to determine y value.

      Hope this helps.
      (4 votes)
  • sneak peak blue style avatar for user Aaryan Chopra
    Where did he get g(x)= f(0.5x)? It looks like he just ignored the whole rest of the equation.
    (3 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Vidit Jain
      He got g(x) = f(0.5x) from the first function of the graph of f(x). If you look at both of the equations of f(x) and g(x) you will notice that they both have the same horizontal translation and vertical translation than that of the parent function of x^2. The only change is that g(x) is a horizontal stretch by a factor of 2 than f(x). Thus he ignored the rest part of the equation since that was not required for graphing. If by any chance the graph of g(x) was to be graphed on the basic of the parent function then, yes, all of the characteristics of the graph needs to be in mind. But in this example you are graphing g(x) on the basis of f(x) so doing the translation which has been done already will lead to incorrect results. That is why he graphed g(x) = f(0.5x) rather than graphing the whole equation again.

      Hope this helps
      (5 votes)
  • eggleston blue style avatar for user Bread
    ngl this is pretty confusing at first glance.
    (5 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user pavankumar.naguvanah
    why is it 3x and not x/3 for g(x)?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • sneak peak blue style avatar for user padams
    When I tried doing this problem on my own I came to f(x)=g(1/3x) but Sal did f(3x)=g(x) are they the same thing?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • stelly blue style avatar for user Joshua C
    For the second question, why am i not able to solve the question by just subbing in x values and plotting the graph?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • leafers seed style avatar for user jadeeo
    if g(x) is half of f(x), then wouldn't the graph move half of x to the left (B/c all the x values are half less)
    (3 votes)
    Default Khan Academy avatar avatar for user

Video transcript

- [Instructor] We're told this is the graph of function f, fair enough. Function g is defined as g of x is equal to f of two x. What is the graph of g? So pause this video, and try to figure that out on your own. All right, now let's work through this. And the way I will think about it, I'll set up a little table here. And I'll have an x column, and then I'll have a, well, actually just put g of x column. And of course, g of x is equal to f of two x. So when x is, and actually let me see, when x is equal to, I could pick a point like x equaling zero, so g of zero is going to be f of two times zero. So it's going to be f of two times zero, which is still f of zero, which is going to be equal to a little bit over four, so which is equal to f of zero. And so they're going to both have the same y-intercept, but interesting things are going to happen the further that we get from the y-axis or as our x increases in either direction away, or as our x gets bigger in either direction from zero. So let's think about what's going to happen at x equals two. So at x equals two, g of two is going to be equal to f of two times two, two times two, which is equal to f of four. And we know what f of four is. F of four is equal to zero. So g of two is equal to f of four, which is equal to zero. So notice, the corresponding point has kind of gotten compressed in or squeezed in or squished in, in the horizontal direction. And so what you see happening, at least on this side of the graph, is everything's happening a little bit faster. Whatever was happening at a certain x, it's now happening at half of that x. So this side of the graph is going to look something, try to draw it a little bit better than that, it's going to look something like this, like this. Everything's happening twice as fast. And what happens when you go in the negative direction? Well, think about what g of negative two is. G of negative two is equal to f of two times negative two, two times negative two, which is equal to f of negative four, which we see is also equal to zero. So g of negative two is zero. And you might be thinking, "Why did you pick two and negative two?" Well, the intuition is that things are going to be squeezed in. Things are happening twice as fast. So whatever was happening at x equals four is now going to happen at x equals two. Whatever is happening at x equals negative four is now going to happen at x equals negative two. And I saw that we were at very clear points at x equals negative four and x equals four on f, so I just took half of that to pick my x-values right over here. And then so what our graph is going to look like is something like this. It's going to look something like this. It's going to look like it's been squished in from the right and the left. Now let's do another example. So now they've not only given the graph of f, they've given an expression for it. What is the graph of g of x which is equal to this business? So pause this video, and try to figure that out. All right, the key is to figure out the relationship between f of x and g of x. And what we can see, the main difference is, is instead of an x here in f of x, we have an x over two. So everywhere there was an x, we've been replaced with an x over two. So another way of thinking about it is g of x is equal to f of not x but f of x over two. Or another way of thinking about it, g of x is equal to f of 1/2x. And then we can do a similar type of exercise. And they've given us some interesting points, the points two, the point, or the point x equals two, the point x equals four, and the point x equals six. So let's think about this. Last time, when it was g of x is equal to two x, things were happening twice as fast. Now things are going to happen half as fast. And so what I would do, let me just set up a little table here. The interesting x-values for me are the ones that if I take half of them, then I'm going to get one of these points. So actually let me write this, half, 1/2x, and then I can think about what g of x is equal to f of 1/2x is going to be. So I want my 1/2x to be, let's see, it could be two, four, and six, two, four, and six. And why did I pick those again? Well, it's very clear what values f takes on at those points. And so if 1/2x is two, then x is equal to four. If 1/2x is four, then x is equal to eight. If x is equal to 12, then 1/2x is six. And so then we could say, all right, g of four is equal to f of two, which is equal to zero. That's why I picked two, four, and six. It's very easy to evaluate f of two, f of four, and f of six. They gave us those points very clearly. So g of eight is going to be equal to g, is going to be equal to f of 1/2 of eight, or f of four, which is equal to negative four. And then g of 12 is equal to f of six, which is half of 12, which is equal to zero again. So then we could plot these points, and we get a general sense of the shape of the graph. So let's see, g of four is equal to zero, g of eight is equal to negative four right over there, and then g of 12 is equal to zero again. So everything has been stretched out. So there you go, it's been stretched out in at least, in the horizontal direction is one way to think about it, in the horizontal direction. And you can see that this point in f corresponds to this point in g. It's gotten twice as far from the origin because everything is growing half as fast. You input an x, you take a half of it, and then you input it into f. And then this point right over here corresponds to this point. Instead of happening at four, this vertex point, it's now happening at eight. And last but not least, this point right over here corresponds to this point. Instead of happening at six, it's happening at 12. Everything is getting stretched out. Let's do one more example. F of x is equal to all of this. We have to be careful, there's a cube root over here. And g is a horizontally scaled version of f. The functions are graphed where f is solid and g is dashed. What is the equation of g? So pause this video, and see if you can figure that out. All right, let's do this together, and it looks like they've given us some points that seem to correspond with each other. To go from f to g, it looks like these corresponding points have been squeezed in closer to the origin. And what we can see is, is that f of negative three, f of negative three seems to be equal to g of negative one. And f of six over here, f of six seems to be equal to g of two, g of two. Or another way to think about it, whatever x you input in g, it looks like that's going to be equivalent to three times that x inputted into f. So g of x is equal to f of three x. And so if you want to know the equation of g, we just evaluate f of three x. So f of three x is going to be equal to, and I could just actually put an equal sign like this, f of three x is going to be equal to negative three times the cube root of, instead of an x, I'll put a three x right over there, three x plus two, and then we have plus one. And that's it, that's what g of x is equal to. It's equal to f of three x, which is that. We substituted this x with a three x. And we are done.