Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

Function Transformation Calculator

How to use
  1. Type the starting function in the f(x)f(x) box, for example x2x^2, x\sqrt{x} or sin⁡(x)\sin(x). Learn more about entering the function
  2. Set the four numbers of g(x)=a⋅f(b(x−h))+kg(x) = a \cdot f\big(b(x - h)\big) + k: Vertical scale a, Horizontal scale b, Shift right h and Shift up k. Leave a=1a = 1, b=1b = 1, h=0h = 0, k=0k = 0 for the ones you do not need.
  3. Read the formula of the new function under Transformed function, with its domain and range below. Learn more about reading the answer
  4. Look at the graph: the starting function is grey and dashed, the transformed one is blue. How it was found names every move in words.

Transformation
Transformed function
g(x)=1−2(x−3)2\displaystyle g(x) = 1-2 {\left(x-3\right)}^{2}
Domain and range of g
R,(−∞, 1]\displaystyle \mathbb{R}, \qquad (-\infty,\ 1]
How it was found

g(x)=a⋅f(b(x−h))+kg(x) = a \cdot f\big(b(x - h)\big) + k with a=−2a = -2, b=1b = 1, h=3h = 3, k=1k = 1, applied to f(x)=x2f(x) = {x}^{2}.

In words: shift right by 33, stretch vertically by the factor 22, reflect in the x-axis, shift up by 11.

The input numbers bb and hh act inside ff, on xx, and work "backwards" (a positive hh moves right, a bb above 11 squeezes); the output numbers aa and kk act on the result and work as they read.

Before: domain R\mathbb{R}, range [0, ∞)[0,\ \infty). After: domain R\mathbb{R}, range (−∞, 1](-\infty,\ 1].

Drawn by the tool
g(x)=1−2(x−3)2g(x) = 1-2 {\left(x-3\right)}^{2}read-only
f(x)=x2f\left(x\right)={x}^{2}
g(x)=1−2(x−3)2g(x) = 1-2 {\left(x-3\right)}^{2}


Transforming a function

DemoShift, stretch, flip
Step 0 of 4
    Type any function in the f(x)f(x) box and set four numbers. The calculator builds

    g(x)=a⋅f(b(x−h))+k,g(x) = a \cdot f\big(b(x - h)\big) + k,


    writes its formula, and draws it in blue over the dashed grey graph of ff.

    Each number does one job:

  • Shift right h moves the graph sideways: right for a positive hh, left for a negative one.
  • Shift up k moves it up for a positive kk, down for a negative one.
  • Vertical scale a stretches it away from the xx-axis (or squeezes it, if ∣a∣<1|a| < 1); a negative aa also flips it upside down.
  • Horizontal scale b squeezes it toward the yy-axis (or stretches it, if ∣b∣<1|b| < 1); a negative bb also mirrors it left to right.

  • The neutral values are a=1a = 1, b=1b = 1, h=0h = 0, k=0k = 0. With all four neutral, gg is ff.

Reading the answer

DemoChanges on the input side
Step 0 of 4
Transformed function gives the formula of gg with your numbers put in and tidied up. For f(x)=x2f(x) = x^2 with a=−2a = -2, h=3h = 3, k=1k = 1 it reads g(x)=1−2(x−3)2g(x) = 1 - 2(x - 3)^2.

Domain and range of g gives both sets, domain first.

How it was found then says the same thing three ways: the general form with your four numbers, the list of moves in words in the order they are applied, and the domain and range before and after, so you can see what each move did to them.
x2x^2 (dashed) and −2(x−3)2+1-2(x - 3)^2 + 1 (blue): the vertex has moved to (3, 1)(3,\ 1).

Shifts

Adding a number outside the function moves the graph vertically: f(x)+kf(x) + k is the graph of ff moved up by kk.

Subtracting a number inside moves it horizontally: f(x−h)f(x - h) is the graph of ff moved right by hh. The direction surprises people, because of the minus sign. The reason: g(x)=f(x−h)g(x) = f(x - h) takes at xx the value that ff took hh earlier, so everything happens hh later, that is, further right.

For f(x)=x2f(x) = x^2: (x−3)2(x - 3)^2 has its vertex at x=3x = 3, and x2+2x^2 + 2 has its vertex at height 22. To move left, use a negative hh: h=−3h = -3 gives (x+3)2(x + 3)^2.
x2x^2 (dashed), moved right by 33 (blue) and up by 22 (amber).

Vertical stretches and reflections

    Multiplying the function by aa multiplies every height by aa.

  • ∣a∣>1|a| > 1 stretches the graph away from the xx-axis: 3sin⁡(x)3\sin(x) runs between −3-3 and 33.
  • 0<∣a∣<10 < |a| < 1 squeezes it toward the xx-axis.
  • A negative aa also reflects it in the xx-axis: −sin⁡(x)-\sin(x) is sin⁡(x)\sin(x) turned upside down.

  • Points on the xx-axis do not move, since a⋅0=0a \cdot 0 = 0: the roots stay where they are.
sin⁡(x)\sin(x) (dashed), 3sin⁡(x)3\sin(x) (blue) and −sin⁡(x)-\sin(x) (amber).

Horizontal stretches and reflections

    Multiplying the input by bb changes how fast the function runs through its values.

  • ∣b∣>1|b| > 1 squeezes the graph toward the yy-axis by the factor 1∣b∣\dfrac{1}{|b|}: sin⁡(2x)\sin(2x) finishes a wave in π\pi instead of 2π2\pi.
  • 0<∣b∣<10 < |b| < 1 stretches it away from the yy-axis.
  • A negative bb also reflects it in the yy-axis: −x\sqrt{-x} is x\sqrt{x} mirrored to the left.

  • Again the effect looks backwards: a bigger bb makes the graph narrower, because the function reaches each value sooner. Points on the yy-axis do not move.
sin⁡(2x)\sin(2x) (blue) runs twice as fast as sin⁡(x)\sin(x) (dashed).
x\sqrt{x} (dashed), −x\sqrt{-x} (blue) and −x-\sqrt{x} (amber).

The order of the moves

In g(x)=a⋅f(b(x−h))+kg(x) = a \cdot f\big(b(x - h)\big) + k the moves are applied in this order:

1. horizontal scaling by bb (and the mirror, if b<0b < 0);
2. the shift right by hh;
3. vertical scaling by aa (and the flip, if a<0a < 0);
4. the shift up by kk.

Horizontal moves and vertical moves do not interfere with each other, but within each direction the order matters. Scaling after a shift also scales the shift.

That is why the form with b(x−h)b(x - h) is used. In f(2x−6)f(2x - 6) the shift is not 66: factor it as f(2(x−3))f(2(x - 3)) to see a squeeze by 12\dfrac{1}{2} followed by a shift of 33 to the right.

What happens to the domain and the range

    The input numbers bb and hh act on the domain; the output numbers aa and kk act on the range.

  • The domain of gg is the domain of ff divided by bb, then moved by hh. x\sqrt{x} has domain [0, ∞)[0,\ \infty); x−3\sqrt{x - 3} has [3, ∞)[3,\ \infty); −x\sqrt{-x} has (−∞, 0](-\infty,\ 0].
  • The range of gg is the range of ff multiplied by aa, then moved by kk. x2x^2 has range [0, ∞)[0,\ \infty); −2x2+1-2x^2 + 1 has (−∞, 1](-\infty,\ 1].

  • Key points travel the same way. The vertex (0, 0)(0,\ 0) of x2x^2 goes to (h, k)(h,\ k), which is why a(x−h)2+ka(x - h)^2 + k is called the vertex form of a parabola.

Common mistakes

  • Shifting the wrong way. f(x−3)f(x - 3) moves right, f(x+3)f(x + 3) moves left.
  • Scaling the wrong way. f(2x)f(2x) is narrower, not wider.
  • Reading the shift from an unfactored input. f(2x−6)f(2x - 6) is shifted by 33, not by 66.
  • Mixing up the two reflections. −f(x)-f(x) flips top to bottom (in the xx-axis); f(−x)f(-x) flips left to right (in the yy-axis).
  • Applying a vertical move to the domain. aa and kk never change the domain; bb and hh never change the range.