Transformations of Graphs

Learning goals

  • Separate outside moves on the output from inside moves that run backward on the input
  • Apply the master formula to send (u,v)(u, v) to its image
  • Factor the inside first, so f(2x−3)f(2x - 3) shifts by 32\tfrac{3}{2}
  • Show that two moves need not commute
  • Read symmetry as a transformation that changes nothing

Two places a number can act

Start with one concrete case. Suppose (2,5)(2, 5) lies on the graph of y=f(x)y = f(x), and you are told y=f(x−3)+1y = f(x - 3) + 1. The old input 22 reappears when the inside equals it, so solve x−3=2x - 3 = 2 to get the new input x=5x = 5. The old height 55 becomes 5+1=65 + 1 = 6 once the outside adds to it. So this rule sends the point to (5,6)(5, 6): the −3-3 changed which input you asked about, and the +1+1 changed only the height once you already had an answer. That is the whole lesson in miniature, one number acting on the question you ask ff, another acting on the answer it gives back.

Write a general transformed rule in the shape you will unpack for the rest of the lesson:

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

There are exactly two places a number can sit, and they behave completely differently.

The numbers aa and kk act on the output, the value ff has already produced. You take the answer f(⋅)f(\cdot), multiply it by aa, then add kk. These are the moves that behave the way you expect: multiply the height, then raise it. Call this the outside, the part applied after ff.

The numbers bb and hh act on the input, the number handed to ff before ff does anything. The rule first forms x−hx - h, then multiplies by bb, and only then feeds the result to ff. These are the moves that make the graph go the opposite way from what the symbols seem to say. Call this the inside, the part applied before ff.

Each side applies one step to a number: on the inside you change xx before handing it to ff, and on the outside you change the number ff hands back. Writing f(g(x))f(g(x)) for “do gg, then do ff” is the same substitution you practiced in Function Notation, so here we only ever say “apply this, then ff, then that,” one step at a time. The whole lesson is learning to read those two sides correctly.

Why the inside runs backward

Start with the inside, because it is where the confusion lives. Take a pure horizontal shift, g(x)=f(x−h)g(x) = f(x - h), and ask not what the formula looks like but where the points actually go.

An inside map moves the graph opposite to its sign#

Let g(x)=f(x−h)g(x) = f(x - h). A point (x,y)(x, y) lies on the graph of gg exactly when y=g(x)=f(x−h)y = g(x) = f(x - h), and that says precisely that the point (x−h,y)(x - h, y) lies on the graph of ff. Read that correspondence starting from ff. Take a point sitting at horizontal position uu on the graph of ff, namely (u,f(u))(u, f(u)). It shows up on the graph of gg at the input xx where the inside equals uu, that is where x−h=ux - h = u, so x=u+hx = u + h. Its height f(u)f(u) is unchanged. Every point therefore moves from position uu to position u+hu + h, a slide to the right by hh when h>0h > 0, even though the formula shows a minus sign.

The same reading handles a pure scaling, g(x)=f(bx)g(x) = f(bx) with b>0b > 0. Here (x,y)(x, y) is on gg exactly when y=f(bx)y = f(bx), which says (bx,y)(bx, y) is on ff. A point at position uu on ff reappears on gg where bx=ubx = u, that is at x=ubx = \dfrac{u}{b}, again at the same height. So the horizontal position of every point is divided by bb, which pulls points toward the vertical axis when b>1b > 1 and pushes them away when 0<b<10 < b < 1.

Because this is the move most often read backward, fix the vocabulary now and keep it fixed. The inside factor bb divides every input. When b>1b > 1 that pulls the graph toward the vertical axis, and we call it a horizontal compression by bb. When 0<b<10 < b < 1 the inputs grow instead and the graph is stretched away from the vertical axis. Throughout this lesson the number named in a compression is always the input multiplier bb, never its reciprocal. So “a horizontal compression by bb” always means “the inputs are divided by bb.”

Here is the one idea that explains the whole inside, and it is worth saying out loud. An outside map is applied to the answer ff already gave, so it does exactly what it says: multiply the answer, add to the answer. An inside map is applied to the question, the number you are about to hand ff. So to find where a point lands you must ask which xx makes the inside equal the old input, and answering that means solving for xx. The solving is what turns “subtract hh” into “move right by hh” and “multiply by bb” into “divide by bb.”

Horizontal shift: y = f(x) moved right 3 to y = f(x - 3)The arch y = f(x), dashed, peaking at input 2, and its copy y = f(x - 3), solid, peaking at input 5, three units to the right, at the same height.xy25right 3(2, f(2))(5, f(2))y = f(x)y = f(x - 3)
The dashed arch is y = f(x); the solid arch is y = f(x - 3). Reading from f to its shifted copy, the peak that sat at input 2 reappears at input 5, because the inside x - 3 equals 2 exactly when x = 5. Every point moves right by 3, even though the formula shows a minus sign.

The master formula

Both sides fold into a single statement about where a point goes. It is the tool the rest of the lesson uses, so derive it once and keep it.

Where every point of the graph lands#

Fix the general rule y=a f(b(x−h))+ky = a\,f\big(b(x - h)\big) + k with b≠0b \ne 0, and take any point (u,v)(u, v) on the graph of ff, so v=f(u)v = f(u). We find the point (x,y)(x, y) it becomes on the new graph.

The new rule reproduces the height v=f(u)v = f(u) when the number handed to ff equals uu, that is when b(x−h)=ub(x - h) = u. This is an equation in xx, and solving it means dividing by bb and then adding hh:

b(x−h)=u ⇒ x−h=ub ⇒ x=ub+h.b(x - h) = u \ \Rightarrow\ x - h = \frac{u}{b} \ \Rightarrow\ x = \frac{u}{b} + h.

At that input the output is a f(u)+k=av+ka\,f(u) + k = a v + k, read straight off the outside. So the point (u,v)(u, v) on the graph of ff lands at

(u,v) ⟼ (ub+h,  av+k).(u, v) \ \longmapsto\ \left(\frac{u}{b} + h,\ \, a v + k\right).

Every rule from the earlier course is one line of this formula. Setting a=b=1a = b = 1 and h=0h = 0 gives (u, v+k)(u,\, v + k), a vertical shift by kk. Setting a=b=1a = b = 1 and k=0k = 0 gives (u+h, v)(u + h,\, v), a horizontal shift right by hh. Setting b=1b = 1, h=0h = 0, k=0k = 0 gives (u, av)(u,\, a v), a vertical scaling by aa, which also reflects across the xx-axis when a<0a < 0. Setting a=1a = 1, h=0h = 0, k=0k = 0 gives (ub, v)\left(\tfrac{u}{b},\, v\right), which divides every input position by bb (a horizontal compression when b>1b > 1) and reflects across the yy-axis when b<0b < 0. The one formula carries all of them, and the two halves never mix. The input data uu is touched only by bb and hh, and the output data vv only by aa and kk.

That separation reaches the domain and range too, the data Relations and Functions insisted was part of a function. The inputs uu of ff become ub+h\tfrac{u}{b} + h, so the domain is divided by bb and shifted by hh. The outputs vv become av+ka v + k, so the range is scaled by aa and shifted by kk. In general the transformed domain is the set of every value ub+h\tfrac{u}{b} + h for uu in the original domain, and the transformed range is the set of every value av+kav + k for vv in the original range, the same rule that moves every other point on the graph. When the domain or range is a plain interval, a negative aa reverses the order of the range’s endpoints, since it turns the larger output into the smaller one, and a negative bb does the same to the domain’s endpoints.

Worked example 1 Reading the master formula

The point (4,6)(4, 6) lies on the graph of ff. Where does it land on y=2f(x−3)+1y = 2f(x - 3) + 1, and on y=f(2x)y = f(2x)?

For y=2f(x−3)+1y = 2f(x - 3) + 1, match the shape a f(b(x−h))+ka\,f\big(b(x - h)\big) + k: here a=2a = 2, b=1b = 1, h=3h = 3, k=1k = 1. Apply the landing rule (ub+h, av+k)\left(\tfrac{u}{b} + h,\ a v + k\right) to (u,v)=(4,6)(u, v) = (4, 6):

(41+3,  2⋅6+1)=(7,13).\left(\frac{4}{1} + 3,\ \, 2\cdot 6 + 1\right) = (7, 13).

The input picked up the shift +3+3 and the height was doubled and then raised by 11.

For y=f(2x)y = f(2x), the outside is untouched (a=1a = 1, k=0k = 0) and the inside has b=2b = 2, h=0h = 0. The landing rule gives

(42+0,  6)=(2,6).\left(\frac{4}{2} + 0,\ \, 6\right) = (2, 6).

The height is unchanged and the input is halved, so the point slides in toward the vertical axis. Both results come from the same formula, just with different slots filled.

Worked example 2 Transforming a domain and a range

Suppose ff has domain 2≤x≤82 \le x \le 8 and range −1≤y≤5-1 \le y \le 5. Describe the domain and range of y=f(2x)y = f(2x) and of y=−3f(x)y = -3f(x).

For y=f(2x)y = f(2x), only the inside changes, with b=2b = 2. The domain is divided by b=2b = 2, so each endpoint is halved:

2≤x≤8 ⟶ 1≤x≤4.2 \le x \le 8 \ \longrightarrow\ 1 \le x \le 4.

The range is untouched, still −1≤y≤5-1 \le y \le 5, because nothing acted on the output.

For y=−3f(x)y = -3f(x), only the outside changes, with a=−3a = -3. The range is scaled by a=−3a = -3, and because aa is negative the endpoints swap order:

−3⋅(−1)=3,−3⋅5=−15,-3 \cdot (-1) = 3, \qquad -3 \cdot 5 = -15,

so the new range runs from the smaller value up, −15≤y≤3-15 \le y \le 3. The reflection is exactly what turned the top of the old range into the bottom of the new one. The domain stays 2≤x≤82 \le x \le 8, since the inside was left alone.

Check your understanding

Suppose ff has domain −2≤x≤6-2 \le x \le 6 and range 0≤y≤100 \le y \le 10. What is the domain of y=f(3x)−4y = f(3x) - 4?

Answer choices

A domain is easier to trust once you have watched one move. The graph below is y=ax−h+ky = a\sqrt{x - h} + k, and a square root is the useful case because its domain has a visible left end rather than running off both sides of the window. Drag hh upward and watch the start point: it travels right, against the minus sign inside, and the whole graph goes with it, so the domain becomes x≥hx \ge h and the readout confirms it. That is the same solve-the-inside reasoning as the worked examples above, now watched instead of computed.

Two states are worth reaching deliberately. Drag aa negative and watch the curve turn over to fall instead of rise, while its left end does not move at all: the left end stays put because aa acts outside and the domain is decided inside. Drag aa to zero and watch the graph flatten onto a horizontal line, and yet the readout still reports the domain restriction, because multiplying by zero cannot widen what the root will accept.

Move the start point of y=ax−h+ky = a\sqrt{x - h} + k

y = √x. Its start point sits at (0, 0), not shifted at all. From there it rises to the right, at the natural rate, flattening as it goes. It exists only for x of at least 0, because a square root needs the inside to be at least 0. A coordinate plane with the graph of √x drawn on it, with its start point marked. Use the controls below the figure to stretch it, or to shift it across or up and down. -2 2 4 6 8 10 -6 -4 -2 2 4 6
Stretch a Inside h Outside k

y = √x. Its start point sits at (0, 0), not shifted at all. From there it rises to the right, at the natural rate, flattening as it goes. It exists only for x of at least 0, because a square root needs the inside to be at least 0.

A square root graph on a coordinate plane. The inside shift moves both the start point and the left end of the domain, while the coefficient outside changes only how steeply the curve leaves that point and which way it goes.

Check your understanding

The point (6,2)(6, 2) lies on the graph of y=f(x)y = f(x). Where does it land on the graph of y=2f(x−1)+3y = 2f(x - 1) + 3?

Answer choices

Order matters, and the two sides disagree

The master formula hides a subtlety that causes more errors than any sign. When a side carries two operations, the order in which you apply them to the graph is not free.

On the outside, the graph order matches the arithmetic order. The rule y=af(x)+ky = a f(x) + k says compute f(x)f(x), then multiply by aa, then add kk. As graph moves that reads scale by aa first, then shift by kk, in that order, because the arithmetic is done in that order to every height.

On the inside, the graph order is the reverse of the arithmetic order, and the reason is the solving step. The rule y=f(b(x−h))y = f\big(b(x - h)\big) processes xx by first subtracting hh, then multiplying by bb, then handing the result to ff. But the master formula shows the point lands at ub+h\tfrac{u}{b} + h, which you build from uu by first dividing by bb (the horizontal scaling) and then adding hh (the shift right). Scaling comes first, shift second, the opposite of the arithmetic order. That reversal is forced: to solve b(x−h)=ub(x - h) = u for xx you undo the multiplication before you undo the subtraction, and undoing in reverse is what solving an equation always does.

This reversal is exactly why the inside must be factored into the form b(x−h)b(x - h) before you can read the shift. Skipping that step produces the single most common error in all of this material.

Worked example 3 The factoring trap: reading f(2x - 3)

The rule y=f(2x−3)y = f(2x - 3) is not ”f(2x)f(2x) shifted right 33.” To read it correctly, factor the inside so it matches the shape b(x−h)b(x - h):

2x−3=2(x−32).2x - 3 = 2\left(x - \tfrac{3}{2}\right).

Now the slots are visible: b=2b = 2 and h=32h = \tfrac{3}{2}. So the graph is a horizontal compression by 22 (the inputs are divided by 22) and a shift right by 32\tfrac{3}{2}, not by 33.

Check it against the master formula, which never needs the factoring. A point (u,v)(u, v) on ff lands where 2x−3=u2x - 3 = u, that is at

x=u+32=u2+32.x = \frac{u + 3}{2} = \frac{u}{2} + \frac{3}{2}.

The shift added to the scaled input is 32\tfrac{3}{2}, matching the factored reading. The tempting wrong answer, “shift right 33,” comes from reading the −3-3 before dividing out the 22, which reverses the required order of the two inside moves. The inside multiplier 22 has to be pulled out first.

Check your understanding

After its horizontal compression, by how much and which way does y=f(3x−12)y = f(3x - 12) shift the graph of y=f(x)y = f(x)?

Answer choices

When the order of two moves changes the result

The order rule has a sharp consequence: doing two moves in one order can give a genuinely different function from doing them in the other order.

Take a vertical stretch by 22 and a vertical shift up 33, and apply them to y=f(x)y = f(x) in each order. Stretch first, then shift, and you get 2f(x)2f(x) and then 2f(x)+32f(x) + 3. Shift first, then stretch, and you get f(x)+3f(x) + 3 and then 2(f(x)+3)=2f(x)+62\big(f(x) + 3\big) = 2f(x) + 6. These are not the same rule:

2f(x)+3 ≠ 2f(x)+6.2f(x) + 3 \ \ne\ 2f(x) + 6.

The gap is the extra 33 that the second stretch also multiplied. So “stretch then shift” and “shift then stretch” are two different transformations, and the graphs land in different places.

Order matters: 2f(x) + 3 versus 2(f(x) + 3)The parabola y = 2f(x) + 3, vertex at 0 comma 3, and y = 2(f(x) + 3) = 2f(x) + 6, vertex at 0 comma 6, the same curve shifted up 3, showing that stretch-then-shift differs from shift-then-stretch.xy36up 3y = 2f(x) + 3y = 2(f(x) + 3)
Both curves come from stretching y = x squared by 2 and shifting up 3, in opposite orders. Stretch then shift gives y = 2f(x) + 3 with vertex (0, 3); shift then stretch gives y = 2(f(x) + 3) = 2f(x) + 6 with vertex (0, 6). Same stretch, same shift, different order, and the graphs sit 3 apart.

Worked example 4 A reflection and a shift, in both orders

Reflection across the xx-axis (the outside factor a=−1a = -1) also refuses to commute with a shift. Track the point (2,3)(2, 3) on ff through both orders.

Reflect first, then shift up 55. Reflecting negates the height, (2,3)→(2,−3)(2, 3) \to (2, -3), then shifting adds 55:

(2,−3) ⟶ (2, −3+5)=(2,2).(2, -3) \ \longrightarrow\ (2,\, -3 + 5) = (2, 2).

As a rule this is y=−f(x)+5y = -f(x) + 5. Now shift up 55 first, then reflect. Shifting gives (2,3)→(2,8)(2, 3) \to (2, 8), then reflecting negates that height:

(2,8) ⟶ (2, −8).(2, 8) \ \longrightarrow\ (2,\, -8).

As a rule this is y=−(f(x)+5)=−f(x)−5y = -\big(f(x) + 5\big) = -f(x) - 5. The two landing points, (2,2)(2, 2) and (2,−8)(2, -8), are different, and the two rules, −f(x)+5-f(x) + 5 and −f(x)−5-f(x) - 5, are different. The reflection multiplies by −1-1 everything that is already there, so whether the +5+5 is present when you reflect changes the result. Order is part of the transformation, not a detail you can rearrange.

The same reversal happens when both moves act on the input instead of the output. Reflect ff across the yy-axis and then shift right 22, and you build f(−(x−2))=f(2−x)f\big(-(x - 2)\big) = f(2 - x): the shift is applied to the already-reflected rule, so it lands inside the negation. Shift first and reflect second, and the 22 never gets negated: you build f(−x−2)f(-x - 2) instead. Two input-side moves disagree about order exactly as two output-side moves do, and for the same reason, each new move is applied to whatever rule the previous move already produced.

Check your understanding

Reflecting ff across the yy-axis and shifting it right 22 are both applied to y=f(x)y = f(x). Which rule results from reflecting first and then shifting?

Answer choices

One graph, many transformations

It is tempting to believe the finished graph tells you which transformation produced it. It does not, and seeing why is one of the honest surprises of this lesson.

Take f(x)=x2f(x) = x^2 and compress it horizontally by 22:

f(2x)=(2x)2=4x2.f(2x) = (2x)^2 = 4x^2.

Now instead stretch the same ff vertically by 44:

4f(x)=4x2.4f(x) = 4x^2.

They are the same function, y=4x2y = 4x^2, reached by two different transformations. So you may truthfully say ”y=4x2y = 4x^2 is y=x2y = x^2 compressed horizontally by 22,” and equally truthfully say “it is y=x2y = x^2 stretched vertically by 44.” What you may not say is that the transformation is unique, or that the graph reveals which move was applied. Both descriptions are correct, and the graph cannot choose between them.

This is not special to x2x^2: for positive bb, every pure power function f(x)=xdf(x) = x^d satisfies f(bx)=(bx)d=bdxd=bdf(x)f(bx) = (bx)^d = b^d x^d = b^d f(x), so a horizontal compression by bb can always be redescribed as an outside scaling by bdb^d (for example, f(2x)=8f(x)f(2x) = 8f(x) when f(x)=x3f(x) = x^3). Pure power functions are one important family with this property, and adding a constant already breaks it. For f(x)=x2+1f(x) = x^2 + 1,

f(2x)=4x2+1,butc f(x)=c x2+cf(2x) = 4x^2 + 1, \qquad \text{but} \qquad c\,f(x) = c\,x^2 + c

can never equal 4x2+14x^2 + 1, since matching the x2x^2 term needs c=4c = 4 while matching the constant needs c=1c = 1. So here the horizontal compression f(2x)f(2x) is not any vertical stretch at all, and the two kinds of scaling are genuinely different operations. The figure shows this second case, where f(2x)f(2x) and 2f(x)2f(x) are plainly different curves.

Horizontal compression f(2x) versus vertical stretch 2f(x) for f(x) = x squared + 1The narrow parabola y = f(2x) = 4x squared + 1, vertex at 0 comma 1, and the wide parabola y = 2f(x) = 2x squared + 2, vertex at 0 comma 2, two different curves.xy12y = f(2x) = 4x² + 1y = 2f(x) = 2x² + 2
For f(x) = x squared + 1 the two kinds of scaling differ. The narrow curve is y = f(2x) = 4x squared + 1, a horizontal compression, with vertex (0, 1). The wide curve is y = 2f(x) = 2x squared + 2, a vertical stretch, with vertex (0, 2). They are different graphs, and 4x squared + 1 is not any vertical stretch of f, so the coincidence seen for x squared has vanished.

Worked example 5 Same graph, two honest descriptions

Show that y=9x2y = 9x^2 can be obtained from y=x2y = x^2 as either a horizontal compression or a vertical stretch, and give the exact number for each.

As a horizontal compression, replace xx by bxbx and ask which positive bb gives 9x29x^2 (a compression factor is always named positive; a negative bb would add a reflection that this particular graph does not show):

f(bx)=(bx)2=b2x2=9x2 ⇒ b2=9 ⇒ b=3,f(bx) = (bx)^2 = b^2 x^2 = 9x^2 \ \Rightarrow\ b^2 = 9 \ \Rightarrow\ b = 3,

a horizontal compression by b=3b = 3, since the inputs are divided by 33. As a vertical stretch, multiply the output by aa:

a f(x)=a x2=9x2 ⇒ a=9,a\,f(x) = a\,x^2 = 9x^2 \ \Rightarrow\ a = 9,

a stretch to 99 times the height. Both produce the identical graph y=9x2y = 9x^2, so the correct statement is that the transformation is not unique. That transformation can be described as a horizontal compression by 33 or as a vertical stretch by 99. The graph itself does not record which one you had in mind. Try the same on g(x)=x2+1g(x) = x^2 + 1 and the vertical route fails, since g(3x)=9x2+1g(3x) = 9x^2 + 1 is not a(x2+1)a(x^2 + 1) for any aa.

Symmetry is a transformation that does nothing

The chapter’s earlier lesson defined a function as even when f(−x)=f(x)f(-x) = f(x) and odd when f(−x)=−f(x)f(-x) = -f(x), both requiring a domain symmetric about 00 so that −x-x is available whenever xx is. Read through the lens of this lesson, those definitions are statements about a single inside transformation, reflecting the input, written y=f(−x)y = f(-x).

An even function is one that reflecting the input leaves completely unchanged: f(−x)=f(x)f(-x) = f(x) says the reflected graph y=f(−x)y = f(-x) is the very same graph as y=f(x)y = f(x). So evenness is precisely invariance of the graph under reflection across the yy-axis. An odd function is one where reflecting the input has the same effect as reflecting the output: f(−x)=−f(x)f(-x) = -f(x) says the inside reflection y=f(−x)y = f(-x) equals the outside reflection y=−f(x)y = -f(x). Doing both at once, reflecting input and output together, is a 180∘180^\circ rotation about the origin, and it returns the original graph, since −f(−x)=f(x)-f(-x) = f(x). So oddness is invariance of the graph under that rotation.

Both statements need the symmetric domain to even be asked, exactly as the earlier lesson proved, and neither says more than it should. In particular an odd function need not pass through the origin: it does when 00 is in its domain, because then f(0)=−f(0)f(0) = -f(0) forces f(0)=0f(0) = 0. But f(x)=1xf(x) = \tfrac{1}{x} is odd with 00 absent from its domain, and it never meets the origin. Symmetry, in this chapter’s language, is just the special case where a particular transformation fixes the graph.

Check your understanding

A function ff is odd, with a domain symmetric about 00. Which single transformation is guaranteed to leave its graph unchanged?

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

A bit of history (optional)

By the middle of the nineteenth century geometry had come apart into rival versions, school geometry, projective geometry, and others, each with its own theorems and no shared account of what made them all geometry. Felix Klein answered the question in 1872, newly a professor at Erlangen. His answer moved the subject off the figures and onto the motions: choose a set of transformations that can be undone and combined, and a geometry is the study of whatever that set leaves unchanged. Change the set and you change the subject.

The Erlangen Program, as it came to be called, is this lesson raised one level: a transformation is a map applied before ff or after it, and two of them combine by doing one and then the other. You have already met the smallest case of Klein’s question. An even function is a graph left unchanged by reflecting the input; an odd function is a graph left unchanged by a half turn about the origin. Symmetry, in Klein’s language, is the case where a transformation changes nothing.