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.

Solutions Collecting From Web of "Explaining Horizontal Shifting and Scaling"

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.

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 “braindamage” 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 mymoney = yourmoney + 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 yourmoney frame of reference, and easily see that although 1 is being added to yourmoney, the result of that formula expresses my money and not yours! Haha.

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 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$ pic

As we can see, “putting it back over the $x$-value” does the inverse of the transform to the actual graph (squigly line) of $f$.

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$.

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.

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.

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


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


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


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:



and eliminating the parameter gives


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

For scaling, we have



from which we can obtain


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

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.

enter image description here

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 🙂

I reference http://iws.collin.edu/dkatz/CollegeAlgebra_Transformations.pdf. Here is an algebraic interpretation, as opposed to the (easier) geometric one that I proposed herein.

WLOG, pick any point $x_0$ on any function $f(x)$. So we are starting with $(x_0, \color{brown}{f(x_0)})$. We want only a horizontal shift, and NOT a vertical one. So our goal is to analyse the abscissa ($x$-coordinate) of the horizontal shift. Define $x_1$ as the abscissa of the horizontal shift. Then “horizontal shift” in math notation is just $f(x_1 + h)$.

Stated wrt $x_1$, our goal is to analyse the abscissa of $f(x_1 + h)$. WLOG, suppose $h > 0$.

Again, we want only a horizontal shift, and NOT a vertical one. So we require $x_1 \ni f(x_1 + h) = \color{brown}{f(x_0)}$. So let’s pick $x_1 \ni x_1 + h = x_0 \iff \color{green}{x_1 = x_0 – h}.$

Therefore, after substituting $\color{green}{x_1}$ in $f(\color{green}{x_1} + h)$ , we obtain $(x_0 – h, f\left(\color{green}{x_1} + h)\right) = (x_0 – h, f\left(\color{green}{[x_0 – h]} + h)\right) = (x_0 – h, f(x_0))$.
I took $h > 0$ WLOG above so $x_0 – h < x_0 \Longrightarrow $ a leftward shift of all the abscissae.
However, notice that $f(\color{green}{x_1} + h) = f(x_0)$ by our construction. So the ordinates have stayed the same, as per our goal.