# Explaining Horizontal Shifting and Scaling

I always find myself wanting for a clear explanation (to a college algebra student) for the fact that horizontal transformations of graphs work in the opposite way that one might expect.

For example, $f(x+1)$ is a horizontal shift to the left (a shift toward the negative side of the $x$-axis), whereas a cursory glance would cause one to suspect that adding a positive amount should shift in the positive direction. Similarly, $f(2x)$ causes the graph to shrink horizontally, not expand.

I generally explain this by saying $x$ is getting a "head start". For example, suppose $f(x)$ has a root at $x = 5$. The graph of $f(x+1)$ is getting a unit for free, and so we only need $x = 4$ to get the same output before as before (i.e. a root). Thus, the root that used to be at $x=5$ is now at $x=4$, which is a shift to the left.

My explanation seems to help some students and mystify others. I was hoping someone else in the community had an enlightening way to explain these phenomena. Again, I emphasize that the purpose is to strengthen the student's intuition; a rigorous algebraic approach is not what I'm looking for.

• Some time ago I took an example of $\alpha\cdot x+\beta = c$, $\alpha > 0$, and explained that $x$ gets smaller as $\alpha$ or $\beta$ gets bigger, all to keep the balance enforced by equality sign "$=$". I have no idea if this is intuitive, but it helped the people I was talking to. – dtldarek Apr 17 '12 at 23:02
• Perhaps this should be community wiki? – Jim Belk Apr 17 '12 at 23:12
• I too lack a great explanation, but I find that the example of $f(x)=x$ aids in remembering the behavior. There you can show that $f(x+1)=f(x)+1$ is both a positive vertical shift and a negative horizontal shift, and $f(2x)=2f(x)$ is both a vertical expansion and a horizontal shrinking. This helps cement the idea that the transformations work in opposite directions (but may cause other misconceptions if you don't follow up quickly with other examples). – AMPerrine Apr 17 '12 at 23:17
• This is a very difficult question to answer. I'm trying to compose an answer from my perspective, as I too dealt with this oddity (as a student). – 000 Apr 17 '12 at 23:20
• Perhaps the question should be from who's perspective does the graph shift? The graph of $f$ shifted to the right $1$ 'uses' $x-1$ to get back to the original function? – john w. Apr 18 '12 at 1:40

Here is a setting where the students will have experience, having nothing to do with skills in algebra: daylight savings time (since you're in the USA). When we advance clocks ahead by an hour we lose an hour of sleep. Thus replacing $t$ with $t+1$ shifts your schedule for the day back by one hour.

Here, $t$ is the old "function" and $t + 1$ is the new "function". $t$ is one hour behind $t + 1$, but after this transformation, $t + 1$ shortens the day by one hour. So in the end, we lose an hour. Point out to the students that it also works the other way when we turn the clocks back ($t$ is replaced with $t-1$) and then gain an hour in our schedule.

• That's very clever! – Austin Mohr Apr 17 '12 at 23:37
• I think looking at shifts of $y=x^2$ is easier to use than shifts of the line $y=x$, because one's attention focuses on where the parabola touches the $x$-axis instead of the crossing. – KCd Apr 19 '12 at 2:53
• I love this, especially because there is an intuitive way for people with weak math backgrounds to understand why this happens (without a need for actually writing down a specific wake-up time to see what happens, analogous to setting x=5 in the original post): if you add an hour to the clocks, you will have to skip an hour (i.e., cut one out of the day) at some time. Then, of course, if everyone skips that hour, people have less time for sleep, work, etc. – Barry Smith Apr 20 '12 at 18:20
• There is a way to make this into an intuitive explanation for students (although probably too complicated to be useful) --- imagine traversing the graph of $f(x)$ from left to right, and then at some specific value $x=c$, begin traversing $f(x+1)$ instead. You will have "skipped" the part of the graph of $f$ with $x$ in the interval $(c,c+1)$, but you didn't skip any part of the $x$-axis. So the graph you create would be the graph of $f$ with the part between $(c,c+1)$ snipped out and the part of the graph to the right of $x=c$ ''pulled to the left''. – Barry Smith Apr 20 '12 at 18:28
• I shall also mention daylight savings in explaining re-indexing series. – Barry Smith Apr 20 '12 at 18:30

Enter, the Function Monkey ...

As described in the link, to plot a graph, simply imagine the $x$-axis covered in coconuts, one for every $x$ value, like this:

$$\cdots \quad (-3\;) \quad \color{#9509A5}{(-2\;)} \quad \color{green}{(\;-1\;)} \quad \color{red}{[\;0\;]} \quad \color{ #2B87CD}{(\;1\;)} \color{#D86907}{\quad (\;2\;)} \quad (\;3\;) \quad \cdots$$

with "$\color{red}{[\;\cdot\;]}$" indicating the coconut at the origin. The Function Monkey strolls along the axis, picks up each $x$ coconut, evaluates the corresponding $y$ value (as is his wont), and throws the coconut to the appropriate height (or depth). Graph plotted!

But, wait! No one ever said that the values of the coconuts were required to match the values of the $x$ coordinates which have been coloured for convenience. Hmmmm ...

If the coconut at (the coloured) location $x$ has value $x+1$, then the row of coconuts looks like this: $$\cdots \quad (-2\;) \quad \color{#9509A5}{(\;-1\;)} \quad \color{green}{(\;0\;)} \quad \color{red}{[\;1\;]} \quad \color{ #2B87CD}{(\;2\;)} \color{#D86907}{\quad (\;3\;)} \quad (\;4\;) \quad \cdots$$

Importantly, the coconut locations in colour have not changed. The coconuts still sit on the axis at locations $x = \cdots, -3, \color{#9509A5}{-2},\color{green}{-1}, \color{red}{0},\color{#2B87CD}{1}, \color{#D86907}{2}, 3, \cdots$ still indicating the coconut at the origin.

So far as the Function Monkey is concerned, adding $1$ to each coconut value has effectively shifted the row of coconuts to the left. (Likewise, adding $-1$ to each coconut value effectively shifts the row of coconuts to the right.) Since the Function Monkey throws coconuts vertically, the plotted graph shifts the same way.

In a similar manner, multiplying each (original) coconut value by $2$ yields this row of coconuts:

$$\cdots \quad (-6\;) \quad \color{#9509A5}{(-4\;)} \quad \color{green}{(-2\;)} \quad \color{red}{[\;0\;]} \quad \color{ #2B87CD}{(\;2\;)} \color{#D86907}{\quad (\;4\;)} \quad (\;6\;) \quad \cdots$$

Again, the locations of the coconuts haven't changed, but we see that the span of coconut values from $-6$ to $6$ has been compressed into the space between locations $x=-3$ and $x=3$. The graph will exhibit the same, horizontal, compression.

A plot-less way of thinking about this, which is close to your "head start" interpretation, is that "$f(x+1)$" fools Function Monkey $f$ into thinking that each input value is one unit bigger than it really is. Similarly "$f(2x)$" fools him into thinking that each input is twice its actual size. The effective changes in output values correspond to the Function Monkey's altered perceptions.

• The Function Monkey: the metaphor that keeps on giving... – J. M. is a poor mathematician Apr 18 '12 at 11:48
• @J.M.: "To a man with a hammer ..." or, as the case may be, a hominid ... – Blue Apr 18 '12 at 15:34

You should change variables when changing the coordinate system! x + 1 is confusing because you're re-using the variable. x is already used for representing our "home base" frame of reference.

For instance, pick the symbols s and t, and change to the coordinate system:

let s = x + 1
let t = y + 3


Now this does not mean we are moving up and to the right!

Think: where is the origin of the <s, t> coordinate system in the <x, y> coordinate system? It is at <-1, -3>, because we have to solve by setting <s, t> to <0, 0>; i.e. solve x + 1 = 0 and y + 3 = 0.

The <x, y> system must remain our frame of reference if we are to visualize the motion, and so what we do is rework the equations to isolate x and y:

x = s - 1
y = t - 3


Now you can see that it's a move left and down and this is consistent with the minus signs.

The "backwards" issue arises when you put yourself into the frame of reference of the transformation, but continue using <x, y> to think about that frame. You have to think about the backwards mapping: how do you recover <x, y> from that other frame of reference?

When you see x + 1, you must not imagine that x is moving. (This may be "brain damage" from working in imperative computer programming languages, especially ones like C and BASIC where the = sign is used for assignment: x = x + 1 moves coordinate x to the right.) Rather, x is used as the input to a calculation that produces some other value. And so x is that other value, minus 1.

If I say my money = your money + 1 are you richer than me? No, you're poorer by a dollar! That's easy to see because when the variables have these names, of course you instantly and intuitively put yourself into the your money frame of reference, and easily see that although 1 is being added to your money, the result of that formula expresses my money and not yours! Haha.

When I shift the graph of $f$ one unit to the right I create a new function $g$. To find out the value $g(x)$ I have to look what the value of $f$ was one unit to the left of $x$. therefore $g(x):=f(x-1)$.

Intuitively, the graph of $f(x+1)$ is horizontally shifted to the left because the coordinate system itself is shifted to the right. Likewise, the graph of $f(2x)$ is shrunk horizontally because the coordinate system is stretched by a factor of $2$.

• I've heard this explanation offered before, but, in my experience, it only serves to make vertical transformations confusing. "If $f(x+1)$ shifts the axis to the right, why doesn't $f(x) + 1$ shift the axis upward?" – Austin Mohr Apr 17 '12 at 23:08
• @AustinMohr: Roughly, a transformation on the argument of $f(x)$ is a transformation on the coordinate system. A transformation on $f(x)$ is a transformation on the graph. A function and its argument play very different roles! – user26872 Apr 17 '12 at 23:14
• Also, $y=f(x)+1$ is equivalent to $y-1=f(x)$. So, the effect on $y$ is exactly analogous to the effect on $x$: subtracting $1$ from the coordinate variable corresponds to a "positive" translation along the coordinate axis, adding $1$ corresponds to a "negative" translation. Likewise, with $y=2f(x)$ the equivalent of $y/2=f(x)$. – Blue Apr 18 '12 at 12:18
• @DayLateDon: Well put! – user26872 Apr 18 '12 at 14:52
• @Blue What does 'coordinate variable' mean please? – Greek - Area 51 Proposal Nov 22 '18 at 18:06

The map $$f$$ already assigns $$\color{Purple}{\sigma x\mapsto f(\sigma x)}$$. In order to construct the assignment $$\color{DarkBlue}x\mapsto \color{DarkOrange}{f(\sigma x)}$$, we must apply the inverse $$\sigma^{-1}$$ in order to put $$f(\sigma x)$$ (originally located at $$\sigma x$$) "back" to $$x$$, that is

$$(\sigma^{-1},\,\mathrm{Id}):\big(\sigma x,f(\sigma x)\big)\mapsto \big(x,f(\sigma x)\big).$$

The above is, of course, too algebraic. So here's a colorful depiction of what's going on:

$$\hskip 1in$$ As we can see, "putting it back over the $$x$$-value" does the inverse of the transform to the actual graph (squiggly line) of $$f$$.

• No offense intended, but I don't think this explanation will do well with a college algebra student. (This reminds me of Category Theory and frankly terrifies me.) – 000 Apr 17 '12 at 23:34
• @Limitless: What if I substituted $\sigma, f$ and $\sigma^{-1}$ respectively with the words "transform," "apply function," and "put it back over $x$-value"? – anon Apr 17 '12 at 23:37
• Oh, wow.... Bravo, Sir. It makes perfect sense now. Thank you. I think I was more terrified by the sense abstraction and symbols than its actual degree of difficulty. I'll have to keep this abstract principle of ignoring the intimidating aspects of mathematics in mind. ;) – 000 Apr 17 '12 at 23:50

It may help to try to comprehend the abridged version of Kaz's answer: https://math.stackexchange.com/a/133348/53259.

Because we want to work with $(x,y)$, the key is to remain focused on the $xy$-axis in black. It truly helps to use new variables for the new coordinate axes. So define $\color{green}{\left\{ \begin{array}{rcl} s = x + 1 \\ t = y + 3 \end{array}\right.} \iff \left\{ \begin{array}{rcl} x = s - 1 \\ y = t - 3 \end{array}\right.$. Thus, this shows the source of the bewilderment. We should remain thinking of the black and not the green. What does the graph of $g(x) = f(x+1)$ look like? Well, $g(0)$ is $f(1)$, $g(1)$ is $f(2)$, and so on. Put another way, the point $(1,f(1))$ on the graph of $f(x)$ has become the point $(0,g(0))$ on the graph of $g(x)$, and so on. At this point, drawing an actual graph and showing how the points on the graph of $f(x)$ move one unit to the left to become points on the graph of $g(x)$ helps the student understand the concept. Whether the student absorbs the concept well enough to utilize it correctly later is quite another matter.

Well we replaced everywhere $x$ by $x'=x+1$, $x'=2x$ or whatever so that the 'old' variable $x$ was shifted by $-1$ ($x=x'-1$), divided by $2$ or whatever. Of course you'll have to convince yourself first! :-)

To expand a bit (and considering Oenamen's comment) I'll add that you may use the physical concept of Active and passive transformation :

• $f(x)\to f(x)+1$ is an active transformation : in a fixed frame the curve became higher of a unit

• $f(x)\to f(x+1)$ is a passive transformation : the frame of reference changed (that's the case of interest for you : the old frame moved one unit left)

After whacking my head for a rather irksome period, I've concluded this is an error in our perception. It's deceptively natural to see the $+$ and immediately think that the graph tends toward the positive, rather than the negative. I think this is one of those cases of mathematical notation gone wrong. Rather than encouraging correct patterns, it is encouraging incorrect patterns.

It's just like how, without knowing any better, one may presume that: $\lim_{x \to 0^{+}}f(x)$ is intuitively the value that $f(x)$ approaches as one approaches $0$ from the right to the left (i.e. it gets big as it comes toward $0$, or more positive) rather than the fact that it actually comes from the left to the right (i.e. it gets smaller as it comes toward $0$ or more negative*). Pardon me if that choice of words is rather confusing; it's more emphatic of how confusing our notation is with regard to 'left' and 'right'.

In short, I don't think there is an adequate intuitive justification for this deceptive notation.

(*=Don't take the phrases "more postive" and "more negative" too seriously in this context. They respectively indicate, "closer to positive numbers" and "closer to negative numbers".)

Not sure if this works in every situation but...

Say you have function f(x) = X^2 with domain [-1,1]

and function g(x) = f(x + 1)...

The correct domain for g(x) should be [-2,0]

One can arrive at this conclusion using the domain of f(x)

x + 1 = -1 => x = -1 - 1 => x = -2.

and similarly...

x + 1 = 1 => x = 1 - 1 => x = 0

Giving you the domain for g(x) = [-2, 0]

I try to explain this concept several different ways, using some of the more mathematical approaches above. Sometimes I run into students who still just don't get it, so I offer them this analogy:

Pretend your car represents a mathematical function. The inputs are the gas you put in the tank, and the output is how far you can drive. Let's say that you fill up your gas tank, which means you can then drive a set distance. Further suppose that one of your jerk friends comes by in the night and siphons off 5 gallons of gas. If you want to drive the same distance (i.e. achieve the same outputs), you then need to add back that 5 gallons of gas. So if we have to add back those inputs, it's going to shift the graph to the right. Conversely, if you had a nice friend who gave you 5 gallons of gas, you could take out those 5 gallons from your tank and still drive the same distance. The analogy also works for horizontal stretches/shrinks.

It's not a perfect analogy, but for those kids who are really confused and just can't seem to wrap their minds around the mathematics, it seems to help.

$$\hspace{1cm}$$ When the $$x$$-scale is increased by $$R$$, the function's argument must be decreased by $$R$$ to compensate.

When the $$x$$-scale is decreased by $$L$$, the function's argument must be increased by $$L$$ to compensate.

In a basic way, I'm not sure that there's much that you can do here beyond just plotting points. For example, you could draw a graph of $y=\sqrt{x}$ by plotting a few points, and then draw a graph of $y=\sqrt{x-3}$ by plotting the corresponding points. After you draw the graphs, you can observe that one is obtained by translating the other.

Ultimately, I don't think this has a simple conceptual explanation -- it's just a phenomenon that you observe when you start drawing graphs. It's almost closer in character to a scientific fact than a mathematical fact.

That doesn't mean that there's nothing to teach here. The important thing is that students should understand how the result was obtained, and should be able to re-derive it for themselves if they need it. If I were teaching precalculus, I would give the students challenges like drawing graphs of $f(x^2)$ and $f(x)^2$ from the graph of $f(x)$. The reasoning is essentially the same as for shifting and scaling, and it will help them to improve their overall understanding of graphs.

To answer simply: when assessing the vertical shift, one isolates the Y variable. For example: y= x^2 + 3. This results in a vertical shift up. However When determining a horizontal shift in standard form, such as y=(x-1)^2 - 3 It appears to be opposite because again the Y variable is isolated. This shift would be to the right by one unit. If we isolated the X variable, the equation would appear as +/- root 3 + 1 = x

Here you see that with x isolated, the horizontal shift is to the right by 1 unit.

Cheers :)

• Welcome to the site! Check out the math notation guide. You may want to improve the appearance of your answer by editing it. – user147263 Jul 20 '14 at 0:45
• This is a bit confusingly worded, you may want to explain what you mean by your last sentence (for example) – Adam Hughes Jul 20 '14 at 1:07

I'm not sure how effective this will be for a kid these days, but this was how I managed to grasp it when I was once one.

I find that scaling and shifting is a lot more natural when one considers parametric equations. Given some curve

\begin{align*}x&=f(t)\\y&=g(t)\end{align*}

we find adding a nonnegative quantity to either component does the expected shift behavior:

\begin{align*}x&=h+f(t)\\y&=k+g(t)\end{align*}

with $h,k \geq 0$ shifts $h$ units to the right and $k$ units upwards (negative $h,k$ of course does the opposite direction); and

\begin{align*}x&=c\,f(t)\\y&=c\,g(t)\end{align*}

with $c > 0$ scales the curve as expected.

(Note that the matrix-vector treatment also works here; the first bit is adding a translation vector, and the second bit is multiplication of a vector by a diagonal scaling matrix.)

Now, letting $f(t)=t$ (thus yielding a trivial set of parametric equations for $y=g(x)$), and eliminating variables, we then have this strange artifact of this natural transformation:

\begin{align*}x&=h+t\\y&=k+g(t)\end{align*}

\begin{align*}x-h&=t\\y&=k+g(t)\end{align*}

and eliminating the parameter gives

$$y=k+g(x-h)$$

and that's where the minus sign in shifting an explicit form horizontally comes from.

For scaling, we have

\begin{align*}x&=ct\\y&=c\,g(t)\end{align*}

\begin{align*}\frac{x}{c}&=t\\y&=c\,g(t)\end{align*}

from which we can obtain

$$y=c\,g\left(\frac{x}{c}\right)$$

and that's why we have to divide instead of multiplying when scaling horizontally in explicit form.

• Exactly, go based on what the transformation is to the relevant variable. So y = f(x) + 1 could be rewritten as y - 1 = f(x) and it all makes sense. – Christian Mann Apr 18 '12 at 4:00

Just as an extension to the KCd's answer, we can think of this not only as daylight saving problem, but also as a timezone problem. For example, if you leave New York for Singapore you have to shift time on your watch $+12$ hours in order to keep up with local Singapore time. But if you want to express Singapore time in terms of New York time (due to the jet lag, perhaps) you could say "it's $x - 12$ hours in Singapore now in terms of New York time" or "it's $x - 12$ hours in New York now".

• I feel like this explanation is more likely to confuse than to help, In your analogy, it is not obvious what function is being shifted (since the choice coordinates---either New York is at zero, or Singapore is at zero---is unclear), and people have enough trouble with communicating clock-time (for example, if I move a noon meeting "up two hours", does that mean that we are now meeting at 10:00 am, or at 2:00 pm?). – Xander Henderson Jun 16 '18 at 17:50
• Honestly, I don't grasp where's the confusion. For instance, if you leave New York, which is your starting point, I assume, that it's a zero, and Singapore, while a destination, must be +12 on the coordinate plane. But you're right, that time analogy is always confusing. I think at the end the best way to form an intuition for this shifting problem, is to remember, that you're evaluating the original and the shifted function. You can ask yourself "what should I do to the shifted function in order it to be equal to the original function". Although, this is still not crystal clear. – Tim Nikitin Jun 16 '18 at 18:08

## protected by Community♦Sep 5 '18 at 1:20

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).