# How does one explain that transformations 'inside' a function operate in the opposite direction than intuition suggests?

Consider a real function $f(x)$ and imagine its graph in the plane. Then the graph of $f(x+2)$ is simply the graph of $f$ shifted to the left 2 units while the graph of $f(x-2)$ is that of $f$ shifted to the right 2 units. Also, the graph of $f(2x)$ is the graph of $f$ shrunk towards the $y$-axis by a factor of $1/2$ and the graph of $f(\frac{1}{2}x)$ is that of $f$ stretched outwards from the $y$-axis by a factor of $2$.

These transformations operate in the opposite way than one would initially think insomuchas that the transformations that operate on the whole function (such as $f(x)+2$, $2f(x)$, and $\frac{1}{2}f(x)$) act exactly as one would expect.

Only after unraveling through the definition of evaluation and comparing points, do we see that transformations applied to the inside of a function operate in this way.

Presenting graph transformations has been a hurdle for me in teaching algebra, but it's limited to this one point. And the only way I've come up with teaching it is giving a 'opposite-than-you-would-think' rule to keep in mind, but I want something better to tell my students.

I know it's because transformations on the inside are going to require you to perform the inverse operation to get the same point that $f$ was considering, but putting that thought process in words that my student's can understand and grok has been a challenge.

How can I explain these transformations better?

• On the occasions when your students have understood it, how did they explain it back to you so that you knew they understood it? – JPBurke Oct 22 '14 at 8:30
• I think a common way to explain it to engineering students is that $f(t-2)$ is the signal $f(t)$ delayed by two units. – Dag Oskar Madsen Oct 22 '14 at 10:46
• This is a philosophical question. If we understood "up" to be plus and "left" to the plus, then there would be no confusion, yes? – Jared Oct 23 '14 at 8:22
• @Jared if "left" was plus, then putting in f(x+2) would move the graph to the right (toward x=-2)! – Chris Cunningham Oct 24 '14 at 14:18

The way I help students understand this is to flip the idea on its head and say to them that replacing either variable with something always does the opposite to the graph, whether you replace the x or the y. The full story goes something like this:

The first thing it is worth pointing out to the students is that when you graph a function, there are in fact two variables involved. You aren't graphing $f(x)$, you are in fact graphing $y=f(x)$. This equation is a rule for telling whether a point is part of the graph or not: you sub the coordinates $(x,y)$ of the point into the equation and if it's true then the point is on the graph and if it's not true then it's not on the graph.

Pictorially you can imagine forming the graph by choosing a large number of random points, testing to see if they're on the graph or not, and colouring them in black if they are and white if they're not. This is not the normal way of making graphs, but it does help to point out the usefulness of the equation for telling if a point is on the graph, and it will make the shifting/stretching make more sense too. (Note it also helps to picture the meaning of equations that aren't functions like $x^2+y^2=1$, and later to get the idea of general sets which are defined by equations, like subspaces.)

Once this idea has been introduced, you can describe what happens to graphs when you replace $x$ by $x-2$. If you have a point $(a,b)$ and you sub it into the new equation $y=f(x-2)$ and it works, then the point $(a,b)$ is on the new graph. But of course, this is the same as subbing the point $(a-2,b)$ into the old equation $y=f(x)$. So a point is on the new graph when the point two steps back is on the old graph. That is, the old graph is -2 steps from the new graph, which means of course that the new graph is +2 steps from the old graph. That's a key place to point out the backwardsness: the -2 tells you where the old graph is relative to the new graph, not the other way around, which is why it seems backwards.

(You already mentioned this idea "unraveling through the definition of evaluation and comparing points", but I find it works best in the 2D coordinate algebra rather than the 1D of just the x's.)

The key point I like to make with students is that this process works just as well if you replace the $y$ with something. So if you replace the $y$ with $y-2$ then a point $(a,b)$ will be on the new graph of $y-2 = f(x)$ when the point $(a,b-2)$ is on the old graph of $y=f(x)$. So a point is on the new graph when the point two steps down is on the old graph. This means that the new graph is two steps up from the old graph.

So replacing the $x$ or the $y$ tells you where the old graph is relative to the new graph, which means you do the opposite to move the old to the new. There is no difference at all except for which axis. The reason it looks like there's a different rule for inside/oustide is because the numbers are in the wrong place! The graph with equation $y = f(x)+2$ is actually the graph with equation $y - 2 = f(x)$, which has had $y$ replaced with $y-2$ and so the old graph is two steps down. But of course shifting the 2 to the other side makes it a +.

This particular description helps quite a few of my students, because they can combine it all into one rule rather than two separate rules.

If you had only a couple of minutes to say something pithy they could hold onto, I'd suggest something like: "The numbers next to the $x$ (or $y$) tell you where the old graph is relative to the new one. So it seems backwards when you have the old and you're finding the new. This works just as well with $x$ or the $y$ only on the other axis. Numbers on the outside of the function can be moved to be next to the $y$ and then they work the same way as numbers inside the function."

• I like your method and have considered using it myself. However, the method I outlined in my answer has worked well so far and is closer to the explanation in the textbook. Still, +1 to you now and I still may do it your way in the future--I'm still thinking about it. – Rory Daulton Oct 22 '14 at 13:02
• Nice -- then you can also do "replacing x with -x flips the graph horizontally; similarly replacing y with -y flips the graph vertically." – Chris Cunningham Oct 24 '14 at 14:17
• Exactly @ChrisCunningham. Do you think I should edit my answer to include other transformations than just shifts? – DavidButlerUofA Oct 24 '14 at 16:17
• Since this has been bumped I should note that I have adopted this answer in all my algebra classes and it makes the whole unit with all the transformations much less painful for students. It helps if your algebra class also covers circles and hyperbolas, because then $(x - 3)^2 + (y - 5)^2 = 9$ is not a "new thing," it is just more of the same. To be clear I skip the pithy summary at the end because it defeats all the progress made by the rest of the approach. So.. thank you! – Chris Cunningham Apr 1 '19 at 16:28

In my opinion, there are three main reasons that students are ill equipped to handle function transformations:

1. They think about transformations as operations on expressions: "If I add $1$ to the $x$ in this expression, then the graph will shift this way". In fact function transformation is about the relationship between two functions.

2. Relatedly, although two different functions are involved in a transformation, usually only one is named. For example, in your question above, you talk about $y=f(x)$ and $y=f(2x)$. There is no explicit mention of the function $g(x)=f(2x)$. The function they are trying to graph is never explicitly written as a function of $x$, which is a big problem, since before transformations, this is all they have seen.

3. I think the quantifiers are all mixed up in students heads. When we write "the graph of $y=f(x)$" we mean "All the points $(x,y)$ which satisfy $y=f(x)$", but to the student the "$y$" in $y=x^2$ and the "$y$" in $y=(x+3)^2$ look like "the same $y$".

When I teach, I usually do so through structured sequences of exercises, with discussion between to cement the "moral of the story" which we are supposed to be learning from the exercises. So here is my sequence of questions, which I believe avoids these three pitfalls. I would make sure students do more than one question of each type before moving on. We discuss each one, and make sure we can verbalize everything. Also note that I will only discuss horizontal shift type questions below, but at each stage I would be using each type of transformation, not just horizontal shifts.

Question 1: If $f$ and $g$ are functions, and we know that $(4,5)$ is on the graph of $f$, and we know $f(x) = g(x+2)$ for every $x$, what point can we determine is on the graph of $g$? (Note that the universal quantification of the equation is made explicit!)

Solution 1: Since $f(x)=g(x+2)$ for every $x$, it is in particular true for $x=4$. So $f(4)=g(4+2)$. $(4,5)$ was on the graph of $f$, so $f(4)=5$. Thus $5=g(6)$. So $(6,5)$ is on the graph of $g$. Note that this does exhibit the "expected" behavior

Moral 1: Did you notice that the point on $g$ had the same ordinate as the point on $f$, but its abscissa was $2$ greater than the point of $f$ is was related to? Think about why. Will this relationship always be true? Try to verbalize that. "For each point on the graph of $f$, there is another point on the graph of $g$ with the same ordinate, but whose abscissa is two greater". Get good at moving from the symbolic expression to the verbal expression.

Question 2: If this is the graph of $f$ (GRAPH), and we know $f(x)=g(x+2)$, what does the graph of $g$ look like?

Solution 2: Apply insight from first question to determine that "For each point on the graph of $f$, there is another point on the graph of $g$ with the same ordinate, but whose abscissa is two greater". Use this realization on several points. Determine that, graphically, each point on $f$ is related to a point on $g$ which is "two units to the right". Draw the graph of $g$. Get good at thinking through this sort of relationship quickly.

Question 3: If $f$ and $g$ are functions, and we know that $(4,5)$ is on the graph of $f$, and we know $f(x+2) = g(x)$ for every $x$, what point can we determine is on the graph of $g$?

Solution 3: We only know that $f(4)=5$. So to use the equation relating $f$ and $g$, we will need to choose an $x$ which results in $f$ receiving the input $4$. So we need $x+2=4$, or $x=2$. Putting this into the equation, we have $f(2+2)=g(2)$, so $g(2)=5$.

Moral 3: This problem was harder because we had to think carefully about what value $x$ needed to be so that we were applying $f$ to something we know. Compare this problem to the last kind of problem. They are basically the same: we have a relationship between two functions, and a point on one, and we need to find the point on the other. In this case "For every point on $g$ there is a corresponding point on $f$ whose ordinate is the same, but whose abscissa is $2$ less", or equivalently "For every point on $f$ there is a corresponding point on $g$ whose ordinate is the same, but whose abscissa is $2$ more". Either verbalization is cool. In any case, we have a point on $f$, and so the corresponding point on $g$ must have abscissa $2$ less.

Question 4: If we know $f(x+2) = g(x)$, and this is the graph of $f$, what is the graph of $g$?

Solution 4: By the verbal description of the relationship, we see that the graph of $g$ is the graph of $f$ shifted $2$ units to the left.

Question 5: If $f(x)=x^2$, and $g(x) = f(x+3)$, what is a formula for $g(x)$?

Question 6: If $f(x)=x^3$ and $g(x) = (x-2)^3$, can you write an equation expressing the relationship between $f$ and $g$?

Solution 6: At this point, the student can write either $g(x)=f(x-2)$ or $g(x+2)=f(x)$, although the first form is more common. If both forms come up, talk about why they are both valid, and both express the same idea.

Question 7: You know the graph of $f(x) = x^3$. Now graph $g(x)=(x-2)^3$ by first finding an equation expressing the relationship between $f$ and $g$, and then using that relationship to relate points on $f$ to points on $g$.

For completeness, here is what I would expect as a solution to the

Question "Graph $f(x) = (x-3)^2+4$ by finding a sequence of related functions".

Ideal student response

Plan of attack: I know the graph of $g_0(x) = x^2$. I will relate $g_0$ to $g_1(x) = (x-3)^2$, and then relate $g_1$ to $f$.

The relationship between $g_0$ and $g_1$ is $g_1(x) = g_0(x-3)$. This says that for each point on the graph of $g_1$ there is another point on the graph of $g_0$ whose ordinate is the same, but whose abscissa is $3$ less. So the graph of $g_1$ is the graph of $g_0$ shifted $3$ units to the right.

[Illustration with graph of $g_0$ and $g_1$, with a few key points and their relationship shown. A generic "$x$" and "$x-3$" are marked to show that $g_1(x) = g_0(x-3)$]

We also know $f(x) = g_1(x)+1$. So to each point on $g_1$ there is a point of $f$ with the same abscissa, but with ordinate one greater. So the graph of $f$ is the graph of $g_1$ shifted up by one.

[Illustration with graph of $g_1$ and $f$, with a generic "$x$" marked to show $f(x)=g_1(x)+1$].

I will note that I have only tried this approach as a tutor, not as a teacher. I have probably tutored $20$ students this way, and everyone has become a master of function graphing. Over time, much of this scaffolding can drop away, and the student can start graphing "on sight", but this is appropriate post rigorous thinking, not mere procedural memorization. This is also the most powerful way I know to instill students with the knowledge that "Functions are gadgets which take inputs and return outputs, they are not just expressions". Internalizing this seems to be essential to this approach, which is an added "side benefit" (or the main point depending on your perspective).

I have almost always paired these lessons with completing the square. Having first learned transformations, now graphing any quadratic of the form $f(x) = a(x-h)^2+k$ is easy. Completing the square allows us to put quadratics in that form, so we can graph arbitrary quadratics without resorting to plotting points! This is powerful, and I think appreciated by students. Coincidentally it also makes solving quadratic equations much easier...

• To obtain the $x$ used in $g(x)$, you need to subtract $2$ from the argument to $f(x+2)$.
• To obtain the $x$ used in $g(x)$, you need to multiply the argument to $f(2x)$ by $\frac{1}{2}$.

(Credit to Steven Gubkin for the main idea.)

• Thanks. This is a very nice "TLDR" for my post. +1. – Steven Gubkin Oct 23 '14 at 12:25

I think a key tool here is tables of values.

My approach has always been to give students functions like $$f(x)=x^2$$ and $$g(x)=f(x-1)$$ and ask them to fill out tables of values for some range of $$x$$, say $$x$$ from -4 to 4 in steps of 1. When you step back and look at the two tables, the abstraction starts to lift.

Next present students with a graph something like the one below. Say it is the graph of $$y=f(x)$$, and ask them to make tables of values for $$y=f(x)$$ and $$y=f(x-1)$$ using the coordinates of the corners. Now they have to figure out the implied domain for $$y=f(x-1)$$. Finally have students graph $$y=f(x-1)$$ using their table of value. When they get this done, the abstraction and mystery of the horizontal shifting should go away. Of course it will come back later, but that's another battle.

I handle this by giving the form as $$y-d=f(x-c)$$ or, if expansion/contraction is included, $$y-d=a \cdot f[b(x-c)]$$

Then it is more clear that a positive $d$ (which is right next to the $y$) means a movement in the positive $y$ direction and a positive $c$ (which is right next to the $x$) gives movement in the positive $x$ direction.

I changed to this form recently, but so far this has helped. Putting the complications in the equation form does seem to work better than putting the complications in the interpretation of the form. I do explain to the class why my base equation form is more complicated than the one they see in the textbook, and so far that has been accepted.

• If expansion/contraction is concerned, I would recommend $a(y-d) = f[ b(x-c) ]$ because then it works the same for $x$ and $y$. – DavidButlerUofA Oct 22 '14 at 10:59
• @DavidButlerUofA: You are right that your form is more consistent than mine. However, that seems to me to be a step too far, and my students have already seen and understood the $a$ next to the $f()$. The translations were confusing the students, not the expansions/contractions. I'll switch to your technique if future students are confused differently. – Rory Daulton Oct 22 '14 at 12:58
• That's reasonable. – DavidButlerUofA Oct 22 '14 at 17:34

[Disclaimer: not field tested nor backed up by research.]

How about teaching the students that any transformations inside the function is changing the domain?

Imagine $\mathbb{R}$ being an infinitely long rubber band.

• The difference between $f(x)$ and $f(x-2)$ is that we hold the graph of the function fixed while we slide the $x$ axis as a whole two units to the left.
• The difference between $f(x)$ and $f(2x)$ is that we hold the graph of the function fixed while we stretch the $x$ axis by a factor of 2.

The picture in mind can be

2. Change the axis by translating or stretching.
3. Put graph back down over the axis.
4. Let go of the axis, now with a "boing" it bounces back to its original place carrying the graph with it.

If you are good with computer animations this can be pretty easily illustrated. If not you can try to actually get a translucent sheet of rubber and some student to help you hold it down.

If you do it this way, be sure to emphasize the semantic difference between $2f(x)$ and $f(2x)$. In the first case the 2 is acting on the function. In the second case the 2 is acting on the domain. It will help if you introduce a third situation for the graph as $\{ y = f(x)\}$ versus $\{2y = f(x)\}$. In this case you have that the 2 acting on the codomain and so you stretch the $y$-axis (in exactly the same way as the changes to the $x$ axis). Whereas when the 2 acts on the function you change the function value, not the axis.

(All these are somewhat similar to, but also different from, the distinction between active and passive transformations. )

• I like this physical model. The "boing" really helped me! – Steven Gubkin Oct 24 '14 at 15:12

How about starting with a number line?
$$X=0$$ is just the point $$0$$.

$$(X-2)=0$$ solves to $$X=2$$, i.e. the point $$2$$ on the line.

so

$$X-A$$ is a positive shift of $$A$$ units on the line.

As a mathematician I do not explicitly learn these by heart. Rather, I use a simple function (say, a linear one) and test how it behaves under the transformation. Repeating this often enough leads to memorisation.

I suggest teaching the students how to test if their guess or intuition is correct. It is a powerful tool in cases where the student roughly remembers what should happen - the function should be shifted to left or right, say - but is not quite clear on the details.

• A linear function may be misleading because a vertical shift looks very much the same as a horizontal one. – Rodrigo A. Pérez Oct 23 '14 at 2:53

This is a complicated question. It's complicated because we do not define our axes very well, yet we assume the following: $+x$ goes to the right and $+y$ goes up, therefore $-x$ goes to the left and $-y$ goes down. There is absolutely no rational for this other than convention (and then you can argue about how people think--although I might argue that left-handed people are wired to think "to the left" is "positive").

If you want to talk about directions in a graph, then you better define your axes very well (and no teacher that I've ever met ever does--mainly because it will likely confuse students--but a good teacher should confuse their students, i.e. make them think).

With that in mind, we can come up with two different scenarios where $f(x+\Delta x)$ shifts either to the right or to the left! Likewise we can come up with axes which show that $f(x) + \Delta f$ shifts either up or down!

1 Assume "to the right" is positive

Then how do we shift $f(x + \Delta x)$? We initially get the graph $f(x)$, what value of $x$ gives $x + \Delta x = 0$ (the original $f(x)$)? We can solve: $x + \Delta x = 0 \rightarrow x = -\Delta x$. This suggests that we should move the $x = 0$ point of $f(x)$ to the $x = -\Delta x$ point, which is to the left, since positive is to the right, negative must mean to the left!

2 Assume "to the left" is positive

Then how do we shift $f(x + \Delta x)$? We initially get the graph $f(x)$, what value of $x$ gives $x + \Delta x = 0$ (the original $f(x)$)? We can solve: $x + \Delta x = 0 \rightarrow x = -\Delta x$. This suggests that we should move the $x = 0$ point of $f(x)$ to the $x = -\Delta x$ point, which is to the right, since positive is to the left, negative must mean to the right!

Note that I copy and pasted my response to both of the above--that's because "to the right" or "to the left" are arbitrary choices that can be switched by a simple exchange of variables.

Here is an illustration:

• I think this really does confuse things more than help. The issue that axes direction is a convention is not what is confusing students here: it is the very real difference between pre-composition and post-composition. – Steven Gubkin Oct 23 '14 at 12:31
• @StevenGubkin I really don't disagree that it's confusing (and I would probably not suggest trying to teach it this way), however, the OP seemed to suggest that shifting to the left when you add (i.e. $f(x+2)$) seems counterintuitive. I was simply trying to explain why it appears counterintuitive when in fact it's the convention of the axes and our preconcieved notions that makes it appear counterintuitive--it's not counterintuitive by nature. I do think the proper way to teach this is not to say it's "opposite", but rather have them reason through it. – Jared Oct 24 '14 at 5:46
• I think this answer does not address the spirit of the question. The question could be rephrased "Why is the graph of $y=f(x+2)$ shifted in the negative $x$ direction relative to the graph of $y=f(x)$, which seems 'backwards' ?". You address that the negative $x$ direction could be left or right (or really any direction!), but that is just further confusing the issue by questioning a convention: it does not address the actual mathematical fact that you have to plug in values $2$ less into the new function to get the same value you got before, which is the whole issue at hand. – Steven Gubkin Oct 24 '14 at 14:11
• So the source of this being counterintuitive is not the convention of axes at all. Somehow $x+2$ results in moving $2$ negative units, which is against most student intuition. – Steven Gubkin Oct 24 '14 at 14:14
• @StevenGubkin Actually I do address that problem: "Then how do we shift $f(x+\Delta x)$? We initially get the graph $f(x)$, what value of $x$ gives $x+\Delta x=0$ (the original $f(x)$)? We can solve: $x+\Delta x=0\rightarrow x=−\Delta x$. This suggests that we should move the $x=0$ point of $f(x)$ to the $x=−\Delta x$ point, which is to the left, since positive is to the right, negative must mean to the left!" Perhaps it would be better to use $x'$ instead of focusing in on $x = 0$ (which is not explicit in my explanation). – Jared Oct 26 '14 at 4:10

I once saw a Calculus book written in the form of a dialogue.

Let me try something like that about function transformation.

Student: If the function $$g$$ is such that $$g(x)= f(x-1)$$, should not the graph of $$g$$ be at every point, 1 unit to the left of the graph of $$f$$?

Teacher: Why do you think it should be the case?

Student: Well I see that in the equation $$g(x)$$ (on the left) becomes $$f(x-1)$$ (on the right). Apparently, the function symbol "$$f$$" is substituted for the function symbol "$$g$$" and the variable "$$x-1$$" is substituted for the variable "$$x$$". So the X-coordinate of each "new point" decreases by 1 unit, and the whole graph is moved 1 unit to the left.

Teacher: Let me ask you a question: which variable represents, according to you, the input of the function $$g$$?

Student: Normally it should be the variable $$x$$, since the left side of the equation has "$$g(x)$$", but the whole equation says that instead of $$x$$, the input becomes $$(x-1)$$. In the expression "$$f(x-1)$$", does not the number $$(x-1)$$ play the role of the input?

Teacher: I think your mistake as to the direction of the transformation comes precisely from not understanding that the inputs that g takes are represented by the letter "$$x$$". The number $$(x-1)$$ does not play the role of input (for $$g$$); it is simply "used" by the function-machine $$g$$ (so to say) to calculate the image of $$x$$ under $$g$$.

Student: Could you show an example?

Teacher: Let me take a general example. Suppose that a point $$(x, y)$$ belongs to the graph of $$g$$. Knowing that $$y$$ is $$g(x)$$ and that $$g(x) = f(x-1)$$, how could you rewrite the couple defining this point?

Student: Probably $$(x-1, f(x-1))$$, no?

Teacher: Why did you change the X-coordinate of this point? You've "moved" that point to the left without any reason! The only new information I gave you is about "$$y$$" , not about "$$x$$".

Student: You're right! Using the information you gave me, I'll now say that

$$(x, y) = (x, (f(x-1))$$

Teacher: Right! Now, tell me, which point belonging to the graph of f corresponds to our "$$g$$-point": $$(x, f(x-1))$$? Obviously, the Y-coordinate of that point is $$f(x-1)$$, but what is its X-coordinate?

Student: The answer is in the question itself, isn't it? It's obviously the point

$$(x-1, f(x-1))$$

Teacher: I agree! But do you realize what it means? You've just told me that for any arbitrary point $$(x, y)$$ belonging to the graph of $$g$$, the corresponding point belonging to the graph of $$f$$ has the same Y-coordinate, but an X-coordinate that is smaller by 1 unit! That means that any arbitrary "$$g$$-point" (so to say) is one unit to the RIGHT of it's corresponding point "$$f$$-point"!

Student: If I now understand what I said myself, I've just claimed, contrary to what I contended at the beginning, that the transformation is a translation of the whole graph of $$f$$ 1 unit to the RIGHT!

Teacher: That's what you said, actually!

My advice is a little different/contrarian. IN ADDITION TO BUT BEFORE explaining the stuff like "signal delayed" or "making $$2x = y$$" or whatever: Just be honest and tell the kids: "This is a sneaky, tricky thing to watch out for. People miss it all the time and get points taken off." Then give them the blabla explanation. But the honest expression before will concentrate their minds much more than just the explanation itself.

After that, drill and carrot/stick them. Some things make more sense after you just have spent a lot of time doing them.

• How does this answer this specific question? – JTP - Apologise to Monica Mar 29 '19 at 1:27
• At a minimum, it shows that whatever explanation you give will be better received if conveyed in this manner. The question asks "how to explain", not just "what is the explanation". And my point is their minds will be better concentrated if you give them motivation/understanding/sympathy first on the issue before giving the explanation itself. Capisce? – guest Mar 29 '19 at 1:31
• Not really. It seems to me that your advice can be used as a preface to nearly any math question. – JTP - Apologise to Monica Mar 29 '19 at 2:03
• For the trickier ones, sure. But in any case, that's actually the more relevant advice towards "how to explain". The issue is not the "code" of the explanation, but practical psychology. – guest Mar 29 '19 at 2:32