# Order of Operations for Horizontal Transformations

We know that when we want to combine two horizontal transformations, specifically that of translating and stretching a function, we have to translate $f(x)$ first, and then afterwards stretch it.

Following the normal order of operations, you would expect to resolve ‘$qx$’ (the stretching) before ‘$+ d$’ (the translation) but you resolve the transformation in the opposite order.

My question is, what if we explicitly try to do the two in reverse order?

If the graph $y = f(x)$ is transformed by applying first a horizontal stretch factor of $q$ relative to the y-axis, then a horizontal translation $d$ to the left, what is the equation of the resulting graph?

I would go with:

$$y = f\left(\frac{1}{q}\big(x + d\big)\right)$$

...as you are stretching $f(x)$ first, meaning that you replace $x$ with $x/q$, and then translating $f(x)$, replacing $x$ with $(x + d)$ to give the above equation.

But according to the rule, one would expect it to be:

$$y = f\left(\frac{x}{q} + d\right)$$

Which equation is correct?

The first expression, $y = f\left(\frac{1}{q}\big(x + d\big)\right)$, is the composition $fog$ with $g(x)=\frac{x+d}{q}$ and the second, $y = f\left(\frac{x}{q} + d\right)$, is the composition $foh$ with $h(x)=\frac xq+d$. You have two distinct functions.
• I don´t understand clearly "horizontal dilation" and "horizontal translation" (my English is not good) however I guess "translation" means $x+d$ and by exclusion "dilation" would mean $\frac {x}{q}$. If this is so it seems to me that $g$ is the function. – Piquito Oct 11 '15 at 16:13