Transformation of $f(x)$ We have $f(x)$. If we want to make up $f(ax+b)$ : 

1.We should first create $f(ax)$ and then $f(ax+b)$

2 Firstly create $f(x+b)$ and then $f(ax+b)$ ?

In the other words , I'm in doubt when we create $f(ax)$ the coefficient of $x$ only is multiplied by $x$ and make up $f(ax+b)$ or multiple by $x+b$ and make up $f(ax + ab)$ and therefore second way is wrong. 
If someone provide several examples like $f(x) = x^2$ and create $f(ax+b) = (ax+b)^2$ using function transformations is helpful. 

Example : Consider $f(x) = sin(x)$ . I used Mathematica for drawing functions.  We want to create $f(3x-1)$. We should draw $sin(3x)$ and then $sin(3x-\frac{1}{3})$ but I think we have to draw $sin(3x-1)$ in last step. Am I wrong ? Why?
Going from $f(x)$ to $g(x) = f(ax + b)$ requires two $2$ function transformations. 


A horizontal movement of $-b$ by substitution $x$ by $x+b$. $(g(x))$
A horizontal multiplication of $\frac{1}{a}$ by substition $x$ by $ax$. $(h(x))$


Example: Let $f(x) = x^2$. Then 

$$g(x) = (x+b)^2$$ and $$h(x) = (ax+b)^2.$$ Question: Does the order matter, that is, can we first do the second and then the first transformation?
Going from $f(x)$ to $g(x) = f(ax + b)$ requires two $2$ function transformations. 


A horizontal movement of $-b$ by substitution $x$ by $x+b$. $(g(x))$
A horizontal multiplication of $\frac{1}{a}$ by substition $x$ by $ax$. $(h(x))$


Example: Let $f(x) = x^2$. Then 

$$g(x) = (x+b)^2$$ and $$h(x) = (ax+b)^2.$$ Question: Does the order matter, that is, can we first do the second and then the first transformation?