Functions

Function Transformations: Shifts, Stretches and Reflections

Every function transformation fits one template, y=a f(b(x−h))+ky=a\,f(b(x-h))+k. The values hh and kk slide the graph, while aa and bb stretch, compress or flip it. Changes outside ff act on yy and do what they look like. Changes inside act on xx and do the opposite.

y=a f(b(x−h))+ky = a\,f\big(b(x-h)\big) + k

Once you can read that template, any transformed graph of a function becomes a short list of instructions applied to a shape you already know. This page covers where the backwards behavior comes from, the factoring trap that costs the most points, three full examples, and the cases where the rules need care. Comfort with function notation will help.

What is the master formula for function transformations?

Start with a parent graph, such as the line, parabola, square root or absolute value from the family of parent functions. Every transformed graph is that parent with four adjustments, one per letter in y=a f(b(x−h))+ky=a\,f(b(x-h))+k.

Piece Effect on the graph
+k+k outside Up kk units (down if k<0k<0)
x−hx-h inside Right hh units (left if h<0h<0)
aa outside Vertical scale by ∣a∣\lvert a\rvert, flip over the xx-axis if a<0a<0
bb inside Horizontal scale by 1∣b∣\tfrac{1}{\lvert b\rvert}, flip over the yy-axis if b<0b<0

The letters split into two independent teams. The pair bb and hh only touches xx-coordinates, and the pair aa and kk only touches yy-coordinates. That separation is the reason transformations are manageable: you can handle the horizontal story and the vertical story one at a time.

Why do horizontal changes work backwards?

Take g(x)=f(x−3)g(x)=f(x-3). The function gg gives, at each xx, whatever ff gave three units earlier. To see the value f(0)f(0), gg needs x−3=0x-3=0, so x=3x=3. The feature that sat at x=0x=0 now sits at x=3x=3, which is a move to the right even though a minus sign appears.

The general idea is one sentence: a point lands where the inside equals its old input. Take a point (p,q)(p,q) on ff. On g(x)=a f(b(x−h))+kg(x)=a\,f(b(x-h))+k, the inside b(x−h)b(x-h) must equal pp, so x=pb+hx=\frac{p}{b}+h. The yy-value is just aq+kaq+k. That gives the full rule for moving any point:

(p,q) ⟼ (pb+h, aq+k)(p,q)\ \longmapsto\ \left(\frac{p}{b}+h,\ aq+k\right)

This is also why the topic connects to composition of functions. A transformation is ff composed with a simple function on the inside (which edits xx before ff sees it) and another on the outside (which edits the result). Inside edits must be undone to find where a point goes, and that undoing is the “backwards” effect.

Quick check

The point (4,5)(4,5) lies on y=f(x)y=f(x). What point lies on g(x)=f(x+2)g(x)=f(x+2)?

How do stretches, compressions and reflections work?

A vertical change multiplies every yy-coordinate by aa. If ∣a∣>1|a|>1 the graph is stretched away from the xx-axis, and if 0<∣a∣<10<|a|<1 it is compressed toward it. A horizontal change divides every xx-coordinate by bb, so ∣b∣>1|b|>1 squeezes the graph toward the yy-axis and 0<∣b∣<10<|b|<1 spreads it out.

A fast mental check: vertical scaling leaves the xx-intercepts exactly where they were, and horizontal scaling leaves the yy-intercept exactly where it was. If an intercept you expected to stay put has moved, a factor has gone to the wrong side of the function.

The horizontal factor is a reciprocal

In f(x/4)f(x/4), write x4\tfrac{x}{4} as 14x\tfrac14x, so b=14b=\tfrac14 and the graph is stretched by a factor of 1b=4\tfrac{1}{b}=4, not compressed.

Reflections are the special case of a negative multiplier. The expression −f(x)-f(x) flips the graph over the xx-axis, and f(−x)f(-x) flips it over the yy-axis. If ff is even, f(−x)=f(x)f(-x)=f(x) and the second flip changes nothing. For polynomials, a negative aa also reverses the end behavior, which is a quick way to confirm the sign of your leading coefficient.

In what order do you apply combined transformations?

Number line showing f(2x−6) moves a feature from x=0 to x=3, not 6
Factoring 2x − 6 as 2(x − 3) shows the shift is 3 units right, so a feature at x = 0 lands at x = 3.

First rewrite the inside so it reads b(x−h)b(x-h). This is the trap that costs the most points. In f(2x−6)f(2x-6) the shift is not 6. Factoring gives 2x−6=2(x−3)2x-6=2(x-3), so b=2b=2 and h=3h=3. The graph is compressed by 12\tfrac12 and shifted right 3. Likewise, f(3−x)=f(−(x−3))f(3-x)=f(-(x-3)) is a reflection over the yy-axis followed by a shift of 3 to the right.

Then apply the steps in the order the arithmetic runs:

  1. Scale xx-coordinates by 1b\tfrac{1}{b} (flip over the yy-axis if b<0b<0).
  2. Shift xx-coordinates by hh.
  3. Scale yy-coordinates by aa (flip over the xx-axis if a<0a<0).
  4. Shift yy-coordinates by kk.

Scaling comes before shifting inside each group because a shift done first would get scaled too. Compare 2(x2+3)=2x2+62(x^2+3)=2x^2+6 with 2x2+32x^2+3: the first lifts the parabola by 6 and the second by 3. The two groups, though, never affect each other, so steps 1 and 2 can swap places with steps 3 and 4.

Worked example 1. Describe g(x)=−3f(2x−8)+5g(x)=-3f(2x-8)+5 and find where the point (6,2)(6,2) on ff goes.

Factor the inside: 2x−8=2(x−4)2x-8=2(x-4), so a=−3a=-3, b=2b=2, h=4h=4, k=5k=5. The transformations are: compress horizontally by 12\tfrac12, shift right 4, stretch vertically by 3 and flip over the xx-axis, shift up 5. For the point:

x=62+4=7,y=−3(2)+5=−1x=\frac{6}{2}+4=7,\qquad y=-3(2)+5=-1

The point is (7,−1)(7,-1). Check by direct substitution: g(7)=−3f(14−8)+5=−3f(6)+5=−3(2)+5=−1g(7)=-3f(14-8)+5=-3f(6)+5=-3(2)+5=-1. ✓

How do you transform a graph using key points?

Sketching a whole curve is slow and error-prone. Instead, pick three to five key points on the parent (endpoints, intercepts, the vertex), push each through (p,q)↦(pb+h, aq+k)(p,q)\mapsto\left(\tfrac{p}{b}+h,\ aq+k\right), plot them and connect them in the same pattern as the original. This works for any ff, even one given only as a graph.

Worked example 2. The graph of ff passes through (0,0)(0,0), (2,4)(2,4) and (4,0)(4,0). Find the matching points on g(x)=2f ⁣(x2+1)−3g(x)=2f\!\left(\tfrac{x}{2}+1\right)-3.

Factor the inside: x2+1=12(x+2)\tfrac{x}{2}+1=\tfrac12(x+2), so a=2a=2, b=12b=\tfrac12, h=−2h=-2, k=−3k=-3. The mapping becomes x=p1/2−2=2p−2x=\tfrac{p}{1/2}-2=2p-2 and y=2q−3y=2q-3.

(0,0)→(−2,−3),(2,4)→(2,5),(4,0)→(6,−3)(0,0)\to(-2,-3),\qquad (2,4)\to(2,5),\qquad (4,0)\to(6,-3)

Check one: g(2)=2f(1+1)−3=2(4)−3=5g(2)=2f(1+1)-3=2(4)-3=5. ✓ The shape is the original arch, now twice as wide and twice as tall, with its peak at (2,5)(2,5).

How do you write the equation for a described transformation?

Work from the parent outward, and edit the current formula at each step. Every horizontal move replaces xx with a new expression everywhere it appears, and every vertical move edits the whole output. The common error is performing a shift on the original instead of on the already-modified formula.

Worked example 3. Start with y=xy=\sqrt{x}. Reflect it over the yy-axis, shift it left 2, then stretch it vertically by 3. Write the equation.

Reflect: replace xx with −x-x to get −x\sqrt{-x}. Shift left 2: replace xx with x+2x+2 in that formula, which gives −(x+2)=−x−2\sqrt{-(x+2)}=\sqrt{-x-2}. Writing −x+2\sqrt{-x+2} is the mistake, because it would move the graph right. Stretch: multiply the output by 3.

y=3−x−2y=3\sqrt{-x-2}

Check with the point mapping. The start point (0,0)(0,0) goes to x=0−1−2=−2x=\tfrac{0}{-1}-2=-2, which matches −x−2=0-x-2=0 at x=−2x=-2. The point (1,1)(1,1) goes to x=−1−2=−3x=-1-2=-3 and y=3y=3, and indeed 33−2=33\sqrt{3-2}=3. ✓

Quick check

Start with y=∣x∣y=|x|. Reflect it over the xx-axis, then shift it up 2. Write the equation.

How do transformations change domain and range?

Run the endpoints of the domain through the xx-rule and the endpoints of the range through the yy-rule. Horizontal changes alter the domain, vertical changes alter the range, and the two never cross over.

For example, let ff have domain [−1,5][-1,5] and range [0,4][0,4], and let g(x)=−2f(x−1)+3g(x)=-2f(x-1)+3. The domain endpoints move right 1, giving [0,6][0,6]. For the range, −2(0)+3=3-2(0)+3=3 and −2(4)+3=−5-2(4)+3=-5, so the range is [−5,3][-5,3]. The negative aa swapped the order of the endpoints, so the old maximum became the new minimum.

Compute both ends, then sort

With a negative aa or bb, the endpoints trade places. Find both transformed values first, then write the smaller one on the left of the interval.

In Example 3, the domain of y=xy=\sqrt{x} is [0,∞)[0,\infty). The mapping sends 00 to −2-2 and the reflection turns the ray around, so the new domain is (−∞,−2](-\infty,-2] and the range is [0,∞)[0,\infty).

When do two different transformations give the same graph?

Some functions have a hidden equivalence. For f(x)=xnf(x)=x^n, we get f(bx)=bnf(x)f(bx)=b^nf(x), so a horizontal compression is the same as a vertical stretch. The graph of y=9x2y=9x^2 is x2x^2 compressed horizontally by 13\tfrac13 and also stretched vertically by 9. The absolute value function has the same property, since ∣bx∣=∣b∣ ∣x∣|bx|=|b|\,|x|. For exponentials, 2x+3=8⋅2x2^{x+3}=8\cdot 2^x, so a horizontal shift equals a vertical stretch.

The method needs care when a function has more than one formula. For a piecewise function, apply the transformation to every piece and to every interval boundary. If f(x)=xf(x)=x for x<0x<0 and f(x)=x2f(x)=x^2 for x≥0x\ge 0, then f(x−2)f(x-2) is x−2x-2 for x<2x<2 and (x−2)2(x-2)^2 for x≥2x\ge 2. The breakpoint moves too.

Try this: Write y=9x2y=9x^2 as a transformation of y=x2y=x^2 in two ways, once with only a vertical change and once with only a horizontal change. Then check that the point (1,9)(1,9) lands on both.

How is a transformation different from an inverse function?

Both involve reflections, so they are easy to confuse. The expression −f(x)-f(x) reflects over the xx-axis and f(−x)f(-x) reflects over the yy-axis. The inverse f−1f^{-1} reflects over the line y=xy=x, which swaps every pair (p,q)(p,q) into (q,p)(q,p). For f(x)=2x+1f(x)=2x+1 these are three different functions:

−f(x)=−2x−1,f(−x)=−2x+1,f−1(x)=x−12-f(x)=-2x-1,\qquad f(-x)=-2x+1,\qquad f^{-1}(x)=\frac{x-1}{2}

The inverse also carries a condition: it exists as a function only when ff is one-to-one. Transformations have no such requirement.

The two ideas meet in a useful way. If g(x)=a f(x)+kg(x)=a\,f(x)+k, then g−1(x)=f−1 ⁣(x−ka)g^{-1}(x)=f^{-1}\!\left(\frac{x-k}{a}\right), so a vertical move of ff becomes a horizontal move of its inverse. Take g(x)=(x−3)2+1g(x)=(x-3)^2+1 for x≥3x\ge 3. Solving gives x=3+y−1x=3+\sqrt{y-1}, so g−1(x)=x−1+3g^{-1}(x)=\sqrt{x-1}+3. The shift right 3 became a shift up 3, and the shift up 1 became a shift right 1. More on this pattern appears in the inverse of a quadratic function.

Quick check

The point (2,5)(2,5) lies on y=f(x)y=f(x). Give a point on y=f−1(x)y=f^{-1}(x) and a point on y=−f(x)y=-f(x).

Where are function transformations used in real life?

The same four parameters show up wherever a base shape is reused at a different size or position.

  • Temperature conversion, F=1.8C+32F=1.8C+32, is the line F=CF=C stretched vertically by 1.8 and lifted 32 units, which is slope-intercept form read as a transformation.
  • Sound and tides follow y=Asin⁡(B(t−h))+Dy=A\sin(B(t-h))+D: AA sets the amplitude, DD sets the midline, hh sets the timing, and the period is 2πB\tfrac{2\pi}{B}, which is the same reciprocal rule as 1b\tfrac{1}{b}.
  • Vertex form y=a(x−h)2+ky=a(x-h)^2+k puts the vertex of a parabola at (h,k)(h,k), so projectile and bridge-arch models can be read straight from the equation.

Graphics software does the same thing to pixels. Mirroring an image is f(−x)f(-x), resizing is a scale factor, and moving a layer is a shift, usually applied in the order scale, then translate, exactly as in the order given above.

Practice problems

0 of 5 solved

  1. The graph of f(x)=x2f(x)=x^2 is shifted 4 units left and 3 units down. Write the new equation.

  2. The point (3,−2)(3,-2) lies on y=f(x)y=f(x). Find the matching point on g(x)=−4f(x)+5g(x)=-4f(x)+5.

  3. The point (9,6)(9,6) lies on y=f(x)y=f(x). Find the matching point on g(x)=f(3x−12)g(x)=f(3x-12).

  4. Find the domain and range of g(x)=−2x+5+1g(x)=-2\sqrt{x+5}+1.

  5. Start with y=∣x∣y=|x|. Compress it horizontally by a factor of 12\tfrac12, shift it right 3, reflect it over the xx-axis, then shift it up 4. Write the equation.

Common questions

What are the main types of function transformations?

There are three families: translations (shifts), reflections (flips), and dilations (stretches and compressions). Together they give six basic moves, since shifts, stretches and reflections each act vertically or horizontally. All of them fit the template y=a f(b(x−h))+ky=a\,f(b(x-h))+k.

Why does f(x + 3) move the graph left instead of right?

The function g(x)=f(x+3)g(x)=f(x+3) reaches the value f(0)f(0) when x+3=0x+3=0, which is at x=−3x=-3. Every feature of the graph shows up 3 units earlier on the xx-axis, so the graph moves left.

Does the order of transformations matter?

Yes, but only within the horizontal group and within the vertical group. Scale first, then shift. A horizontal change and a vertical change never interfere, so you can do either group first.

What is the difference between f(2x) and 2f(x)?

f(2x)f(2x) multiplies the input, so every xx-coordinate is divided by 2 and the graph is compressed horizontally. 2f(x)2f(x) multiplies the output, so every yy-coordinate doubles and the graph is stretched vertically. For some functions, such as x2x^2 and ∣x∣|x|, the two graphs happen to be a different vertical stretch of each other.

How do I tell a horizontal stretch from a compression?

Look at bb in f(bx)f(bx). If ∣b∣>1|b|>1 the graph is compressed by a factor of 1∣b∣\tfrac{1}{|b|}, and if 0<∣b∣<10<|b|<1 it is stretched by that same factor. The number behaves as a reciprocal.

Do transformations change the domain and range?

They can. Horizontal changes move or scale the domain, and vertical changes move or scale the range. Apply the same rule to the endpoints, and swap them if you multiply by a negative number.

Up next