I know $y=2f(x)$ doubles the $y$ value in vertical shifting, and I know that $y=(1/2)f(x)$ halves the $y$ value. But, why does $y=f(2x)$ halve the $x$ value, and why does $y=f((1/2)x)$ double the $x$ value in horizontal shifting? I looked at the graphs, and I see the difference, but I want to know the math behind why it halves instead of doubling the $x$ value for $y=f(2x)$. Maybe this is a stupid question, but could someone help me out?
Thank you.
$\endgroup$ 23 Answers
$\begingroup$If you let$$\ g(x) = 2f(x) $$then in words you understand that
The value of $g$ at some $x$ is twice the value of $f$ there.
You stretch the height of the graph of $f$ to get the graph of $g$.
If you let$$\ h(x) = f(2x) $$then in words
The value of $h$ at $x$ is the value $f$ has at $2x$, twice as far along on the $x$-axis.
So to get the graph of $h$ on, say, the interval $[0,1]$ you find the values of $f$ on $[0,2]$ and slide them halfway to the vertical axis. That shrinks the graph of $f$ horizontally.
The same kind of analysis explains why $g(x) = f(x)+2$ shifts the graph up (positive direction) while $h(x) = f(x+2)$ shifts the graph left (negative direction).
$\endgroup$ 1 $\begingroup$Not a stupid question at all. A common and very reasonable question, in fact. Consider:
$$y=2f(x).$$
As you wrote, the graph will be stretched vertically by a factor of $2$. Note how it is written. The $y$ value equaled something, and we doubled that thing - we literally multiplied it by $2$.
When we write:
$$y=f(2x),$$
we do not operate in quite the same way. Instead of having $x$ equal something and doubling that thing, we have instead halved the value needed to obtain a specific $y$. It may be worth reading through that sentence a few times.
You cannot always do this easily, but if you take a simple enough function, such as perhaps $f(x)=2x+5$ and/or $f(x)=\dfrac{1}{x-1}$, and solve it for $x$, so that $x$ is a function of $y$, then the roles will switch. $f(2y)$ will be a vertical shrink by $2$, instead of a stretch. Does this help?
$\endgroup$ $\begingroup$I had the same doubts last year when I was completing my high school math and I pretty much ended up memorizing the results but well... haha.
So here's how it works, when $y = f(2x)$ all values of $x$ are doubled.
What this means is say for example if you were to plot a graph of the function $f(x) = x^2$ and you were to plot $y = f(x)$ on the graph then when $x = 6$ $y = f(6)$ from $f(x) = x^2$ $y = 36$ this I am sure you can figure out.
But when you plot the graph of $y = f(2x)$ when $x = 6$ $y = 144$ not 36 so if you think carefully about it you realize that instead of $x^2$ $(2x)^2$ took place, instead of $6^2$ $12^2$ took place at the point $x=6$.
So where did the 36 go????
How about we try with $x = 3$ $y = f(2x)$ so $y = f(2*3)$ so $y = f(6)$ and this is the same as our first scenario, so because half the value of $x$ is required to plot the same $y$ point when $y = f(2x)$ the entire curve squeezes horizontally to half it's size.
If you attempt to take simple examples like the ones above to explain $y = f((1/2)x)$ I am sure you will realize why the curve stretches horizontally to twice it's size.
Hope that's the answer of your question.
$\endgroup$