An horizontal compression (or stretch) acts on the horizontal axis, which is related with variable x. Then, we have
Now, a vertical compression (or stretch) acts on the vertical axis, which is related with variable y (or f(x)). Then, we have
If we have the following expression:
[tex]g(x)=\frac{1}{3}x^2+2[/tex]the parent function is
[tex]f(x)=x^2[/tex]so, in order to get g(x) from f(x), we need a translation up 2 units and a vertical stretch by 1/3, that is,
[tex]f(x)\Rightarrow g(x)=\frac{1}{3}f(x)+2[/tex]