Topic · Precalculus

Function Transformations

Given a graph of $y = f(x)$, five simple algebraic moves — shift, stretch, reflect, on either axis — let you generate an entire family of related graphs without plotting a single new point. Learning the moves (and the two places they're counter-intuitive) is what turns "graph this thing" into something you can do by sight.

What you'll leave with

  • The five basic transformations of $y = f(x)$ and exactly what each one does to the graph.
  • Why inside-the-function operations have the opposite effect from what naïve algebra suggests.
  • The general form $y = a\,f\!\bigl(b(x - h)\bigr) + k$ and how to read off all four parameters at a glance.
  • A worked demonstration that order of transformations matters, with two compositions giving different graphs.
  • A point-tracking recipe: where does a known point on $f$ land on the transformed graph?

1. Why transformations are worth learning

Every quadratic is a transformation of $y = x^2$. Every sinusoid is a transformation of $y = \sin x$. Every exponential decay curve is a transformation of $y = e^{-x}$. Precalculus is, in large part, an inventory of parent functions together with the rules for deforming them.

Once you have the rules, you no longer need a table of values to sketch $y = 2\sin\!\bigl(3(x - \pi/6)\bigr) + 1$. You see the parent ($\sin$), the amplitude ($2$), the period ($2\pi/3$), the phase shift ($\pi/6$ right), and the vertical offset ($+1$), and you draw it. Calculus then leans on the same idea: shifts don't change derivatives, stretches scale them, reflections flip their sign.

A transformation is a function on functions — a rule that takes one graph in and gives a related graph out.

2. The five basic transformations

Throughout this section, $f$ is some parent function whose graph you already know. The transformed function — always called $g$ — is built from $f$ by a single algebraic move.

Vertical shift — $g(x) = f(x) + k$

Adds $k$ to every output. The graph moves up by $k$ when $k > 0$, down when $k < 0$. Intuitive: you change every $y$, so the picture slides vertically.

Horizontal shift — $g(x) = f(x - h)$

The graph moves right by $h$ when $h > 0$, left when $h < 0$. The sign is counter-intuitive: the "$-h$" inside produces a rightward shift. We unpack why below.

Vertical stretch — $g(x) = a\,f(x)$

Multiplies every output by $a$. For $|a| > 1$, the graph is taller (stretched). For $0 < |a| < 1$, it's flatter (compressed). If $a < 0$, there's an additional reflection across the $x$-axis. Intercepts with the $x$-axis don't move; everything else scales vertically.

Horizontal stretch — $g(x) = f(bx)$

Replaces $x$ with $bx$ inside the function. For $|b| > 1$ the graph compresses horizontally (counter-intuitive!); for $0 < |b| < 1$ it stretches by $1/|b|$. If $b < 0$, there's an additional reflection across the $y$-axis. Intercepts with the $y$-axis don't move; everything else scales horizontally.

Reflections — $-f(x)$ and $f(-x)$

$-f(x)$ flips the graph across the $x$-axis (negates every $y$). $f(-x)$ flips it across the $y$-axis (negates every $x$). These are the $a = -1$ and $b = -1$ special cases of the stretches above.

Inside vs. outside

Outside the function ($+k$, $a\cdot$, $-$) acts on outputs and does what you'd expect. Inside the function ($-h$, $b\cdot$, $-x$) acts on inputs and does the opposite of what naive algebra suggests — it shifts the graph the wrong way, scales it the wrong way, and reflects across the other axis. This single rule absorbs most of the confusion in this topic.

Why "inside" inverts

Take horizontal shift. To plot $g(x) = f(x - 2)$ at the input $x = 5$, you compute $f(5 - 2) = f(3)$. The graph of $g$ at $x = 5$ takes the value $f$ had at $x = 3$. Every point on $f$ shows up on $g$ shifted to the right by $2$, because we had to feed in an $x$ that was $2$ larger to reach the same output. The "$-2$" inside is doing a corrective right-shift to the input.

The same logic explains horizontal compression: $g(x) = f(2x)$ at $x = 1$ equals $f(2)$. The graph reaches $f$'s value-at-$2$ already at $x = 1$ — it's racing through $f$'s landscape twice as fast, which compresses the picture horizontally.

4. The general form $a\,f\!\bigl(b(x - h)\bigr) + k$

Putting all five moves into one equation:

$$ y = a \cdot f\!\bigl(b(x - h)\bigr) + k $$

Read it like this:

ParameterWhere it sitsWhat it does
$a$outside, multiplyingVertical stretch by $|a|$; reflect across $x$-axis if $a < 0$.
$k$outside, addingVertical shift by $k$ (up if positive).
$b$inside, multiplying $x$Horizontal scale by $1/|b|$ (compress if $|b| > 1$); reflect across $y$-axis if $b < 0$.
$h$inside, subtracted from $x$Horizontal shift by $h$ (right if positive).

The form deliberately writes the inside as $b(x - h)$, not $bx - h$. Why? Because $b(x - h)$ factors the horizontal operations cleanly into "scale by $b$, then shift by $h$." Written as $bx - bh$ the shift gets entangled with the scale and is much harder to read off. We'll see this distinction bite in the next section.

Reading practice

$y = -3\bigl(2(x + 1)\bigr)^2 - 4$ has $a = -3$, $b = 2$, $h = -1$, $k = -4$. So starting from $y = x^2$: horizontal compression by $2$, shift left $1$, vertical stretch by $3$ with a flip, shift down $4$.

5. Order matters

Function composition is non-commutative, and transformations are functions on functions, so order matters. The classic demonstration: starting from $y = x$, apply (i) vertical stretch by $2$ and (ii) vertical shift up by $3$, in both orders.

Two orderings, two answers

OrderStep 1Step 2Final equation$y$ at $x = 0$
Stretch, then shift $y = x \;\longrightarrow\; y = 2x$ $y = 2x \;\longrightarrow\; y = 2x + 3$ $y = 2x + 3$ $3$
Shift, then stretch $y = x \;\longrightarrow\; y = x + 3$ $y = x + 3 \;\longrightarrow\; y = 2(x + 3) = 2x + 6$ $y = 2x + 6$ $6$

The two graphs are not the same line. They have the same slope ($2$), but different intercepts ($3$ vs. $6$). When you stretch first, the later shift is "pure" — added on top. When you shift first, the stretch amplifies the shift along with everything else, doubling it.

Stretch, then shift — $y = 2x + 3$
(0, 3)
Shift, then stretch — $y = 2x + 6$
(0, 6)

The convention that prevents the trap

To get a well-defined answer, fix an order. The standard one, which exactly matches the general form $a\,f(b(x - h)) + k$, is:

  1. Horizontal operations first (inside the function): horizontal scale by $b$, then horizontal shift by $h$.
  2. Vertical operations second (outside the function): vertical scale by $a$, then vertical shift by $k$.

Each "scale then shift" subgroup goes in that order — scale first — because the alternative ends up doubling the shift, as we just saw.

Factored vs. expanded inside

The expression $f(2x - 4)$ does not read directly as "stretch then shift right $4$." Factor first: $f\bigl(2(x - 2)\bigr)$. Now the shift is unambiguous — right by $2$, not $4$. Always factor the horizontal coefficient out before reading off $h$.

6. Playground: tune $a$, $b$, $h$, $k$

The parent is $f(x) = x^2$, drawn dashed. The transformed graph is $y = a\bigl(b(x - h)\bigr)^2 + k$. Slide the four parameters and watch them act independently. Use this to build intuition for what each letter does — separately and together.

y = 1.0·(1.0·(x 0.0))² + 0.0
vertex: (0.00, 0.00)
1.0
1.0
0.0
0.0
x y
Try it

Set $b = 2$ and watch the parabola get narrower, not wider — that's horizontal compression, the counter-intuitive direction. Then push $b$ between $0$ and $1$ to see horizontal stretching. Flip $a$ to negative and the parabola opens downward; flip $b$ negative and the parabola is reflected across the $y$-axis (visible only when $h \neq 0$, since $x^2$ is already symmetric).

7. Tracking a single point

Sometimes you don't want a whole graph, just one point. If $(x_0, y_0)$ lies on $y = f(x)$, where does it move to under $y = a\,f(b(x - h)) + k$? Apply the four operations in the same order the formula does:

  • $y$-coordinate: outside operations act directly. $y_0 \to a\,y_0 + k$.
  • $x$-coordinate: inside operations act inversely. $x_0 \to x_0/b + h$.

So the point $(x_0, y_0)$ on $f$ becomes $\bigl(x_0/b + h,\;a\,y_0 + k\bigr)$ on the transformed graph. Try it: the vertex $(0, 0)$ of $y = x^2$ under the transformation $y = -2(x - 1)^2 + 4$ (where $a = -2$, $b = 1$, $h = 1$, $k = 4$) goes to $(0/1 + 1,\;-2 \cdot 0 + 4) = (1, 4)$. That matches what you'd get by spotting it as "vertex form $y = a(x - h)^2 + k$ has vertex $(h, k)$."

8. Common pitfalls

Wrong shift direction

$f(x - 2)$ shifts right by $2$, not left. $f(x + 2)$ shifts left by $2$, not right. This is the single biggest source of wrong answers in this topic. The mnemonic: ask "what $x$ do I need to feed in to get the same output as before?" For $f(x + 2)$, the answer is $x$ that's $2$ smaller — i.e. the graph slid left.

Wrong scale direction

$f(2x)$ compresses horizontally (not stretches). Intuition: "$x$ has been replaced by $2x$, so $f$ runs through its values twice as fast." The shorter horizontal travel is compression.

Confusing $-f(x)$ with $f(-x)$

$-f(x)$ reflects across the $x$-axis (negates outputs). $f(-x)$ reflects across the $y$-axis (negates inputs). They are different transformations and the only time they look identical is when $f$ is symmetric, which is exactly the case where the distinction stops mattering.

Forgetting to factor the inside

$f(2x - 4)$ is not "stretch then shift right $4$." Factor: $f\!\bigl(2(x - 2)\bigr)$. The shift is right $2$, not $4$. Always factor the coefficient of $x$ out of the inside before reading off the horizontal shift.

Even/odd symmetry breaks under shifts

If $f$ is even (or odd), $f(x) + k$ with $k \neq 0$ is generally neither. Shifts move the axis of symmetry; reflections and stretches preserve it. If a problem asserts the transformed function is odd, look at which transformations are in play.

9. Worked examples

Each example tests a different piece of the recipe. Try each before opening the solution; the goal is to see whether your reasoning matches the canonical reading.

Example 1 · Identify the transformations in $y = -2(x - 1)^2 + 3$

Parent. $f(x) = x^2$.

Match to general form. $y = a\,f(b(x - h)) + k$ with $a = -2$, $b = 1$, $h = 1$, $k = 3$.

Read off.

  1. Horizontal shift right $1$ (from $x - 1$).
  2. Vertical stretch by $2$ (from $|a| = 2$).
  3. Reflection across the $x$-axis (from $a < 0$).
  4. Vertical shift up $3$ (from $+ 3$).

Resulting shape. Downward parabola with vertex $(1, 3)$.

Example 2 · Order matters · $f\bigl(2(x - 1)\bigr)$ vs. $f(2x - 1)$

Take $f(x) = x^2$. The two expressions look similar — but they describe different graphs.

$f\bigl(2(x - 1)\bigr) = \bigl(2(x - 1)\bigr)^2$. Horizontal compression by $2$ (vertex stays at the post-shift location), then shift right $1$. Vertex of the transformed graph: $(1, 0)$.

$f(2x - 1) = (2x - 1)^2$. Factor first: $2x - 1 = 2\bigl(x - \tfrac{1}{2}\bigr)$. So this is compression by $2$ followed by shift right $\tfrac{1}{2}$. Vertex: $\bigl(\tfrac{1}{2}, 0\bigr)$.

Moral. The same coefficient $2$ produces a different shift because we haven't factored it out. Always factor the horizontal inside before reading the shift.

Example 3 · Build from description · $\sqrt{x}$ reflected over the $y$-axis, then shifted up $2$

Step 1. Reflect $\sqrt{x}$ across the $y$-axis. That's $f(-x) = \sqrt{-x}$. Domain flips to $x \le 0$.

Step 2. Shift up $2$. That's adding $2$ outside: $y = \sqrt{-x} + 2$.

Sanity check. At $x = 0$: $y = 2$. At $x = -1$: $y = 3$. At $x = -4$: $y = 4$. Curve rises to the left, exactly the original $\sqrt{x}$ mirrored.

Example 4 · Sinusoid · identify all four parameters of $y = 2\sin\!\bigl(3(x - \pi/6)\bigr) + 1$

Match against $y = a\sin\!\bigl(b(x - h)\bigr) + k$: $a = 2$, $b = 3$, $h = \pi/6$, $k = 1$.

  • Amplitude $|a| = 2$.
  • Period $= \dfrac{2\pi}{|b|} = \dfrac{2\pi}{3}$.
  • Phase shift: $\pi/6$ to the right.
  • Vertical midline: $y = 1$ (shifted up $1$).

You can now sketch the wave directly: it oscillates between $-1$ and $3$, with period $2\pi/3$, crossing the midline rising at $x = \pi/6$.

Example 5 · Point tracking · vertex of $y = x^2$ under $y = \tfrac{1}{2}(2x + 4)^2 - 5$

Factor the inside. $2x + 4 = 2(x + 2)$. So the transformation is $y = \tfrac{1}{2}\bigl(2(x + 2)\bigr)^2 - 5$, i.e. $a = \tfrac{1}{2}$, $b = 2$, $h = -2$, $k = -5$.

Apply the point-tracking formula. Vertex $(0, 0)$ on $f$ goes to

$$ \Bigl(\tfrac{0}{2} + (-2),\;\;\tfrac{1}{2}\cdot 0 + (-5)\Bigr) = (-2, -5). $$

Check. Plug $x = -2$ into the original expression: $\tfrac{1}{2}\bigl(2(-2) + 4\bigr)^2 - 5 = \tfrac{1}{2}\cdot 0 - 5 = -5$. ✓

Sources & further reading

The transformation rules above are standard precalculus material; what differs from source to source is how the order convention is presented and how much intuition you get for the "inside inverts" phenomenon. Each entry below has a slightly different strength.

Test your understanding

A quiz that builds from easy to hard. Pick an answer to get instant feedback and a worked explanation. Your progress is saved in this browser — come back anytime to continue.

Question 1 of 22
0 correct