AP Precalculus · Topic 1.12 · Reading guide, about 5 min

Shifting, stretching and reflecting graphs

How a, b, h and k in g(x) = a f(b(x - h)) + k move, stretch and flip a graph, and what happens to domain and range.

In one minute

You do not have to learn a new graph for every new formula. Most functions you meet are a familiar parent function that has been slid, stretched or flipped. If you know how each change to the formula changes the picture, you can sketch the new graph from the old one in seconds.

The general pattern is g(x)=a f(b(x−h))+kg(x)=a\,f(b(x-h))+k. Each of the four letters does one job. This topic teaches those jobs, how to track a single point through all of them, and how the domain and range change.

Key terms

Transformation
A change to a function's formula that moves, stretches or flips its graph while keeping its overall shape recognizable.
Vertical translation
Adding a constant outside the function, f(x)+kf(x)+k, which slides the graph up if k>0k>0 and down if k<0k<0.
Horizontal translation
Subtracting a constant inside, f(x−h)f(x-h), which slides the graph right if h>0h>0 and left if h<0h<0.
Vertical dilation
Multiplying the output by ∣a∣|a|: the graph stretches away from the x-axis if ∣a∣>1|a|>1 and compresses toward it if 0<∣a∣<10<|a|<1.
Horizontal dilation
Multiplying the input by bb inside: distances from the y-axis are multiplied by 1∣b∣\dfrac{1}{|b|}, so a large ∣b∣|b| squeezes the graph.
Reflection
A flip of the graph. Using −f(x)-f(x) flips it over the x-axis, and f(−x)f(-x) flips it over the y-axis.
Parent function
The simplest member of a family, such as x2x^2, x\sqrt{x} or 1x\dfrac{1}{x}, which transformations are applied to.
Domain and range
The set of allowed inputs and the set of resulting outputs. Transformations can shift, scale or flip these sets.

Additive changes: translations

Adding a number to the output moves every point straight up or down. The graph of f(x)+3f(x)+3 is the graph of ff lifted 3 units. This one behaves the way you expect.

Subtracting a number from the input moves the graph sideways, and the direction surprises many students. In f(x−2)f(x-2), the output that used to happen at x=0x=0 now happens at x=2x=2, so the graph slides 2 units to the right. The input has to be larger by 2 to get the same output. In f(x+2)f(x+2) the graph slides left.

A translation never changes the shape. The domain shifts by hh and the range shifts by kk, so if ff has range y≥0y\ge 0 then f(x)+kf(x)+k has range y≥ky\ge k.

Multiplicative changes: dilations and reflections

Multiplying the output by aa scales every height. For a=3a=3, each point's y-coordinate triples, so the graph stretches vertically. For a=12a=\dfrac{1}{2} it flattens to half height. A negative aa also flips the graph over the x-axis, so a=−2a=-2 stretches by 2 and flips.

Multiplying the input by bb works the opposite way from what the symbol suggests. In f(2x)f(2x), only half as much xx is needed to reach the same output, so the graph is squeezed toward the y-axis to half its width. In f(13x)f(\tfrac{1}{3}x) the graph stretches out to three times its width. A negative bb flips the graph over the y-axis.

Zeros show the horizontal effect clearly. If ff has a zero at x=6x=6, then f(2x)f(2x) has a zero where 2x=62x=6, that is at x=3x=3. Solve the inside for the old input to find the new position.

The effects on domain and range follow the same rules. A vertical dilation by ∣a∣|a| scales the range, and a horizontal dilation by bb scales the domain by 1∣b∣\dfrac{1}{|b|}. A reflection over the x-axis flips the range, and a reflection over the y-axis flips the domain.

What each parameter does to g(x)=a f(b(x−h))+kg(x)=a\,f(b(x-h))+k
ParameterEffect on the graphEffect on a point (x, y) of f
aaVertical stretch or compression by ∣a∣|a|; flip over x-axis if a<0a<0y becomes aya y
bbHorizontal change by factor 1/∣b∣1/|b|; flip over y-axis if b<0b<0x becomes x/bx/b
hhSlide right by hh (left if h<0h<0)x increases by hh
kkSlide up by kk (down if k<0k<0)y increases by kk

Putting it together: tracking a point

When several changes are combined, move a point through them in two parts. For the x-coordinate, divide by bb and then add hh. For the y-coordinate, multiply by aa and then add kk. The rule for a point (x,y)(x,y) on ff is that it lands at (xb+h, ay+k)\left(\dfrac{x}{b}+h,\ a y+k\right) on gg.

Worked example. Let f(x)=xf(x)=\sqrt{x}, with domain x≥0x\ge 0, range y≥0y\ge 0, and the point (4,2)(4,2). Let g(x)=−3 f(2(x−4))+5g(x)=-3\,f(2(x-4))+5, so a=−3a=-3, b=2b=2, h=4h=4, k=5k=5. The point (4,2)(4,2) moves to x=42+4=6x=\dfrac{4}{2}+4=6 and y=(−3)(2)+5=−1y=(-3)(2)+5=-1. So (6,−1)(6,-1) is on gg. Check directly: g(6)=−32(6−4)+5=−34+5=−6+5=−1g(6)=-3\sqrt{2(6-4)}+5=-3\sqrt{4}+5=-6+5=-1. It matches.

Now the domain: the square root needs 2(x−4)≥02(x-4)\ge 0, so x≥4x\ge 4. The starting corner (0,0)(0,0) of ff goes to (02+4, −3⋅0+5)=(4,5)\left(\dfrac{0}{2}+4,\ -3\cdot 0+5\right)=(4,5), which is the new endpoint. Since aa is negative the graph goes down from there, so the range is y≤5y\le 5.

Reading a graph in reverse works too. If you see a square-root shape that starts at (4,5)(4,5), heads right, and falls, you can identify h=4h=4, k=5k=5, and a negative aa.

How it connects

  • Back to 1.5: zeros of a transformed function come from solving the inside expression for the original zeros.
  • Back to 1.6 and 1.7: a reflection or vertical stretch can change end behavior and asymptote values, since a horizontal asymptote y=cy=c moves to y=ac+ky=ac+k.
  • Forward to 2.3: transformations let you sketch exponential graphs such as 3⋅2x−1+43\cdot 2^{x-1}+4 from 2x2^x.
  • Forward to 2.11: logarithm graphs are shifted and flipped using exactly these rules.

Common mistakes

  • Shifting the wrong way horizontally. f(x−3)f(x-3) moves right 3, not left. Ask which input now produces the old output.
  • **Applying bb to the wrong side.** f(2x)f(2x) makes the graph narrower, not wider. Multiply the original x-coordinates by 12\dfrac{1}{2}.
  • **Mixing −f(x)-f(x) with f(−x)f(-x).** The first flips over the x-axis, the second over the y-axis. On a graph with symmetry about the y-axis, f(−x)f(-x) looks unchanged.
  • **Forgetting the order for (x−h)(x-h) inside bb.** In f(b(x−h))f(b(x-h)) the shift is hh itself. In f(bx−c)f(bx-c) the shift is cb\dfrac{c}{b}, so factor out bb first.

How it shows up on the exam

  • A graph of ff is shown with a few labeled points, and you identify the graph or table of a transformed function or find where a given point lands.
  • A formula like g(x)=a f(b(x−h))+kg(x)=a\,f(b(x-h))+k is given with specific numbers, and you state the new domain, range, zeros or asymptotes.
  • Given the graphs of both ff and gg, you write the transformation in words or find the parameter values.

Check yourself

  1. If ff has a zero at x=5x=5, where are the zeros of f(x−2)f(x-2) and of f(3x)f(3x)?
  2. What is the difference between the graphs of −f(x)-f(x) and f(−x)f(-x) for f(x)=xf(x)=\sqrt{x}?
  3. If the range of ff is [1,6][1,6], what is the range of 2f(x)−32f(x)-3?
  4. How would you find the new position of a point (x,y)(x,y) under g(x)=a f(b(x−h))+kg(x)=a\,f(b(x-h))+k?

Practice this topic. AP Practice questions on exactly what this lesson covers, with an explanation for every answer.