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 introduction

The graph y=k⋅f(x) (where k is a real number) is similar to the graph y=f(x), but each point's distance from the x-axis is multiplied by k. A similar thing happens when we graph y=f(k⋅x), only now the distance from the y-axis changes. These operations are called "scaling."

Want to join the conversation?

  • piceratops ultimate style avatar for user Tony Yin
    Basically, I had a really hard time understanding this topic, so I am going to write down what I found in terms of differentiating vertical shrinks and stretches from horizontal shrinks and stretches.

    Generally, if the point on the y-axis moves, it is a vertical stretch or shrink, and if it doesn't, then it is horizontal. Of course, this only applies if the point on the y-axis is not (0, 0), but that's the case most of the time.

    When the graph gets narrower, it is either a vertical stretch or a horizontal shrink; essentially, stretching AWAY from the x-axis or shrinking TO the y-axis.

    When the graph gets wider, it is either a vertical shrink or a horizontal stretch: essentially, shrinking TO the x-axis or stretching AWAY from the y-axis.

    So, in conclusion:

    if the graph moves on the y-axis:
    if the graph gets wider: vertical shrink
    if the graph gets narrower: vertical stretch

    if the graph does not move on the y-axis:
    if the graph gets wider: horizontal stretch
    if the graph gets narrower: horizontal shrink
    (20 votes)
    Default Khan Academy avatar avatar for user
    • mr pink green style avatar for user David Severin
      I am not sure what you mean by moving and not moving on the y-axis. If you have some function such as g(x)= a f(bx-c) + d, each of a, b, c and d have affects on the parent function. Only c and d actually translate points (which is what is generally referred to as "move"). So the vertical and horizontal stretches and compressions do not move points as much as relate how the points are related to each other/how they are related to the original parent function. a affects the vertical stretch (if a>1) or compression (if a<1<0) as well as the reflection across x (if a is negative). B affects the horizontal stretch (if 1<b<0) and horizontal compression (if b>1) as well as reflection across y (if b is negative). If you leave out the part of moving on the y-axis (which is an effect of translation, not stretches and compressions), your conclusions are correct in that a vertical stretch and a horizontal compression both make a graph get wider (or in the case of a linear equation have a steeper slope). Similarly, a vertical compression or a horizontal stretch make a graph get wider (or in the case of linear, a flatter slope).
      So let adding/subtracting things either inside the parentheses with the x or outside the parentheses do the moving of important points, and let multiplying either inside or outside the parentheses affect the stretches and compressions.
      As an example, if you have the parent function such as y=x^2, if you change this to a function g(x) = 16(x+2)^2 + 3, you would move the vertex of the parabola to (-2,3) and a vertical stretch by a factor of 16. By taking the √16=4, you could say the same equation could be written as g(x) = (4(x+2)^2+3 and have a horizontal compression by a factor of 4.
      While I see where you got the idea of moving along the y axis, if you have f(x) = 2-x^2 and g(x) = k f(x), when you make k=2, you are doing f(x) = 2(2-x^2) or 4-2x^2. If k=-2, you have f(x) = -2(2-x^2) which gives -4 + x^2, so the movement along the y axis is actually still an effect of the d (even though it is in a different order), not the effect of the stretch or compression.
      Ask more questions if needed, I hope this makes some sense.
      (9 votes)
  • stelly blue style avatar for user Benadryl
    this is kind of oversimplifying it, but if the k is inside the parenthesis, it only affects the x. if its outside (multiplying everything), then it affects the whole equation
    (12 votes)
    Default Khan Academy avatar avatar for user
  • stelly green style avatar for user Marissa.L.Medina
    where can i find a Desmos graphing calculator such as the one shown in the video
    I'll greatly appreciate any help
    am i missing any specific link?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user alexiawpy
    At , when Sal did f(k*x) for the function 2-x^2, was the k only applied to x? So it became 2-k*x^2? I am a bit confused here...
    (4 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user uditdagar2002
    If f(x)=(x-2)^2 - 1
    And y = f(x)
    Then what will be the graph of |y|=f(x)
    (4 votes)
    Default Khan Academy avatar avatar for user
    • mr pink green style avatar for user David Severin
      So (x-2)^2 is all positive, but by adding the -1, it shifts it down 1 (vertex at (2,-1)). Since it is negative in the domain of 1 to 3, the equation would be the same when less than or equal to 1 and greater than or equal to 3. However, between 1 and 3, it would reflect the curve across the x axis, so the vertex would flip to (2,1) which then curves to 1 and 3.
      It would have a normal quadratic curve (until 1), a small bump in the middle, then back to the normal curve at 3.
      (6 votes)
  • male robot hal style avatar for user Vinay Sharma
    I can't understand the difference between k*f(x) and f(k*x). It looks a lil' bit of a bizarre idea!
    (5 votes)
    Default Khan Academy avatar avatar for user
  • female robot amelia style avatar for user linda
    thank god for khan i kinda checked out during algebra 2 and now i have precalculus starting in a week and these videos have improved my confidence in starting college
    (7 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user David White
    In mathematics, a rigid transformation (also called Euclidean transformation or Euclidean isometry) is a geometric transformation of a Euclidean space that preserves the Euclidean distance between every pair of points.[1][self-published source][2][3]

    The rigid transformations include rotations, translations, reflections, or any sequence of these. Reflections are sometimes excluded from the definition of a rigid transformation by requiring that the transformation also preserve the handedness of objects in the Euclidean space. (A reflection would not preserve handedness; for instance, it would transform a left hand into a right hand.) To avoid ambiguity, a transformation that preserves handedness is known as a proper rigid transformation, or rototranslation.[citation needed] Any proper rigid transformation can be decomposed into a rotation followed by a translation, while any improper rigid transformation can be decomposed into an improper rotation followed by a translation, or into a sequence of reflections.

    Any object will keep the same shape and size after a proper rigid transformation.

    All rigid transformations are examples of affine transformations. The set of all (proper and improper) rigid transformations is a mathematical group called the Euclidean group, denoted E(n) for n-dimensional Euclidean spaces. The set of proper rigid transformations is called special Euclidean group, denoted SE(n).

    In kinematics, proper rigid transformations in a 3-dimensional Euclidean space, denoted SE(3), are used to represent the linear and angular displacement of rigid bodies. According to Chasles' theorem, every rigid transformation can be expressed as a screw displacement.
    (4 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user cadetljohnson
    why do you keep changing the scale
    (2 votes)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user Rohan SP
    What if you move the graph left or right, for example, f(x)=|x-3|, when you multiply it by a constant k, would it have an impact on the x intercept? What about f(k*x)?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • leafers seedling style avatar for user CCDM
      f(x)=k|x-3| has the same x intercept at 3 (shifted) but the k factor makes the slopes "steeper". f(kx) in the original expression for f(x), becomes |kx - 3| and the x intercept becomes kx=3 or x=3/k. As before, the slope becomes steeper (slope of +/-k rather than +/- 1)
      (0 votes)

Video transcript

- [Tutor] So this is a screenshot of Desmos, it's an online graphing calculator, what we're gonna do is use it to understand how we can go about scaling functions and I encourage you to go to Desmos and try it on your own either during this video or after. So let's start with a nice, interesting function, let's say f of x is equal to the absolute value of x, so that's pretty straightforward. Now let's try to create a scaled version of f of x, so we could say g of x is equal to, well, I'll start with just absolute value of x, so it's the same as f of x, so we'll just trace the g of x right on top of f, but now let's multiply it by sum constant, let's multiply it by two. So notice the difference between g of x and f of x and you can see that g of x is just two times f of x, in fact we can write it this way, we can write g of x is equal to two times f of x, we get to the exact same place, but you can see that as our x increases, g of x increases twice as fast, at least for positive xs on the right-hand side and actually as x decreases, g of x also increases twice as fast, so is that just a coincidence that we have a two here and it increased twice as fast? Well, let's put a three here, well now it looks like it's increasing three times as fast and it does that in both directions. Now what if we were to put a 0.5 here, 0.5? Well now it looks like it's increasing half as fast and that makes sense, because we are just multiplying, we are scaling how much our f of x is. So before when x equals one, we got to one, but now when x equals one, we only get to one half, before when x equals five, we got to five, now when we get to x equals five, we only get to 2.5, so we're increasing half as fast, or we have half the slope. Now an interesting question to think about is what would happen if instead of it just being an absolute value of x, let's say we were to have a non-zero y intercept, so let's say, I don't know, plus six, so notice then when we change this constant out front, it not only changes the slope, but it changes the y intercept, because we're multiplying this entire expression by 0.5, so if you multiply it by one, we're back to where we got before and now if we multiply it by two, this should increase the y intercept, 'cause remember we're multiplying both of these terms by two and we see that, it not only doubles the slope, but it also increases the y intercept. If we go to 0.5, not only did it decrease the slope by a factor of one half, or I guess you could say multiple the slope by one half, but it also made our y intercept be half of what it was before and we can see this more generally if we just put a general constant here and we can add a slider and actually let me make the constant go from zero to 10 with a step of, I don't know, 0.05, that's just how much does it increase every time you change the slider and notice when we increase our constant, not only we're getting narrower, 'cause the magnitude of the slope is being scaled, but our y intercept increases and then as k decreases, our y intercept is being scaled down and our slope is being scaled down. Now that's one way that we could go about scaling, but what if instead of multiplying our entire function by sum constant, we instead just replace the x with a constant times x, so instead of k times f of x, what if we did it f of k times x? Another way to think about it is g of x is now equal to the absolute value of kx plus six, what do you think is going to happen? Pause this video and think about it. Well now when we increase k, notice it has no impact on our y intercept, because it's not scaling the y intercept, but it does have an impact on slope, when k goes from one to two, once again we are now increasing twice as fast and then when k goes from one to one half, we're now increasing half as fast. Now this is with an absolute value function, what if we did it with a different type of function, let's say we did it with a quadratic? So two minus x squared, let me scroll down a little bit and so you can see when k equals one, these are the same and now if we increase our k, let's say we increase our k to two, notice our parabola is in this case decreasing as we get further and further from zero at a faster and faster rate, that's because what you would have seen at x equals two, you're now seeing at x equals one, because you are multiplying two times that and so then if we go between zero and one, notice on either side of zero, our parabola is decreasing at a lower rate, it's a changing rate, but it's a lower changing rate, I guess you could put it that way and we could also try just to see what happens with our parabola here, if instead of doing kx, we once again put the k out front, what is that going to do? And notice that is changing not only how fast the curve changes at different points, but it's now also changing the y intercept, because we are now scaling that y intercept. So I'll leave you there, this is just the beginning of thinking about scaling, I really want you to build an intuitive sense of what is going on here and really think about mathematically why it makes sense and go on to Desmos and play around with it yourself and also try other types of functions and see what happens.