AP subjects/AP Precalculus/Function Transformations Visualizer
CED 1.12AP Precalculus

Function Transformations Visualizer

Use this free function transformations visualizer to see exactly how the constants in g(x)=a f(b(x−h))+kg(x) = a\,f(b(x-h)) + k stretch, reflect and slide a parent graph. Pick a parent function, drag four sliders, and compare the transformed curve with the original on the same grid.

Controls
parentabhk

How to use the simulator

The parent f(x)f(x) is drawn as a dashed teal curve and g(x)g(x) as a solid coral curve, on a grid from −10 to 10 on both axes.
  • Parent f(x) menu: choose x2x^2, ∣x∣|x|, x\sqrt{x}, x3x^3, sin⁡(x)\sin(x) or 1/x1/x. The default is x2x^2.
  • vertical stretch a: from −3 to 3 in steps of 0.1 (default 1). A negative value reflects the graph over the x-axis.
  • horizontal stretch b: from −3 to 3 in steps of 0.1 (default 1). A negative value reflects the graph over the y-axis.
  • horizontal shift h and vertical shift k: each from −6 to 6 in steps of 0.5 (default 0).
  • Reset to parent: puts a and b back to 1 and h and k back to 0. It keeps the parent you picked.
The panel above the sliders writes the current equation in terms of f, for example g(x) = −2·f(x − 3) + 1, and lists each transformation as a tag, such as "reflect over x-axis" or "shift right 3". For the horizontal factor, the tag reports 1/∣b∣1/|b|, the actual factor by which horizontal distances change, so b = 2 is labeled a compression by 0.5.
Move one slider at a time first, then combine them and predict where a key point, such as the vertex of x2x^2, will land before you let go. Avoid b = 0: the slider allows it, but then g is constant and the graph collapses to a horizontal line.

The formula

Every transformation in AP Precalculus Topic 1.12 is a piece of g(x)=a f(b(x−h))+k.g(x) = a\,f\big(b(x-h)\big) + k. Constants outside f act on outputs (vertical changes). Constants inside f act on inputs (horizontal changes), and they act in the opposite way to what the symbol suggests.
  • k: vertical translation. g(x)=f(x)+kg(x) = f(x) + k moves every point up k units (down if k < 0).
  • h: horizontal translation. g(x)=f(x−h)g(x) = f(x-h) moves every point right h units. So f(x+4)f(x+4) has h=−4h = -4 and moves left 4.
  • a: vertical dilation by a factor of ∣a∣|a|; if a<0a < 0, also a reflection over the x-axis.
  • b: horizontal dilation by a factor of 1/∣b∣1/|b|; if b<0b < 0, also a reflection over the y-axis.
A clean way to track all four at once is the point mapping (x, y) ⟼ (xb+h,  ay+k).(x,\ y) \ \longmapsto\ \left(\frac{x}{b} + h,\ \ a y + k\right). Apply it to two or three easy points on the parent graph and you have the transformed graph.

Worked example

Describe and sketch g(x)=−2x−3+1g(x) = -2\sqrt{x-3} + 1.
Step 1: match the template. With f(x)=xf(x) = \sqrt{x}: a=−2a = -2, b=1b = 1, h=3h = 3, k=1k = 1.
Step 2: name the transformations. Reflect over the x-axis, stretch vertically by a factor of 2, shift right 3, shift up 1.
Step 3: map key points. Using (x,y)↦(x+3, −2y+1)(x, y) \mapsto (x + 3,\ -2y + 1): (0,0)→(3,1)(0, 0) \to (3, 1), (1,1)→(4,−1)(1, 1) \to (4, -1), (4,2)→(7,−3)(4, 2) \to (7, -3).
Step 4: domain and range. The parent has domain x≥0x \ge 0 and range y≥0y \ge 0. After the shift right the domain is x≥3x \ge 3; after the reflection, stretch and shift up the range is y≤1y \le 1.
Check it in the simulator: choose √x, set a = −2, h = 3 and k = 1. The equation reads g(x) = −2·f(x − 3) + 1, and the tags read reflect over x-axis, vertical stretch ×2, shift right 3, shift up 1. The coral curve should begin at (3, 1) and pass through (4, −1) and (7, −3).
Follow-up with b. Write g(x)=(2x−2)2g(x) = (2x - 2)^2 in the template. Factor the inside first: 2x−2=2(x−1)2x - 2 = 2(x - 1), so b=2b = 2 and h=1h = 1, not 2. Choose x², set b = 2 and h = 1: the label reads g(x) = f(2(x − 1)), the tags say horizontal compression ×0.5 and shift right 1, and the vertex sits at (1, 0).

Common mistakes on the AP exam

  • Shifting the wrong way. f(x−3)f(x - 3) moves right, f(x+3)f(x + 3) moves left. Use the slider: positive h always moves the coral graph right.
  • Not factoring out b. In f(2x+6)f(2x + 6) the shift is −3-3, because 2x+6=2(x+3)2x + 6 = 2(x + 3). Reading it as a shift of 6 is the most common horizontal error.
  • Inverting the horizontal factor the wrong way. f(3x)f(3x) compresses horizontally by a factor of 13\tfrac13; it does not stretch by 3.
  • Mixing up the reflections. A negative a flips over the x-axis; a negative b flips over the y-axis. For an even function like x2x^2, a negative b makes no visible difference.
  • Forgetting the domain. Shifting x\sqrt{x} or 1/x1/x moves the endpoint or the asymptotes too. For 1/(x−2)+31/(x-2) + 3 the asymptotes are x=2x = 2 and y=3y = 3.

When the AP exam uses this

Transformations recur throughout the course: Unit 3 sinusoids build amplitude, period, phase shift and midline from these four constants, and exponential and logarithmic models in Unit 2 are often written as transformations of bxb^x or log⁡bx\log_b x. Questions may give a table of values for f and ask for values of g, or show two graphs and ask which transformation links them.
Embed this simulator on your class page

Free for classroom use. Paste this into your site, LMS page or blog; keep the credit link under it.