# Function Transformations - For [[Polynomials#Root Multiplicity]] dictates if its graph will cross or touch the x-axis at a root or not. - Similarly, changes to signs of coefficients dictate if the graph will have roots. See [[Descartes' Rule of Signs]] ## Linear Transformations or Shifts and Stretches (scaling) Given any function $f$, it can be shifted and scaled around both axis by applying the following transformation: $ f'(x) = {\color{red}a} f({\color {green} b}(x- {\color {yellow}h})) + {\color {cyan} k} $ Where ${\color{red}a}$, ${\color {green} b}$, ${\color {yellow}h}$ and ${\color {cyan} k}$ have the following effects: - ${\color{red}a}$ scales the function vertically i.e. around the $x$ axis. The origin of the scale is the $x$-axis intercept shifted by the ${\color {cyan} k}$ offset. - ${\color {green} b}$ scales the function horizontally i.e. around the $y$-axis. The origin of the scale is the $y$-axis intercept shifted by the ${\color {yellow}h}$ offset. Note that positive values of ${\color {green} b}$ will actually shrink the graph. You can reason about this by thinking about the sine function. A positive value of 2 will mean the function is 'twice as fast', the graphical representation of which is shrinking the graph. - ${\color {yellow}h}$ is the $x$-axis shift. This constant is subtracted from $x$ because it is applied before the function is called. If it were positive, it would actually mean shifting the coordinate system, instead of the function graph. - ${\color {cyan} k}$ is the $y$-axis shift. ## Rotations A function (or a set of points) can be rotated about the origin by applying the following vector transformation ($\theta$ is the angle of rotation): $ R(C) = \left[ \begin{matrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{matrix} \right]C $ $C$ can correspond to a point, a set of points, or a whole function. This formula is essentially nothing other than the [[Trigonometric Functions#Angle Addition and Subtraction Identities|angle addition trigonometric identity]]. ## Reflections A function (or a set of points) can be reflected around both the $x$ and $y$ axes by applying the following transformations. Reflection around the $x$ axis: $ R(C) = \left[ \begin{matrix} 1 & 0 \\ 0 & -1 \end{matrix} \right]C $ Reflection around the $y$ axis: $ R(C) = \left[ \begin{matrix} -1 & 0 \\ 0 & 1 \end{matrix} \right]C $