Guides / Functions

Function transformations: shifts, stretches, reflections, and why f(x + 3) moves left

Every number in −2√x − 1 + 3 does one thing to the graph of √x. The points get lost when a plus inside the function is read as "move right," when the shift is applied before the stretch, and when f(2x − 4) is shifted 4 instead of 2.

Short answer

Changes outside the function act on y and do what they say: f(x) + 3 moves up 3, 2f(x) stretches vertically by 2, −f(x) flips over the x-axis. Changes inside act on x and do the opposite of what they say: f(x + 3) moves left 3, f(2x) compresses horizontally by 2, f(−x) flips over the y-axis. Apply stretches and reflections before shifts. If the inside is 2x − 4, factor it to 2(x − 2) before you read the shift.

Why it works

Take a point (a, b) on f, so f(a) = b. On the graph of g(x) = f(x − 3), which input gives that same output b? You need x − 3 = a, so x = a + 3. The point has moved to (a + 3, b): right by 3, even though the formula says "minus 3." The inside change tells you what to do to x to get back to the original input, so the graph moves the other way.

Outside changes happen after f has done its work, so they act on the output directly. 2f(x) + 3 takes the output, doubles it, then adds 3. That is the order you apply them in: stretch first, then shift, the same way the formula computes it.

Example 1: a parabola with two shifts

Describe g(x) = (x + 2)2 − 5 as a transformation of f(x) = x2, and find the vertex.

  1. g(x) = f(x + 2) − 5Inside: x + 2. Outside: − 5.
  2. Left 2, then down 5The inside +2 moves the graph left 2 (the opposite of its sign). The outside −5 moves it down 5.
  3. Vertex (0, 0) → (−2, −5)Check: g(−2) = 0² − 5 = −5. Another point: (1, 1) on x² moves to (−1, −4), and g(−1) = (1)² − 5 = −4.

Example 2: shift, stretch, reflect, shift

Describe g(x) = −2√x − 1 + 3 as a transformation of f(x) = √x, and find where the point (4, 2) ends up.

  1. Inside: x − 1 → right 1The only change inside the square root is −1, so the horizontal move is right 1. Do this to the x-coordinate: (4, 2) → (5, 2).
  2. Outside: × (−2) → stretch by 2 and flipMultiply the y-coordinate by −2: (5, 2) → (5, −4). The stretch and the reflection both happen here, before the +3.
  3. Outside: + 3 → up 3(5, −4) → (5, −1).
  4. (4, 2) → (5, −1)Check: g(5) = −2√4 + 3 = −4 + 3 = −1. The starting point (0, 0) goes to (1, 3), and g(1) = −2 · 0 + 3 = 3.

Because the graph was flipped and moved up 3, it now starts at (1, 3) and heads down. Its domain is x ≥ 1 and its range is y ≤ 3, which you can read straight off the transformation (see domain and range).

Example 3: a coefficient on x inside

Describe g(x) = |2x − 4| + 1 as a transformation of f(x) = |x|, and find the vertex.

  1. |2x − 4| + 1 = |2(x − 2)| + 1Factor the coefficient of x out of the inside first. The shift is the number next to x after factoring: 2, not 4.
  2. Compress horizontally by 2, then right 2, then up 1Inside: the 2 squeezes x-coordinates to half, the −2 moves right 2. Outside: +1 moves up 1.
  3. Vertex (0, 0) → (0, 0) → (2, 0) → (2, 1)The compression doesn't move a point on the y-axis. Check: g(2) = |4 − 4| + 1 = 1.
  4. (2, 2) → (1, 2) → (3, 2) → (3, 3)Halve x, add 2 to x, add 1 to y. Check: g(3) = |6 − 4| + 1 = 3.

There is another correct reading. Since |2(x − 2)| = 2|x − 2|, the same graph is |x| stretched vertically by 2, moved right 2 and up 1. Both descriptions give a V with vertex (2, 1) and slopes ±2. For a V or a parabola, a horizontal compression and a vertical stretch can produce the same picture; for most other functions they don't.

Example 4: writing the equation from a description

Write the equation of f(x) = x3 reflected over the y-axis and moved down 4.

  1. f(−x) = (−x)3A reflection over the y-axis replaces x with −x inside.
  2. g(x) = (−x)3 − 4Down 4 is −4 on the outside.
  3. g(x) = −x3 − 4(−x)³ = −x³ because the power is odd. Check with the point (2, 8): it reflects to (−2, 8), then drops to (−2, 4). g(−2) = −(−8) − 4 = 4.

Common mistakes, and the exact line they happen on

1. Reading f(x + 3) as "move right 3"

Describe g(x) = (x + 3)2.

  1. x2 shifted right 3, vertex (3, 0)This is the mistake. Plug in x = 3: g(3) = 6² = 36, nowhere near the vertex. The vertex is where the inside is zero, x + 3 = 0, which is x = −3. The graph moved left.

The inside asks "what x makes this equal to the original input?" and the answer always has the opposite sign. If you can't remember, find the x that zeroes the inside and that tells you the shift.

2. Shifting before stretching

Find where (4, 2) on √x lands on g(x) = 2√x + 3.

  1. (4, 2) → (4, 5) → (4, 10)This is the mistake. The +3 was applied first and then doubled along with everything else. The formula computes 2 · √4 first, then adds 3: g(4) = 2 · 2 + 3 = 7, not 10.
  2. (4, 2) → (4, 4) → (4, 7)Stretch, then shift, in the order the formula evaluates.

The only time the order doesn't matter is when the two changes act on different coordinates, such as a vertical stretch and a horizontal shift. Two changes on the same coordinate must go in formula order.

3. Shifting by the constant instead of factoring first

Describe g(x) = |2x − 4| + 1 (Example 3).

  1. Compress by 2, then right 4, vertex (4, 1)This is the mistake. g(4) = |8 − 4| + 1 = 5, so (4, 1) isn't on the graph at all. The −4 is being multiplied by the 2 as well; the actual shift is 4 ÷ 2 = 2.

Write the inside as 2(x − 2) and the numbers you read off are right.

4. Mixing up −f(x) and f(−x)

Describe g(x) = −√x.

  1. √x reflected over the y-axisThis is the mistake. The minus is outside, so it flips y-values. g(4) = −2: the point (4, 2) went to (4, −2), straight down. The domain is still x ≥ 0, so the graph never crosses to the left side.
  2. √x reflected over the x-axisThe y-axis reflection is √−x, whose domain is x ≤ 0 and whose point is (−4, 2).

For even functions like x2 and |x|, f(−x) = f(x), so the y-axis reflection changes nothing and the mistake is invisible. The square root, the cube, and anything with a one-sided domain show the difference immediately.

Practice

  1. Describe g(x) = (x − 4)2 + 2 as a transformation of x2 and give the vertex.

    Show answer

    Right 4, up 2. Vertex (4, 2).

  2. The point (9, 3) is on √x. Where is it on y = −√x + 5?

    Show answer

    Left 5, then flip over the x-axis: (4, −3). Check: −√4 + 5 = −3.

  3. Write the equation of |x| stretched vertically by 3, reflected over the x-axis, and moved up 6.

    Show answer

    y = −3|x| + 6. The vertex is at (0, 6) and the V opens downward.

  4. Describe g(x) = (3x + 6)2 as a transformation of x2 and give the vertex.

    Show answer

    Factor: (3(x + 2))2. Compress horizontally by 3, then left 2. Vertex (−2, 0). Equivalently, 9(x + 2)2: a vertical stretch by 9 and left 2.

  5. f(x) = x3 and g(x) = f(−x) + 1. Write g(x) without f, and find where (2, 8) lands.

    Show answer

    g(x) = (−x)3 + 1 = −x3 + 1. The point goes to (−2, 9). Check: −(−2)3 + 1 = 8 + 1 = 9.