Are horizontally shifting and stretching a graph in y-direction always interchangeable? For example, to plot $g(x) = 2(x-2)^3$, you could

*

*Take $f_1(x) = x^3$. Stretch it by the factor 2 in y-direction: $f_2(x) = 2 \cdot f_1(x) = 2x^3$ and then shift it by 2 units on the x-axis in positive direction: $f_3 = f_2(x - 2) = 2(x-2)^3$. $f_3 (x) = g(x)$.


*Take $f_1(x) = x^3$. Shift it by 2 units on the x-axis in positive direction: $f_2(x) = (x-2)^3$ and then stretch it by the factor 2 in y-direction: $f_3(x) = 2 \cdot f_2(x) = 2(x-2)^3$. $f_3(x) = g(x)$.
(The only case I noticed where horizontally shifting and stretching in y-direction aren't interchangeable is for lines, where horizontally shifting is equivalent to vertically shifting. In that case, stretching would also stretch the shift, so you should first stretch and only then shift.)
(Edit: even for lines, the two operations are interchangeable)
Now my question is, are horizontally shifting and stretching in y-direction always interchangeable(, with the one exception being lines?)
 A: What you are doing is taking a prototype function, $f_1(x)$,
whose graph you know,
and creating a new function
$$ g(x) = k f_1(x - h) $$
with a stretch factor $k$ and shift $h.$
Indeed if you shift $f_1(x)$ by $h$ units it goes to
$f_1(x - h)$ and if you then stretch by a factor $k$ it goes to $k f_1(x-h).$
But if you first stretch $f_1(x)$ by $k$ it goes to $k f_1(x)$
and if you then shift by $h$ units it goes to $k f_1(x - h)$
... the same result.
So you get the same result whether you shift and then stretch, or stretch and then shift, even for lines.
For example, let $y = f_1(x) = 3x + 2.$
Stretched by a factor $2$ the graph becomes the graph of $y = 2(3x + 2) = 6x + 4.$
Then shift by $2$ and you get the graph of $y = 6(x-2) + 4 = 6x - 8.$
But if you first shift by $2$ you get $y = 3(x - 2) + 2 = 3x - 4$
and then stretching by a factor of $2$ gives us $y = 2(3x - 4) = 6x - 8.$
You do have to be careful that you define the vertical stretch the same way for every function. The stretch from $f(x)$ to $kf(x)$ is a transformation that leaves points on the $x$ axis unchanged and multiplies the distance of every other point from the $x$ axis by a factor $k.$
In particular, the $x$-intercept of a line is the point that is held fixed with the graph of a line is stretched.
If you hold the $y$-intercept fixed instead, you're performing a different transformation.
If you still have difficulty believing that the process works just as well for lines as for other functions, try editing your question to add an explanation of exactly how you shifted and stretched a line, showing the different results you came up with, so that we might figure out why they are different.
A: More of a side note than an answer; but for exponential functions $f(x) = ke^{\lambda x}$, horizontally shifting is equivalent to vertical stretching. I think one could formalize this property in a way that would characterize exponential functions.
