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

Identifying horizontal squash from graph

Given the graphs of functions f and g, where g is the result of compressing f by a factor of 2, Sal finds g(x) in terms of f(x).

Want to join the conversation?

  • piceratops seed style avatar for user Manuel Del Río Rodríguez
    I really don't get this... what is the difference between vertical vs horizontal stretching/contracting? When I see a trasformed function, I just can't decide in which 'direction' it has been modified... it could well be both!
    (51 votes)
    Default Khan Academy avatar avatar for user
    • piceratops tree style avatar for user Theresa Johnson
      Vertical is up and down and horizontal is side to side so you just have to visualize what would happen to something if it was stretched in that directions. I usually think about people.

      If I took you, and stretched you vertically (i.e. in an up and down direction) you would look taller and skinnier - something we could all hope for.. However, if I stretched you horizontally (i.e. side-to-side) you would get shorter and fatter.

      Hope my crazy explanation is helpful.
      (79 votes)
  • leaf green style avatar for user Max Hederra
    what is the difference between 2f(x) and f(2x)?
    (21 votes)
    Default Khan Academy avatar avatar for user
    • aqualine tree style avatar for user Judith Gibson
      2f(x) says to multiply the function values by 2.
      So, let's say the function is f(x) = x^3 + 4x - 2,
      If we then chose x to be 5,
      f(5) would equal 125 + 20 -2 = 143
      and 2f(5) would equal 286
      However f(2x) says to double the value that is used as input,
      so f(2x) would be f(10)
      which would become 1000 +40 - 2 = 1038 (--- nowhere near 286!)
      To summarise,
      having 2f(x) merely doubles the output figures.
      Having f(2x) doubles the input figures and, depending on the function, that input may also then be raised to a power, multiplied by a constant, scaled down by a fraction, etc.
      Hope you find this useful!
      (48 votes)
  • male robot donald style avatar for user Praveen Bandarage
    Can someone please provide me with an explanation of what "in terms of" means, I understand the mathematics but whenever a question has "in terms of x, etc." I struggle to understand what to do?

    Thanks
    (15 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user Jim Winters
      When a question asks for "in terms of x", it just means that "x" appears in the answer. You might want to think of it as "using x". If the question asks for "g(x) in terms of f(x)", it means that you will be using f, although it might not literally be "f(x)". It might be something like "g(x) = 2 f(x - 1) + 3". But if you are given a relationship between g(x) and f(x), and you are asked to give g(x) in terms of x, then your answer should not mention f.
      (9 votes)
  • blobby green style avatar for user cj_echano
    Shouldn't g(x) = f(x/2) though?
    (6 votes)
    Default Khan Academy avatar avatar for user
  • starky ultimate style avatar for user Liv Li
    How do you tell the difference between graphs that have been scaled kf(x) vs. graphs that have been scaled f(kx)?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      kf(x): The entire function is scalled by "k". For example, if f(x) = x^2+3 then kf(x) = kx^2 +3k

      f(kx): All terms involving "x" will now also include the "k". For example, if f(x) = x^2+3, then f(kx) = (kx)^2+3
      Notice, the "k" is also squared in the first term, and the 3 did not change.

      Hope this helps.
      (6 votes)
  • blobby green style avatar for user Hassan Bouchaala
    Hi , correct me if i'm wrong but I think that g(x) = 1/2f(x) is also true because if I substitute (x) with one of it's values f(2) for exemple I get g(x) = 1/2f(2) which equals to 1 in the graph. and g(x) is found in terms of f(x) , thanks.
    (3 votes)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      g(2) would not = 1/2 f(2)
      1/2 f(2) = 1/2 * 1/2 = 1/4
      Yet, g(2) = -4, not 1/4
      So, your strategy is not working.

      Notice: Sal is defining when f(x) = g(x) based on their input values. What input values create the same output values.
      Sal came up with f(x) = g(x/2)
      You would also say f(2x) = g(x)
      Hope this helps.
      (4 votes)
  • old spice man blue style avatar for user treysonure
    How come g(x)=f(2x) instead of a g(x)=1/2f(x)?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • old spice man blue style avatar for user DJ Daba
      g(x) = f(2x) is saying that g(x) is half as wide as f(x), because for any x in g(x), it will be the same y value as f(x) when you double x.

      g(x) = 1/2 f(x) is saying that g(x) is half as tall as f(x), because for any y which is an output of f(x), g(x) will out put a y value half as large.
      (2 votes)
  • leafers tree style avatar for user Guildenstern87
    How would you expand expand g(x) to get f(x)?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Grus Japonensis
    I am wondering if there is a horizontal shift to the left occuring here, since the center of the graph moved left, but there is also the y intercept that did not shift, so is that the reference point then? Thanks
    (2 votes)
    Default Khan Academy avatar avatar for user
  • starky ultimate style avatar for user Vy Do
    what happens when there are multiple stretches/compressions in one function (both p and q are used)?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user La Brant, Geoff
      There's a kind of balancing out nature to them, however, it's only in appearance, technically, the order of operations can give you some insight into what is really happening to the input value of the function.
      Follow the path of the input value of the function through each step of the stretch/compression to see how its results are transformed, but the final result could look like no transformation took place.

      Check out what the transformation of x^2 look like when you consider 4(1/2x)^2 same shape. But does that mean nothing happened?
      (2 votes)

Video transcript

- [Voiceover] G of x is a transformation of f of x. The graph here shows this is y is equal to f of x, the solid blue line, This is y is equal to g of x as a dash red line. And they ask us, "What is g of x in terms of f of x?" And like always, pause the video and see if you can give a go at it and then we're going to do it together. All right, so when you immediately look like it, it looks like g of x is kind of a thinned-up version of f of x. It seems like if you were to compress it to towards the center, that's what g of x looks like but let's put a little bit more meat on that bone and see if we can identify corresponding points. So for example, if we were to look at f of negative six. That's, so f of negative six. That seems like it corresponds or it gives us the same value as f of negative six. So we wanna find the corresponding points. We hit this minimum point. We're coming back up. Hit the minimum point. We're coming back up. It seems like the corresponding point right over there is g of negative three. So let's write that down. Let's see, it looks like f of negative six and it is equal to g of negative three. These are corresponding points. If you apply the transformation at the point f equals, at the point negative six comma f of negative six. You get to the point negative three, g of negative three right over there. Let's do a couple of more. If you look at f is, so f of two, looks like it corresponds to g of one, f of two corresponds to g of one. So let's write that down. F of two looks like it corresponds to g of one. And once again, I'm looking at the where the functions hit the same value and also optically I'm just looking at, well, looks like it's the same part of the function if we assumed g of x is a squeezed version of f of x. And so in general, it looks like for given x. So we could say f of x is going to be equal to g of, well whatever you have it here, it seems like we have half the value over here. So g of x over two. Or if you wanted to think of it the other way, if you want to think of the other way, if you want to say g of x is going to be f of... Well, whatever we have here, it's f of twice that. So f of two x. And we see that that is one of the choices. The g of x is equal to f of two x. Whatever the x that you input into g of x, you get that same value out of the function when you input two times that into f of x. These seem to validate that. It looks optically like that and we shrunk it down. One way to think about it when you take, when you multiply the input into a function by a number larger than one, it's going to compress. It's going to make things happen faster. The input to the function is going to increase or become negative faster so it thins it up. And if that doesn't make intuitive sense, you can also just try some of these values. And I encourage you to try more. Find the corresponding points where the f's and the g's seem to match up. And you'll see over and over again that to get the same value, you have to put two times as much into f as you have to put into g. Hopefully that helps.