Skip to main content
Mathematics LibreTexts

3.5: Transformation of Functions

  • Page ID
    170195
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Learning Objectives

    • Graph functions using vertical and horizontal shifts.
    • Graph functions using reflections about the x-axis and the y-axis.
    • Graph functions using compressions and stretches.
    • Combine transformations.
    • Determine whether a function is even, odd, or neither. 

    Often when given a problem, we try to model the scenario using mathematics in the form of words, tables, graphs, and equations. One method we can employ is to adapt the basic graphs of the toolkit or "parent" functions to build new models for a given scenario. There are systematic ways to alter functions to construct appropriate models for the problems we are trying to solve.

    Parent Functions

    In this text, we will be exploring functions—the shapes of their graphs, their unique characteristics, their algebraic formulas, and how to solve problems with them. When learning to read, we start with the alphabet. When learning to do arithmetic, we start with numbers. When working with functions, it is similarly helpful to have a base set of building-block elements. We call these our “toolkit functions,” which form a set of basic named functions for which we know the graph, formula, and special properties. Some of these functions are programmed to individual buttons on many calculators. For these definitions we will use x as the input variable and \(y=f(x)\) as the output variable.

    We will see these toolkit functions, combinations of toolkit functions, their graphs, and their transformations frequently throughout this book. It will be very helpful if we can recognize these toolkit functions and their features quickly by name, formula, graph, and basic table properties. The graphs and sample table values are included with each function shown in Table \(\PageIndex{14}\).

    Table \(\PageIndex{14}\): Toolkit Functions
    Name Function Graph
    Constant \(f(x)=c\) where \(c\) is a constant alt
    Identity \(f(x)=x\) alt
    Absolute Value \(f(x)=|x|\) alt
    Quadratic \(f(x)=x^2\) alt
    Cubic \(f(x)=x^3\) alt
    reciprocal \(f(x)=\dfrac{1}{x}\) alt
    Reciprocal squared \(f(x)=\dfrac{1}{x^2}\) alt
    Square root \(f(x)=\sqrt{x}\) alt
    Cube root \(f(x)=\sqrt[3]{x}\) alt

    Identifying Vertical Shifts

    One simple kind of transformation involves shifting the entire graph of a function up, down, right, or left. The simplest shift is a vertical shift, moving the graph up or down, because this transformation involves adding a positive or negative constant to the function. In other words, we add the same constant to the output value of the function regardless of the input. For a function \(g(x)=f(x)+k\), the function \(f(x)\) is shifted vertically \(k\) units. See Figure \(\PageIndex{2}\) for an example.

    Vertical shift by k=1 of the cube root function f(x)=3√x.
    Figure \(\PageIndex{2}\): Vertical shift by \(k=1\) of the cube root function \(f(x)=\sqrt[3]{x}\).

    To help you visualize the concept of a vertical shift, consider that \(y=f(x)\). Therefore, \(f(x)+k\) is equivalent to \(y+k\). Every unit of \(y\) is replaced by \(y+k\), so the \(y\)-value increases or decreases depending on the value of \(k\). The result is a shift upward or downward.

    Definition: Vertical Shift

    Given a function \(f(x)\), a new function \(y=f(x)+k\), where \(k\) is a constant, is a vertical shift of the function \(f(x)\). All the output values change by \(k\) units. If \(k\) is positive, the graph will shift up. If \(k\) is negative, the graph will shift down.

    Example \(\PageIndex{2}\): Shifting a Tabular Function Vertically

    A function \(f(x)\) is given in Table \(\PageIndex{2}\). Create a table for the function \(g(x)=f(x)−3\).

    Table \(\PageIndex{2}\)
    \(x\) 2 4 6 8
    \(f(x)\) 1 3 7 11

    Solution

    The formula \(g(x)=f(x)−3\) tells us that we can find the output values of \(g\) by subtracting 3 from the output values of \(f\). For example:

    \[\begin{align*} f(x)&=1 &\text{Given} \\[4pt] g(x)&=f(x)-3 &\text{Given Transformation} \\[4pt] g(2) & =f(2)−3 \\ &=1-3\\ &=-2\end{align*}\]

    Subtracting 3 from each \(f(x)\) value, we can complete a table of values for \(g(x)\) as shown in Table \(\PageIndex{3}\).

    Table \(\PageIndex{3}\)
    \(x\) 2 4 6 8
    \(f(x)\) 1 3 7 11
    \(g(x)\) -2 0 4 8

    Analysis

    As with the earlier vertical shift, notice the input values stay the same and only the output values change.

    Exercise \(\PageIndex{1}\)

    The function \(h(t)=−4.9t^2+30t\) gives the height \(h\) of a ball (in meters) thrown upward from the ground after \(t\) seconds. Suppose the ball was instead thrown from the top of a 10-m building. Relate this new height function \(b(t)\) to \(h(t)\), and then find a formula for \(b(t)\).

    Answer

    \(b(t)=h(t)+10=−4.9t^2+30t+10\)

    Identifying Horizontal Shifts

    We just saw that the vertical shift is a change to the output, or outside, of the function. We will now look at how changes to input, on the inside of the function, change its graph and meaning. A shift to the input results in a movement of the graph of the function left or right in what is known as a horizontal shift, shown in Figure \(\PageIndex{4}\).

    alt
    Figure \(\PageIndex{4}\): Horizontal shift of the function \(f(x)=\sqrt[3]{x}\). Note that \(h=-1\) shifts the graph to the left, that is, towards negative values of \(x\).

    For example, if \(f(x)=x^2\), then \(g(x)=(x−2)^2\) is a new function. Each input is reduced by 2 prior to squaring the function. The result is that the graph is shifted 2 units to the right, because we would need to increase the prior input by 2 units to yield the same output value as given in \(f\).

    Definition: Horizontal Shift

    Given a function \(f\), a new function \(y=f(x−h)\), where \(h\) is a constant, is a horizontal shift of the function \(f\). If \(h\) is positive, the graph will shift right. If \(h\) is negative, the graph will shift left.

    Example \(\PageIndex{5}\): Shifting a Tabular Function Horizontally

    A function \(f(x)\) is given in Table \(\PageIndex{4}\). Create a table for the function \(g(x)=f(x−3)\).

    Table \(\PageIndex{4}\)
    \(x\) 2 4 6 8
    \(f(x)\) 1 3 7 11

    Solution

    The formula \(g(x)=f(x−3)\) tells us that the output values of \(g\) are the same as the output value of \(f\) when the input value is 3 less than the original value. For example, we know that \(f(2)=1\). To get the same output from the function \(g\), we will need an input value that is 3 larger. We input a value that is 3 larger for \(g(x)\) because the function takes 3 away before evaluating the function \(f\).

    \[\begin{align*} g(5)&=f(5-3) \\ &=f(2) \\ &=1 \end{align*}\]

    We continue with the other values to create Table \(\PageIndex{5}\).

    Table \(\PageIndex{5}\)
    \(x\) 5 7 9 11
    \(x-3\) 2 4 6 8
    \(f(x)\) 1 3 7 11
    \(g(x)\) 1 3 7 11

    The result is that the function \(g(x)\) has been shifted to the right by 3. Notice the output values for \(g(x)\) remain the same as the output values for \(f(x)\), but the corresponding input values, \(x\), have shifted to the right by 3. Specifically, 2 shifted to 5, 4 shifted to 7, 6 shifted to 9, and 8 shifted to 11.

    Analysis

    Figure \(\PageIndex{6}\) represents both of the functions. We can see the horizontal shift in each point.

    Graph of the points from the previous table for f(x) and g(x)=f(x-3)
    Figure \(\PageIndex{6}\): Graph of the points from the previous table for \(f(x)\) and \(g(x)=f(x-3)\)

    Example \(\PageIndex{6}\): Identifying a Horizontal Shift of a Toolkit Function

    Figure \(\PageIndex{7}\) represents a transformation of the toolkit function \(f(x)=x^2\). Relate this new function \(g(x)\) to \(f(x)\), and then find a formula for \(g(x)\).

    Graph of a parabola
    Figure \(\PageIndex{7}\): Graph of a parabola

    Solution

    Notice that the graph is identical in shape to the \(f(x)=x^2\) function, but the \(x\)-values are shifted to the right 2 units. The vertex used to be at \((0,0)\), but now the vertex is at \((2,0)\). The graph is the basic quadratic function shifted 2 units to the right, so

    \[g(x)=f(x−2) \nonumber\]

    Notice how we must input the value \(x=2\) to get the output value \(y=0\); the \(x\)-values must be 2 units larger because of the shift to the right by 2 units. We can then use the definition of the \(f(x)\) function to write a formula for \(g(x)\) by evaluating \(f(x−2)\).

    \[\begin{align*} f(x)&=x^2 \\ g(x)&=f(x-2) \\ g(x)&=f(x-2)=(x-2)^2 \end{align*}\]

    Analysis

    To determine whether the shift is \(+2\) or \(−2\), consider a single reference point on the graph. For a quadratic, looking at the vertex point is convenient. In the original function, \(f(0)=0\). In our shifted function, \(g(2)=0\). To obtain the output value of 0 from the function \(f\), we need to decide whether a plus or a minus sign will work to satisfy \(g(2)=f(x−2)=f(0)=0\). For this to work, we will need to subtract 2 units from our input values.

    Exercise \(\PageIndex{7}\)

    Given the function \(f(x)=\sqrt{x}\), graph the original function \(f(x)\) and the transformation \(g(x)=f(x+2)\) on the same axes. Is this a horizontal or a vertical shift? Which way is the graph shifted and by how many units?

    Answer

    The graphs of \(f(x)\) and \(g(x)\) are shown below. The transformation is a horizontal shift. The function is shifted to the left by 2 units.

    Graph of a square root function and a horizontally shift square foot function.
    Figure \(\PageIndex{8}\)

    Combining Vertical and Horizontal Shifts

    Now that we have two transformations, we can combine them together. Vertical shifts are outside changes that affect the output \((y-)\) axis values and shift the function up or down. Horizontal shifts are inside changes that affect the input \((x-)\) axis values and shift the function left or right. Combining the two types of shifts will cause the graph of a function to shift up or down and right or left.

    How To...

    Given a function and both a vertical and a horizontal shift, sketch the graph.

    1. Identify the vertical and horizontal shifts from the formula.
    2. The vertical shift results from a constant added to the output. Move the graph up for a positive constant and down for a negative constant.
    3. The horizontal shift results from a constant added to the input. Move the graph left for a positive constant and right for a negative constant.
    4. Apply the shifts to the graph in either order.

    Example \(\PageIndex{8}\): Graphing Combined Vertical and Horizontal Shifts

    Given \(f(x)=|x|\), sketch a graph of \(y=f(x+1)−3\).

    Solution

    The function \(f\) is our toolkit absolute value function. We know that this graph has a V shape, with the point at the origin. The graph of \(y=f(x+1)-3\) has transformed \(f\) in two ways: \(f(x+1)\) is a change on the inside of the function, giving a horizontal shift left by 1, and the subtraction by 3 in \(f(x+1)−3\) is a change to the outside of the function, giving a vertical shift down by 3. The transformation of the graph is illustrated in Figure \(\PageIndex{9}\).

    Let us follow one point of the graph of \(f(x)=|x|\).

    • The point \((0,0)\) is transformed first by shifting left 1 unit:\((0,0)\rightarrow(−1,0)\)
    • The point \((−1,0)\) is transformed next by shifting down 3 units:\((−1,0)\rightarrow(−1,−3)\)
    Graph of an absolute function, \(y=|x|\), and how it was transformed to \(y=|x+1|-3\)
    Figure \(\PageIndex{9}\): Graph of an absolute function, \(y=|x|\), and how it was transformed to \(y=|x+1|-3\)

    Figure \(\PageIndex{10}\) shows the graph of \(h\).

    The final function \(y=|x+1|-3\).
    Figure \(\PageIndex{10}\): The final function \(y=|x+1|-3\).

    Example \(\PageIndex{9}\): Identifying Combined Vertical and Horizontal Shifts

    Write a formula for the graph shown in Figure \(\PageIndex{12}\), which is a transformation of the toolkit square root function.

    Graph of a square root function transposed right one unit and up 2.
    Figure \(\PageIndex{12}\): Graph of a square root function transposed right one unit and up 2.

    Solution

    The graph of the toolkit function starts at the origin, so this graph has been shifted 1 to the right and up 2. In function notation, we could write that as

    \[h(x)=f(x−1)+2 \nonumber\]

    Using the formula for the square root function, we can write

    \[h(x)=\sqrt{x−1}+2 \nonumber\]

    Analysis

    Note that this transformation has changed the domain and range of the function. This new graph has domain \(\left[1,\infty\right)\) and range \(\left[2,\infty\right)\).

    Exercise \(\PageIndex{9}\)

    Write a formula for a transformation of the toolkit reciprocal function \(f(x)=\frac{1}{x}\) that shifts the function’s graph one unit to the right and one unit up.

    Answer

    \[g(x)=\dfrac{1}{x-1}+1 \nonumber \]

    Graphing Functions Using Reflections about the Axes

    Another transformation that can be applied to a function is a reflection over the x- or y-axis. A vertical reflection reflects a graph vertically across the x-axis, while a horizontal reflection reflects a graph horizontally across the y-axis. The reflections are shown in Figure \(\PageIndex{13}\).

    Graph of the vertical and horizontal reflection of a function..
    Figure \(\PageIndex{13}\): Graph of the vertical and horizontal reflection of a function.

    Notice that the vertical reflection produces a new graph that is a mirror image of the base or original graph about the x-axis. The horizontal reflection produces a new graph that is a mirror image of the base or original graph about the y-axis.

    Definitions: Reflections

    Given a function \(f(x)\), a new function \(y=−f(x)\) is a vertical reflection of the function \(f(x)\), called a reflection about (or over, or across) the \(x\)-axis.

    Given a function \(f(x)\), a new function \(y=f(−x)\) is a horizontal reflection of the function \(f(x)\), called a reflection about the \(y\)-axis.

    How To...

    Given a function, reflect the graph both vertically and horizontally.

    1. Multiply all outputs by –1 for a vertical reflection. The new graph is a reflection of the original graph about the x-axis.
    2. Multiply all inputs by –1 for a horizontal reflection. The new graph is a reflection of the original graph about the y-axis.

    Example \(\PageIndex{10}\): Reflecting a Graph Horizontally and Vertically

    Reflect the graph of \(s(t)=\sqrt{t}\) (a) vertically and (b) horizontally.

    Solution

    a. Reflecting the graph vertically means that each output value will be reflected over the horizontal t-axis as shown in Figure \(\PageIndex{14}\).

    Graph of the vertical reflection of the square root function.
    Figure \(\PageIndex{14}\): Graph of the vertical reflection of the square root function.

    Because each output value is the opposite of the original output value, we can write

    \[V(t)=−s(t) \text{ or } V(t)=−\sqrt{t} \nonumber\]

    Notice that this is an outside change, or vertical shift, that affects the output \(s(t)\) values, so the negative sign belongs outside of the function.

    b. Reflecting horizontally means that each input value will be reflected over the vertical axis as shown in Figure \(\PageIndex{15}\).

    Graph of the horizontal reflection of the square root function.
    Figure \(\PageIndex{15}\): Horizontal reflection of the square root function

    Because each input value is the opposite of the original input value, we can write

    \[H(t)=s(−t) \text{ or } H(t)=\sqrt{−t} \nonumber\]

    Notice that this is an inside change or horizontal change that affects the input values, so the negative sign is on the inside of the function.

    Note that these transformations can affect the domain and range of the functions. While the original square root function has domain \(\left[0,\infty\right)\) and range \(\left[0,\infty\right)\), the vertical reflection gives the \(V(t)\) function the range \(\left(−\infty,0\right]\) and the horizontal reflection gives the \(H(t)\) function the domain \(\left(−\infty, 0\right]\).

    Exercise \(\PageIndex{5}\)

    Reflect the graph of \(f(x)=|x−1|\) (a) vertically and (b) horizontally.

    Answer

    a.

    Graph of a vertically reflected absolute function.
    Figure \(\PageIndex{16}\): Graph of a vertically reflected absolute function.

    b.

    Graph of an absolute function translated one unit left.
    Figure \(\PageIndex{17}\): Graph of an absolute function translated one unit left.

    Example \(\PageIndex{11}\): Reflecting a Tabular Function Horizontally and Vertically

    A function \(f(x)\) is given as Table \(\PageIndex{6}\). Create a table for the functions below.

    a. \(g(x)=−f(x)\)
    b. \(h(x)=f(−x)\)

    Table \(\PageIndex{6}\)
    \(x\) 2 4 6 8
    \(f(x)\) 1 3 7 11

    a. For \(g(x)\), the negative sign outside the function indicates a vertical reflection, so the x-values stay the same and each output value will be the opposite of the original output value. See Table \(\PageIndex{7}\).

    Table \(\PageIndex{7}\)
    \(x\) 2 4 6 8
    \(g(x)\) -1 -3 -7 -11

    b. For \(h(x)\), the negative sign inside the function indicates a horizontal reflection, so each input value will be the opposite of the original input value and the \(h(x)\) values stay the same as the \(f(x)\) values. See Table \(\PageIndex{8}\).

    Table \(\PageIndex{8}\)
    \(x\) -2 -4 -6 -8
    \(h(x)\) 1 3 7 11

    Exercise \(\PageIndex{6}\)

    A function \(f(x)\) is given as Table \(\PageIndex{9}\). Create a table for the functions below.

    a. \(g(x)=−f(x)\)
    b. \(h(x)=f(−x)\)

    Table \(\PageIndex{9}\)
    \(x\) -2 0 2 4
    \(f(x)\) 5 10 15 20
    Answer

    a. \(g(x)=−f(x)\)

    Table \(\PageIndex{10}\)
    \(x\) -2 0 2 4
    \(g(x)\) -5 -10 -15 -20

    b. \(h(x)=f(−x)\)

    Table \(\PageIndex{11}\)
    \(x\) -2 0 2 -4
    \(h(x)\) 15 10 5 20

    Exercise \(\PageIndex{7}\)

    Given the toolkit function \(f(x)=x^2\), graph \(g(x)=−f(x)\) and \(h(x)=f(−x)\). Take note of any surprising behavior for these functions.

    Answer
    Graph of x^2 and its reflections.
    Figure \(\PageIndex{20}\): Graph of \(x^2\) and its reflections.

    Notice: \(g(x)=f(−x)\) looks the same as \(f(x)\).

    Graphing Functions Using Stretches and Compressions

    Adding a constant to the inputs or outputs of a function changed the position of a graph with respect to the axes, but it did not affect the shape of a graph. We now explore the effects of multiplying the inputs or outputs by some quantity.

    We can transform the inside (input values) of a function or we can transform the outside (output values) of a function. Each change has a specific effect that can be seen graphically.

    Vertical Stretches and Compressions

    When we multiply a function by a positive constant, we get a function whose graph is stretched or compressed vertically in relation to the graph of the original function. If the constant is greater than 1, we get a vertical stretch; if the constant is between 0 and 1, we get a vertical compression. Figure \(\PageIndex{23}\) shows a function multiplied by constant factors 2 and 0.5 and the resulting vertical stretch and compression.

    Graph of a function that shows vertical stretching and compression.
    Figure \(\PageIndex{23}\): Vertical stretch and compression

    Definitions: Vertical Stretches and Compressions

    Given a function \(f(x)\), a new function \(g(x)=cf(x)\), where \(c\) is a constant, is a vertical stretch or vertical compression of the function \(f(x)\).

    • If \(c>1\), then the graph will be stretched vertically by a factor of \(c\)
    • If \(0<c<1\), then the graph will be compressed vertically by a factor of \(\frac{1}{c}\)
    • If \(c<0\), then there will be combination of a vertical stretch or compression with a vertical reflection.

    How To...

    Given a function, graph its vertical stretch.

    1. Identify the value of \(c\).
    2. Multiply all range values by \(c\)
    3. If \(c>1\), the graph is stretched by a factor of \(c\).
    4. If \(0<c<1\), the graph is compressed by a factor of \(c\).
    5. If \(c<0\), the graph is either stretched or compressed and also reflected about the x-axis.

    Exercise \(\PageIndex{9}\)

    A function \(f\) is given as Table \(\PageIndex{14}\). Create a table for the function \(g(x)=\frac{3}{4}f(x)\).

    Table \(\PageIndex{14}\)
    \(x\) 2 4 6 8
    \(f(x)\) 12 16 20 0
    Answer
    Table \(\PageIndex{15}\)
    \(x\) 2 4 6 8
    \(g(x)\) 9 12 15 0

    Example \(\PageIndex{16}\): Recognizing a Vertical Stretch

    The graph in Figure \(\PageIndex{26}\) is a transformation of the toolkit function \(f(x)=x^3\). Relate this new function \(g(x)\) to \(f(x)\), and then find a formula for \(g(x)\).

    [Graph of a transformation of \(f(x)=x^3\)
    Figure \(\PageIndex{26}\): Graph of a transformation of \(f(x)=x^3\)

    When trying to determine a vertical stretch or shift, it is helpful to look for a point on the graph that is relatively clear. In this graph, it appears that \(g(2)=2\). With the basic cubic function at the same input, \(f(2)=2^3=8\). Based on that, it appears that the outputs of \(g\) are \(\frac{1}{4}\) the outputs of the function \(f\) because \(g(2)=\frac{1}{4}f(2)\). From this we can fairly safely conclude that \(g(x)=\frac{1}{4}f(x)\).

    We can write a formula for \(g\) by using the definition of the function \(f\).

    \[g(x)=\frac{1}{4} f(x)=\frac{1}{4}x^3.\]

    Exercise \(\PageIndex{1}\)

    Write the formula for the function that we get when we stretch the identity toolkit function by a factor of 3, and then shift it down by 2 units.

    Answer

    \(g(x)=3x-2\)

    Horizontal Stretches and Compressions

    Now we consider changes to the inside of a function. When we multiply a function’s input by a positive constant, we get a function whose graph is stretched or compressed horizontally in relation to the graph of the original function. If the constant is between 0 and 1, we get a horizontal stretch; if the constant is greater than 1, we get a horizontal compression of the function.

    Graph of the vertical stretch and compression of x^2.
    Figure \(\PageIndex{27}\): Graph of the vertical stretch and compression of \(x^2\).

    Given a function \(y=f(x)\), the form \(y=f(bx)\) results in a horizontal stretch or compression. Consider the function \(y=x^2\). Observe Figure \(\PageIndex{27}\). The graph of \(y=(0.5x)^2\) is a horizontal stretch of the graph of the function \(y=x^2\) by a factor of 2. The graph of \(y=(2x)^2\) is a horizontal compression of the graph of the function \(y=x^2\) by a factor of 2.

    Definitions: Horizontal Stretches and Compressions

    Given a function \(f(x)\), a new function \(g(x)=f(cx)\), where \(c\) is a constant, is a horizontal stretch or horizontal compression of the function \(f(x)\).

    • If \(c>1\), then the graph will be compressed by a factor of \(c\).
    • If \(0<c<1\), then the graph will be stretched by a factor of \(\frac{1}{c}\).
    • If \(c<0\), then there will be combination of a horizontal stretch or compression with a horizontal reflection.

    How To...

    Given a description of a function, sketch a horizontal compression or stretch.

    1. Write a formula to represent the function.
    2. Set \(g(x)=f(cx)\) where \(c>1\) for a compression or \(0<c<1\) for a stretch.

    Example \(\PageIndex{19}\): Recognizing a Horizontal Compression on a Graph

    Relate the function \(g(x)\) to \(f(x)\) in Figure \(\PageIndex{30}\).

    Graph of \(f(x)\) being vertically compressed to \(g(x)\).
    Figure \(\PageIndex{30}\): Graph of \(f(x)\) being vertically compressed to \(g(x)\).

    Solution

    The graph of \(g(x)\) looks like the graph of \(f(x)\) horizontally compressed. Because \(f(x)\) ends at (6,4) and \(g(x)\) ends at (2,4), we can see that the x-values have been compressed by \(\frac{1}{3}\), because \(6(\frac{1}{3})=2\). We might also notice that \(g(2)=f(6)\) and \(g(1)=f(3)\). Either way, we can describe this relationship as \(g(x)=f(3x)\). This is a horizontal compression by \(\frac{1}{3}\).

    Analysis

    Notice that the coefficient needed for a horizontal stretch or compression is the reciprocal of the stretch or compression. So to stretch the graph horizontally by a scale factor of 4, we need a coefficient of \(\frac{1}{4}\) in our function: \(f(\frac{1}{4}x)\). This means that the input values must be four times larger to produce the same result, requiring the input to be larger, causing the horizontal stretching.

    Exercise \(\PageIndex{11}\)

    Write a formula for the toolkit square root function horizontally stretched by a factor of 3.

    Answer

    \(g(x)=f(\frac{1}{3}x)\), so using the square root function we get \(g(x)=\sqrt{\frac{1}{3}x}\)

    Performing a Sequence of Transformations

    When combining transformations, it is very important to consider the order of the transformations. For example, vertically shifting by 3 and then vertically stretching by 2 does not create the same graph as vertically stretching by 2 and then vertically shifting by 3, because when we shift first, both the original function and the shift get stretched, while only the original function gets stretched when we stretch first.

    When we see an expression such as \(2f(x)+3\), which transformation should we start with? The answer here follows nicely from the order of operations. Given the output value of \(f(x)\), we first multiply by 2, causing the vertical stretch, and then add 3, causing the vertical shift. In other words, multiplication before addition.

    Horizontal transformations are a little trickier to think about. When we write \(g(x)=f(2x+3)\), for example, we have to think about how the inputs to the function \(g\) relate to the inputs to the function \(f\). Suppose we know \(f(7)=12\). What input to \(g\) would produce that output? In other words, what value of \(x\) will allow \(g(x)=f(2x+3)=12?\) We would need \(2x+3=7\). To solve for \(x\), we would first subtract 3, resulting in a horizontal shift, and then divide by 2, causing a horizontal compression.

    This format ends up being very difficult to work with, because it is usually much easier to horizontally stretch a graph before shifting. We can work around this by factoring inside the function.

    \[f(bx+p)=f(b(x+\frac{p}{b})) \nonumber\]

    Let’s work through an example.

    \[f(x)=(2x+4)^2 \nonumber\]

    We can factor out a 2.

    \[f(x)=(2(x+2))^2 \nonumber\]

    Now we can more clearly observe a horizontal shift to the left 2 units and a horizontal compression. Factoring in this way allows us to horizontally stretch first and then shift horizontally.

    Combining Transformations: Order May Matter!
    • When combining a scalar and a vertical transformation of the form \(cf(x)+k\), first vertically stretch (or compress) and then vertically shift by \(k\).
    • When combining a scalar and a horizontal transformation of the form \(f(cx+h)\), first horizontally shift by \(h\) and then horizontally stretch (or compress).
    • When combining a scalar and a horizontal transformation of the form \(f(c(x+h))\), first horizontally stretch (or compress) and then horizontally shift by \(h\).
    • When combining a reflection and a vertical transformation of the form \(-f(x)+k\), first vertically reflect and then vertically shift by \(k\).
    • When combining a reflection and a horizontal transformation of the form \(f(-x+h)\), first horizontally shift by \(h\) and then horizontally reflect.
    • When combining a reflection and a horizontal transformation of the form \(f(-(x+h))\), first horizontally reflect and then horizontally shift by \(h\).
    • Horizontal and vertical transformations are independent. It does not matter whether horizontal or vertical transformations are performed first.

    Example \(\PageIndex{20}\): Finding a Triple Transformation of a Tabular Function

    Given Table \(\PageIndex{18}\) for the function \(f(x)\), create a table of values for the function \(g(x)=2f(3x)+1\).

    Table \(\PageIndex{18}\)
    \(x\) 6 12 18 24
    \(f(x)\) 10 14 15 17

    Solution

    There are three steps to this transformation, and we will work from the inside out. Starting with the horizontal transformations, \(f(3x)\) is a horizontal compression by \(\frac{1}{3}\), which means we multiply each \(x\)-value by \(\frac{1}{3}\).See Table \(\PageIndex{19}\).

    Table \(\PageIndex{19}\)
    \(x\) 2 4 6 8
    \(f(3x)\) 10 14 15 17

    Looking now to the vertical transformations, we start with the vertical stretch, which will multiply the output values by 2. We apply this to the previous transformation. See Table \(\PageIndex{20}\).

    Table \(\PageIndex{20}\)
    \(x\) 2 4 6 8
    \(2f(3x)\) 20 28 30 34

    Finally, we can apply the vertical shift, which will add 1 to all the output values. See Table \(\PageIndex{21}\).

    Table \(\PageIndex{21}\)
    \(x\) 2 4 6 8
    \(g(x)=2f(3x)+1+1\) 21 29 31 35

    Graphing an Absolute Value Function

    The most significant feature of the absolute value graph is the corner point at which the graph changes direction. This point is shown at the origin in Figure \(\PageIndex{3}\).

    Graph of an absolute function.
    Figure \(\PageIndex{3}\): Graph of an absolute function.

    Figure \(\PageIndex{3}\) shows the graph of \(y=2|x–3|+4\). The graph of \(y=|x|\) has been shifted right 3 units, vertically stretched by a factor of 2, and shifted up 4 units. This means that the corner point is located at \((3,4)\) for this transformed function.

    Graph of the different types of transformations for an absolute function.
    Figure \(\PageIndex{4}\): Graph of the different types of transformations for an absolute function.

    Example \(\PageIndex{3}\): Writing an Equation for an Absolute Value Function

    Write an equation for the function graphed in Figure \(\PageIndex{5}\).

    Graph of an absolute function.
    Figure \(\PageIndex{5}\): Graph of an absolute function.

    Solution

    The basic absolute value function changes direction at the origin, so this graph has been shifted to the right 3 units and down 2 units from the basic toolkit function. See Figure \(\PageIndex{6}\).

    Graph of two transformations for an absolute function at (3, -2)
    Figure \(\PageIndex{6}\): Graph of two transformations for an absolute function at \((3, -2)\).

    We also notice that the graph appears vertically stretched, because the width of the final graph on a horizontal line is not equal to 2 times the vertical distance from the corner to this line, as it would be for an unstretched absolute value function. Instead, the width is equal to 1 times the vertical distance as shown in Figure \(\PageIndex{7}\).

    alt
    Figure \(\PageIndex{7}\): Graph of two transformations for an absolute function at \((3, -2)\) and the ratios between the two different transformations.

    From this information we can write the equation

    \[\begin{align*} f(x)&=2|x-3|-2, \;\;\;\;\;\; \text{treating the stretch as a vertial stretch, or} \\ f(x)&=|2(x-3)|-2, \;\;\; \text{treating the stretch as a horizontal compression.} \end{align*}\]

    Analysis

    Note that these equations are algebraically equivalent—the stretch for an absolute value function can be written interchangeably as a vertical or horizontal stretch or compression.

    Q & A

    If we couldn’t observe the stretch of the function from the graphs, could we algebraically determine it?

    Answer

    Yes. If we are unable to determine the stretch based on the width of the graph, we can solve for the stretch factor by putting in a known pair of values for \(x\) and \(f(x)\).

    \[f(x)=a|x−3|−2 \nonumber\]

    Now substituting in the point \((1, 2)\)

    \[\begin{align*} 2&=a|1-3|-2 \\ 4&=2a \\ a&=2 \end{align*}\]

    Exercise \(\PageIndex{3}\)

    Write the equation for the absolute value function that is horizontally shifted left 2 units, then reflected about the \(x\) axis, and vertically shifted up 3 units.

    Answer

    \(f(x)=−| x+2 |+3\)

    Q & A

    Do the graphs of absolute value functions always intersect the vertical axis? The horizontal axis?

    Answer

    Yes, they always intersect the vertical axis. The graph of an absolute value function will intersect the vertical axis when the input is zero.

    No, they do not always intersect the horizontal axis. The graph may or may not intersect the horizontal axis, depending on how the graph has been shifted and reflected. It is possible for the absolute value function to intersect the horizontal axis at zero, one, or two points (Figure \(\PageIndex{8}\)).

    Graph of the different types of transformations for an absolute function.
    Figure \(\PageIndex{8}\): (a) The absolute value function does not intersect the horizontal axis. (b) The absolute value function intersects the horizontal axis at one point. (c) The absolute value function intersects the horizontal axis at two points.

    Determining Even and Odd Functions

    Some functions exhibit symmetry so that reflections result in the original graph. For example, horizontally reflecting the toolkit functions \(f(x)=x^2\) or \(f(x)=|x|\) will result in the original graph. We say that these types of graphs are symmetric about the y-axis. Functions whose graphs are symmetric about the y-axis are called even functions.

    If the graphs of \(f(x)=x^3\) or \(f(x)=\frac{1}{x}\) were reflected over both axes, the result would be the original graph, as shown in Figure \(\PageIndex{21}\).

    Graph of \(x^3\) and its reflections.
    Figure \(\PageIndex{21}\): (a) The cubic toolkit function (b) Horizontal reflection of the cubic toolkit function (c) Horizontal and vertical reflections reproduce the original cubic function.

    We say that these graphs are symmetric about the origin. A function with a graph that is symmetric about the origin is called an odd function.

    Note: A function can be neither even nor odd if it does not exhibit either symmetry. For example, \(f(x)=2^x\) is neither even nor odd. Also, the only function that is both even and odd is the constant function \(f(x)=0\).

    Definitions: Even and Odd Functions

    A function is called an even function if for every input \(x\)

    \(f(x)=f(−x)\)

    The graph of an even function is symmetric about the y-axis.

    A function is called an odd function if for every input \(x\)

    \(f(x)=−f(−x)\)

    The graph of an odd function is symmetric about the origin.

    How To...

    Given the formula for a function, determine if the function is even, odd, or neither.

    1. Determine whether the function satisfies \(f(x)=f(−x)\). If it does, it is even.
    2. Determine whether the function satisfies \(f(x)=−f(−x)\). If it does, it is odd.
    3. If the function does not satisfy either rule, it is neither even nor odd.

    Example \(\PageIndex{13}\): Determining whether a Function Is Even, Odd, or Neither

    Is the function \(f(x)=x^3+2x\) even, odd, or neither?

    Solution

    Without looking at a graph, we can determine whether the function is even or odd by finding formulas for the reflections and determining if they return us to the original function. Let’s begin with the rule for even functions.

    \[f(−x)=(−x)^3+2(−x)=−x^3−2x \nonumber\]

    This does not return us to the original function, so this function is not even. We can now test the rule for odd functions.

    \[−f(−x)=−(−x^3−2x)=x^3+2x \nonumber\]

    Because \(−f(−x)=f(x)\), this is an odd function.

    Analysis

    Consider the graph of \(f\) in Figure \(\PageIndex{22}\). Notice that the graph is symmetric about the origin. For every point \((x,y)\) on the graph, the corresponding point \((−x,−y)\) is also on the graph. For example, \((1, 3)\) is on the graph of \(f\), and the corresponding point \((−1,−3)\) is also on the graph.

    Graph of \(f(x)\) with labeled points at \((1, 3)\) and \((-1, -3)\)
    Figure \(\PageIndex{22}\): Graph of \(f(x)\) with labeled points at \((1, 3)\) and \((-1, -3)\).

    Exercise \(\PageIndex{8}\)

    Is the function \(f(s)=s^4+3s^2+7\) even, odd, or neither?

    Answer

    even

    Key Equations

    • Vertical shift \(y=f(x)+k\) (up for \(k>0\))
    • Horizontal shift \(y=f(x−h)\)(right) for \(h>0\)
    • Vertical reflection \(y=−f(x)\)
    • Horizontal reflection \(y=f(−x)\)
    • Vertical stretch \(y=cf(x)\) (c>0 )
    • Vertical compression \(y=cf(x)\) (0<c<1)
    • Horizontal stretch \(y=f(cx)(0<c<1)\)
    • Horizontal compression \(y=f(cx)\) (c>1)

    Key Concepts

    • A function can be shifted vertically by adding a constant to the output.
    • A function can be shifted horizontally by adding a constant to the input.
    • Relating the shift to the context of a problem makes it possible to compare and interpret vertical and horizontal shifts.
    • Vertical and horizontal shifts are often combined.
    • A vertical reflection reflects a graph about the x-axis. A graph can be reflected vertically by multiplying the output by –1.
    • A horizontal reflection reflects a graph about the y-axis. A graph can be reflected horizontally by multiplying the input by –1.
    • A graph can be reflected both vertically and horizontally. The order in which the reflections are applied does not affect the final graph.
    • A function presented in tabular form can also be reflected by multiplying the values in the input and output rows or columns accordingly.
    • A function presented as an equation can be reflected by applying transformations one at a time.
    • Even functions are symmetric about the y-axis, whereas odd functions are symmetric about the origin.
    • Even functions satisfy the condition \(f(x)=f(−x)\).
    • Odd functions satisfy the condition \(-f(x)=f(−x)\).
    • A function can be odd, even, or neither.
    • A function can be compressed or stretched vertically by multiplying the output by a constant.
    • A function can be compressed or stretched horizontally by multiplying the input by a constant.
    • The order in which different transformations are applied does affect the final function. Both vertical and horizontal transformations must be applied in the order given. However, a vertical transformation may be combined with a horizontal transformation in any order.

    Glossary

    even function

    a function whose graph is unchanged by horizontal reflection, \(f(x)=f(−x)\), and is symmetric about the y-axis

    horizontal compression
    a transformation that compresses a function’s graph horizontally, by multiplying the input by a constant c>1

    horizontal reflection
    a transformation that reflects a function’s graph across the y-axis by multiplying the input by −1

    horizontal shift
    a transformation that shifts a function’s graph left or right by adding a positive or negative constant to the input

    horizontal stretch
    a transformation that stretches a function’s graph horizontally by multiplying the input by a constant 0<c<1

    odd function
    a function whose graph is unchanged by combined horizontal and vertical reflection, \(-f(x)=f(−x)\), and is symmetric about the origin

    vertical compression
    a function transformation that compresses the function’s graph vertically by multiplying the output by a constant 0<c<1

    vertical reflection
    a transformation that reflects a function’s graph across the x-axis by multiplying the output by −1

    vertical shift
    a transformation that shifts a function’s graph up or down by adding a positive or negative constant to the output

    vertical stretch
    a transformation that stretches a function’s graph vertically by multiplying the output by a constant c>1


    This page titled 3.5: Transformation of Functions is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Leif Jordan (College of the Desert) via source content that was edited to the style and standards of the LibreTexts platform.