This site is a work in progress. New lessons are added regularly. Contact us

Transformations of Graphs

Learning goals

  • Separate outside moves on the output from inside moves on the input
  • Explain why the inside runs backward, by solving for xx
  • Apply the master formula to send (u,v)(u, v) to its image
  • Factor the inside first, so f(2x3)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

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

y=af(b(xh))+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 xhx - 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 is a small chain of maps: on the inside you apply one map to xx and then hand the result to ff. On the outside you hand ff‘s answer to another map. Writing f(g(x))f(g(x)) for “do gg, then do ff” is just the substitution you already practiced in Function Notation. Combining functions this way is the subject of the next lesson. So here we only ever say “apply this, then ff, then that,” and never lean on any special algebra of that combining. 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(xh)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(xh)g(x) = f(x - h). A point (x,y)(x, y) lies on the graph of gg exactly when y=g(x)=f(xh)y = g(x) = f(x - h), and that says precisely that the point (xh,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 xh=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.” (That step, solving the inside for xx, is the seed of the inverse function you will meet two lessons from now.)

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=af(b(xh))+ky = a\,f\big(b(x - h)\big) + k with b0b \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(xh)=ub(x - h) = u. This is an equation in xx, and solving it means dividing by bb and then adding hh:

b(xh)=u  xh=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 af(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. A negative aa or bb flips the corresponding interval end for end. The domain and range transform right along with the picture, because they are the picture.

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(x3)+1y = 2f(x - 3) + 1, and on y=f(2x)y = f(2x)?

For y=2f(x3)+1y = 2f(x - 3) + 1, match the shape af(b(xh))+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, 26+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 2x82 \le x \le 8 and range 1y5-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:

2x8  1x4.2 \le x \le 8 \ \longrightarrow\ 1 \le x \le 4.

The range is untouched, still 1y5-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,35=15,-3 \cdot (-1) = 3, \qquad -3 \cdot 5 = -15,

so the new range runs from the smaller value up, 15y3-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 2x82 \le x \le 8, since the inside was left alone.

A domain is easier to trust once you have watched one move. The graph below is y=axh+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. Step hh upward: the start point travels right, against the minus sign inside, and the whole graph goes with it, so the domain becomes xhx \ge h and the readout says so. That is the same halving-and-shifting arithmetic as the worked example above, done by hand.

Two states are worth reaching deliberately. Take aa negative and the curve turns 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. Take aa to zero and the graph flattens onto a horizontal line, and yet the readout still reports the domain restriction. Multiplying by zero cannot widen what the root will accept.

Move the start point of y=axh+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(x1)+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(xh))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(xh)=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(xh)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(2x3)y = f(2x - 3) is notf(2x)f(2x) shifted right 33.” To read it correctly, factor the inside so it matches the shape b(xh)b(x - h):

2x3=2(x32).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 2x3=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(3x12)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. This is your first real meeting with the fact that composing maps does not commute, which is the headline of the next lesson.

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.

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 coincidence is special to homogeneous power functions, not to x2x^2 in particular, and it is not the typical case. It happens because a power pulls the factor straight through: for f(x)=xdf(x) = x^d, 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 is the same as a vertical stretch by bdb^d. The cube behaves the same way, with f(2x)=8f(x)f(2x) = 8f(x) for f(x)=x3f(x) = x^3. What kills the coincidence is breaking the homogeneity by adding a constant. For f(x)=x2+1f(x) = x^2 + 1,

f(2x)=4x2+1,butcf(x)=cx2+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 bb gives 9x29x^2:

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:

af(x)=ax2=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 180180^\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.

Free Response Questions (FRQ)

Longer questions in parts, to be worked out on paper. Progressive hints, the answer on its own so you can check yourself and try again, then the full worked solution, plus a rubric to mark your own work against.

Free response Work it out on paper 5 questions 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. School geometry sat beside projective geometry, and beside geometries where parallel lines behave quite differently. Each had its own words and its own theorems. Nobody could say what made them all geometry.

Felix Klein answered that in 1872. He had just been made a professor at Erlangen, a university town in southern Germany. His answer moved the subject off the figures and onto the motions. Choose some set of transformations that can be undone and combined. A geometry, said Klein, is the study of whatever that set leaves unchanged. Change the set and you change the subject. Each rival geometry is one choice among many.

The Erlangen Programme, as it came to be called, is now the standard account of how the branches of geometry fit together. It is also this lesson raised one level. Here a transformation is a map applied before ff or after it. Two of them combine by doing one and then the other. Klein asks which features of a figure survive all of them at once.

You have already met the smallest case of his 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 changed nothing.