eli5: Why does y=f(x+2) move it two units to the left (not right)?

216 views

This is also the case where y=f(2x) where it dilates by a factor of 1/2. Why are they seemingly the opposite of what intuition tells me?

Edit:
Thanks guys 🙂 got it.

In: 0

5 Answers

Anonymous 0 Comments

Because you’re thinking too directly. The important idea is what change in x is necessary to give the same output.

Consider f(x) when x = 0, then the outcome is f(0)

For f(x+2), x has to be -2 for the outcome to be f(0). If x = 2, then f(x+2) = f(4) not f(0).

Should it move left or right?

The same reasoning for stretching and shrinking. Consider f(x) when x = 2 which gives f(2). For f(2x) what does x have to be to get f(2)? Does x have to be 1/2 or 4?

Anonymous 0 Comments

You’re basically just asking the question “What value would this function be at [position] rather than x, but show this value here”.

So f(x+2) asks “what is the value at thevposition 2 more than x, please show it at x”. That by definition takes a value from the right of x and moves it left from x+2 to x. The function shifts to the left.

F(2x) is same principle, but you’re asking “what’s the value at twice the value of x, show it here”, but everything positive moves left, everything negative moves right. The function squishes.

Same principle in the case of reverse operations, just reverse the result.

Anonymous 0 Comments

Generally, for any given positive constant C, f(x+C) moves left by C units because the point that corresponds to f(0) is now at x = -C, which is clearly to the left. If C is negative, then it moves to the right because x = -C is positive.

Similarly, with scaling, it’s useful to see where f(1) ends up. For f(Sx) to equal f(1) (in the general sense), x = 1/S. For S > 1, 1/S < 1, so the point corresponding to f(1) is now closer to 0 than before, so it looks like a squish in with a high S.

Anonymous 0 Comments

y=x

When x=0, y=0
When x=1 , y=1
When x=2, y=2
When x=3, y=3
When x=4, y=4

____
y=x+2

When x=-2, y=0
When x=-1, y=1
When x=0, y=2
When x=1, y=3
When x=2, y=4

As such, y=(x+2) lets y achieve its outputs 2 units sooner than y=x does, and sooner is on the left.

____

y=2x

When x=0, y=0
When x=0.5, y=1
When x=1, y=2
When x=1.5, y=3
When x=2, y=4

As such, y=2x lets y achieve its outputs 2 times sooner (or reciprocal: 1/2 the x value) than y=x does, the graph looks like horizontal compression as a result.

Note: For linear functions (and quadratics centered at the origin), a horizontal compression is the same thing as a vertical stretch. A vertical stretch is what I would typically say in this case (y values being twice as large for the same input), it just happens that it can also be looked at as a horizontal compression. For more complex stuff (say a sine/cosine wave), they are not related and f(2x) would be a horizontal compression and 2f(x) would be a vertical stretch.

Anonymous 0 Comments

Lets look at an example for a line x=y. So f(0)=0, f(1)=1, … So now lets do f(x+2), if f(0)=0 then if x+2=0 the line will cross the x axis at that x+2 point. So x=-2 therfore you push y=0 as well as ever point to the left.