Graph transformations
Change a function’s formula in a few standard ways and its graph moves in predictable ones. Everything fits in a single template, y = a f(b(x − h)) + k, where each letter does exactly one job.
The template
| Change | Effect on the graph |
|---|---|
| + k outside | Shift up by k (down if k is negative) |
| x − h inside | Shift right by h (left if h is negative) |
| a outside | Vertical stretch by |a|; reflect in the x-axis if a < 0 |
| b inside | Horizontal compression by |b|; reflect in the y-axis if b < 0 |
The rule of thumb: changes outside the function act on y and do what they look like. Changes inside act on x and do the opposite of what they look like, because they change the input before the function sees it.
Shifts (translations)
Adding k to the output lifts every point by k. Replacing x with x − h moves every point right by h. To see why the inside shift is “backwards”, notice that f(x − 2) takes at x = 2 the value f took at x = 0: the whole graph has moved 2 to the right.
Stretches and compressions
Multiplying the output by a stretches the graph vertically: every y-value is multiplied by a, and the x-intercepts stay put. Multiplying the input by b squeezes it horizontally by a factor of b: sin(2x) fits two waves where sin x fits one, and the y-intercept stays put. A factor between 0 and 1 does the opposite: y = ½ f(x) is flatter, f(x/2) is wider.
Reflections
A minus sign outside, −f(x), reflects the graph in the x-axis: every y changes sign. A minus sign inside, f(−x), reflects it in the y-axis. Even functions such as x² and cos x are unchanged by f(−x); odd functions such as x³ and sin x give the same result for both reflections.
Combining them: the order matters
For y = a f(b(x − h)) + k, apply the transformations to the parent in this order: horizontal compression and reflection (b), horizontal shift (h), vertical stretch and reflection (a), then vertical shift (k).
Example: y = −2(x + 1)² + 3 starts from x², shifts left 1, stretches vertically by 2 and flips (−2), then shifts up 3. The vertex goes (0, 0) → (−1, 0) → (−1, 0) → (−1, 3), and the parabola opens downward.
The horizontal shift must be read after factoring b out. y = f(2x − 6) is f(2(x − 3)), a shift of 3, not 6.
Practice
A new problem every time. Answer in any form you like: fractions, decimals, √ and π all work, and equivalent equations count as right.
Start with y = x³. Move it 5 right and 3 up. Write the new equation.
Show the answer
Answer: y = (x − 5)³ + 3
- Moving right by 5 replaces x with x − 5. The sign is the opposite of the direction.
- Moving up by 3 adds 3 outside the function.
- So y = (x − 5)³ + 3.
Frequently asked questions
What does f(x − h) do to a graph?
What is the difference between f(2x) and 2f(x)?
How do I reflect a graph in the x-axis?
In what order should I apply transformations?
Keep going
Every figure on this page opens in ihateDesmos, where you can drag sliders and watch the graph respond.