3.5 Transformation of Functions

Figure 1 (credit: “Misko”/Flickr)
We all know that a flat mirror enables us to see an accurate image of ourselves and whatever is behind us. When we tilt the mirror, the images we see may shift horizontally or vertically. But what happens when we bend a flexible mirror? Like a carnival funhouse mirror, it presents us with a distorted image of ourselves, stretched or compressed horizontally or vertically. In a similar way, we can distort or transform mathematical functions to better adapt them to describing objects or processes in the real world. In this section, we will take a look at several kinds of transformations.
3.5.1 Graphing Functions Using Vertical and Horizontal Shifts
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 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.
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 2 for an example.

Figure 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.
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 5.

Figure 5 Horizontal shift of the function \(f(x) = \sqrt[3]{x}.\) Note that \((x + 1)\) means \(h = –1\), which 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.\)
Combining Vertical and Horizontal Shifts
Now that we have two transformations, we can combine them. Vertical shifts are outside changes that affect the output (\(y\)-) values and shift the function up or down. Horizontal shifts are inside changes that affect the input (\(x\)-) 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 left or right.
3.5.2 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 12.

Figure 12 Vertical and horizontal reflections 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.
3.5.3 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. A function whose graph is symmetric about the \(y\)-axis is called an even function.
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 17.

Figure 17 (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.\)
3.5.4 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 avertical compression. Figure 19 shows a function multiplied by constant factors 2 and 0.5 and the resulting vertical stretch and compression.

Figure 19 Vertical stretch and compression
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.

Figure 23
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 23. The graph of \(y = \left( {0.5x} \right)^{2}\) is a horizontal stretch of the graph of the function \(y = x^{2}\) by a factor of 2. The graph of \(y = \left( {2x} \right)^{2}\) is a horizontal compression of the graph of the function \(y = x^{2}\) by a factor of \(2\).
3.5.5 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\left( {b\left( {x + \frac{p}{b}} \right)} \right)\]
Let’s work through an example.
\[f(x) = \left( {2x + 4} \right)^{2}\]
We can factor out a 2.
\[f(x) = \left( {2\left( {x + 2} \right)} \right)^{2}\]
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.
Section Exercises
Verbal
1. When examining the formula of a function that is the result of multiple transformations, how can you tell a horizontal shift from a vertical shift?
Solution (click to reveal)
A horizontal shift results when a constant is added to or subtracted from the input. A vertical shifts results when a constant is added to or subtracted from the output.
2. When examining the formula of a function that is the result of multiple transformations, how can you tell a horizontal stretch from a vertical stretch?
3. When examining the formula of a function that is the result of multiple transformations, how can you tell a horizontal compression from a vertical compression?
Solution (click to reveal)
A horizontal compression results when a constant greater than 1 is multiplied by the input. A vertical compression results when a constant between 0 and 1 is multiplied by the output.
4. When examining the formula of a function that is the result of multiple transformations, how can you tell a reflection with respect to the \(x\)-axis from a reflection with respect to the \(y\)-axis?
5. How can you determine whether a function is odd or even from the formula of the function?
Solution (click to reveal)
For a function \(f,\) substitute \(( - x)\) for \((x)\) in \(f(x).\) Simplify. If the resulting function is the same as the original function, \(f( - x) = f(x),\) then the function is even. If the resulting function is the opposite of the original function, \(f( - x) = - f(x),\) then the original function is odd. If the function is not the same or the opposite, then the function is neither odd nor even.
Algebraic
For the following exercises, write a formula for the function obtained when the graph is shifted as described.
6. \(f(x) = \sqrt{x}\) is shifted up 1 unit and to the left 2 units.
7. \(f(x) = |x|\) is shifted down 3 units and to the right 1 unit.
Solution (click to reveal)
\(\left. g(x) = \middle| x - 1 \middle| - 3 \right.\)
8. \(f(x) = \frac{1}{x}\) is shifted down 4 units and to the right 3 units.
9. \(f(x) = \frac{1}{x^{2}}\) is shifted up 2 units and to the left 4 units.
Solution (click to reveal)
\(g(x) = \frac{1}{{(x + 4)}^{2}} + 2\)
For the following exercises, describe how the graph of the function is a transformation of the graph of the original function \(f.\)
10. \(y = f(x - 49)\)
11. \(y = f(x + 43)\)
Solution (click to reveal)
The graph of \(f(x + 43)\) is a horizontal shift to the left 43 units of the graph of \(f.\)
12. \(y = f(x + 3)\)
13. \(y = f(x - 4)\)
Solution (click to reveal)
The graph of \(f(x - 4)\) is a horizontal shift to the right 4 units of the graph of \(f.\)
14. \(y = f(x) + 5\)
15. \(y = f(x) + 8\)
Solution (click to reveal)
The graph of \(f(x) + 8\) is a vertical shift up 8 units of the graph of \(f.\)
16. \(y = f(x) - 2\)
17. \(y = f(x) - 7\)
Solution (click to reveal)
The graph of \(f(x) - 7\) is a vertical shift down 7 units of the graph of \(f.\)
18. \(y = f(x - 2) + 3\)
19. \(y = f(x + 4) - 1\)
Solution (click to reveal)
The graph of \(f(x + 4) - 1\) is a horizontal shift to the left 4 units and a vertical shift down 1 unit of the graph of \(f.\)
For the following exercises, determine the interval(s) on which the function is increasing and decreasing.
20. \(f(x) = 4{(x + 1)}^{2} - 5\)
21. \(g(x) = 5{(x + 3)}^{2} - 2\)
Solution (click to reveal)
decreasing on \(( - \infty, - 3)\) and increasing on \(( - 3,\infty)\)
22. \(a(x) = \sqrt{- x + 4}\)
23. \(k(x) = - 3\sqrt{x} - 1\)
Solution (click to reveal)
decreasing on \((0,\mspace{9mu}\infty)\)
Graphical
For the following exercises, use the graph of \(f(x) = 2^{x}\) shown in Figure 31 to sketch a graph of each transformation of \(f(x).\)

Figure 31
24. \(g(x) = 2^{x} + 1\)
25. \(h(x) = 2^{x} - 3\)
Solution (click to reveal)

26. \(w(x) = 2^{x - 1}\)
For the following exercises, sketch a graph of the function as a transformation of the graph of one of the toolkit functions.
27. \(f(t) = {(t + 1)}^{2} - 3\)
Solution (click to reveal)

28. \(\left. h(x) = \middle| x - 1 \middle| + 4 \right.\)
29. \(k(x) = {(x - 2)}^{3} - 1\)
Solution (click to reveal)

30. \(m(t) = 3 + \sqrt{t + 2}\)
Numeric
31. Tabular representations for the functions \(f,\mspace{9mu} g,\) and \(h\) are given below. Write \(g(x)\) and \(h(x)\) as transformations of \(f(x).\)
| \(x\) | −2 | −1 | 0 | 1 | 2 |
| \(f(x)\) | −2 | −1 | −3 | 1 | 2 |
| \(x\) | −1 | 0 | 1 | 2 | 3 |
| \(g(x)\) | −2 | −1 | −3 | 1 | 2 |
| \(x\) | −2 | −1 | 0 | 1 | 2 |
| \(h(x)\) | −1 | 0 | −2 | 2 | 3 |
Solution (click to reveal)
\(g(x) = f(x - 1),\mspace{9mu} h(x) = f(x) + 1\)
32. Tabular representations for the functions \(f,\mspace{9mu} g,\) and \(h\) are given below. Write \(g(x)\) and \(h(x)\) as transformations of \(f(x).\)
| \(x\) | −2 | −1 | 0 | 1 | 2 |
| \(f(x)\) | −1 | −3 | 4 | 2 | 1 |
| \(x\) | −3 | −2 | −1 | 0 | 1 |
| \(g(x)\) | −1 | −3 | 4 | 2 | 1 |
| \(x\) | −2 | −1 | 0 | 1 | 2 |
| \(h(x)\) | −2 | −4 | 3 | 1 | 0 |
For the following exercises, write an equation for each graphed function by using transformations of the graphs of one of the toolkit functions.
33.

Solution (click to reveal)
\(\left. f(x) = \middle| x - 3 \middle| - 2 \right.\)
34.

35.

Solution (click to reveal)
\(f(x) = \sqrt{x + 3} - 1\)
36.

37.

Solution (click to reveal)
\(f(x) = {(x - 2)}^{2}\)
38.

39.

Solution (click to reveal)
\(\left. f(x) = \middle| x + 3 \middle| - 2 \right.\)
40.

For the following exercises, use the graphs of transformations of the square root function to find a formula for each of the functions.
41.

Solution (click to reveal)
\(f(x) = - \sqrt{x}\)
42.

For the following exercises, use the graphs of the transformed toolkit functions to write a formula for each of the resulting functions.
43.

Solution (click to reveal)
\(f(x) = - {(x + 1)}^{2} + 2\)
44.

45.

Solution (click to reveal)
\(f(x) = \sqrt{- x} + 1\)
46.

For the following exercises, determine whether the function is odd, even, or neither.
47. \(f(x) = 3x^{4}\)
Solution (click to reveal)
even
48. \(g(x) = \sqrt{x}\)
49. \(h(x) = \frac{1}{x} + 3x\)
Solution (click to reveal)
odd
50. \(f(x) = {(x - 2)}^{2}\)
51. \(g(x) = 2x^{4}\)
Solution (click to reveal)
even
52. \(h(x) = 2x - x^{3}\)
For the following exercises, describe how the graph of each function is a transformation of the graph of the original function \(f.\)
53. \(g(x) = - f(x)\)
Solution (click to reveal)
The graph of \(g\) is a vertical reflection (across the \(x\) -axis) of the graph of \(f.\)
54. \(g(x) = f( - x)\)
55. \(g(x) = 4f(x)\)
Solution (click to reveal)
The graph of \(g\) is a vertical stretch by a factor of 4 of the graph of \(f.\)
56. \(g(x) = 6f(x)\)
57. \(g(x) = f(5x)\)
Solution (click to reveal)
The graph of \(g\) is a horizontal compression by a factor of \(\frac{1}{5}\) of the graph of \(f.\)
58. \(g(x) = f(2x)\)
59. \(g(x) = f\left( {\frac{1}{3}x} \right)\)
Solution (click to reveal)
The graph of \(g\) is a horizontal stretch by a factor of 3 of the graph of \(f.\)
60. \(g(x) = f\left( {\frac{1}{5}x} \right)\)
61. \(g(x) = 3f\left( {- x} \right)\)
Solution (click to reveal)
The graph of \(g\) is a horizontal reflection across the \(y\) -axis and a vertical stretch by a factor of 3 of the graph of \(f.\)
62. \(g(x) = - f(3x)\)
For the following exercises, write a formula for the function \(g\) that results when the graph of a given toolkit function is transformed as described.
63. The graph of \(\left. f(x) = \middle| x \right|\) is reflected over the \(y\) -axis and horizontally compressed by a factor of \(\frac{1}{4}\) .
Solution (click to reveal)
\(\left. g(x) = \middle| - 4x \right|\)
64. The graph of \(f(x) = \sqrt{x}\) is reflected over the \(x\) -axis and horizontally stretched by a factor of 2.
65. The graph of \(f(x) = \frac{1}{x^{2}}\) is vertically compressed by a factor of \(\frac{1}{3},\) then shifted to the left 2 units and down 3 units.
Solution (click to reveal)
\(g(x) = \frac{1}{3{(x + 2)}^{2}} - 3\)
66. The graph of \(f(x) = \frac{1}{x}\) is vertically stretched by a factor of 8, then shifted to the right 4 units and up 2 units.
67. The graph of \(f(x) = x^{2}\) is vertically compressed by a factor of \(\frac{1}{2},\) then shifted to the right 5 units and up 1 unit.
Solution (click to reveal)
\(g(x) = \frac{1}{2}{(x - 5)}^{2} + 1\)
68. The graph of \(f(x) = x^{2}\) is horizontally stretched by a factor of 3, then shifted to the left 4 units and down 3 units.
For the following exercises, describe how the formula is a transformation of a toolkit function. Then sketch a graph of the transformation.
69. \(g(x) = 4{(x + 1)}^{2} - 5\)
Solution (click to reveal)
The graph of the function \(f(x) = x^{2}\) is shifted to the left 1 unit, stretched vertically by a factor of 4, and shifted down 5 units.

70. \(g(x) = 5{(x + 3)}^{2} - 2\)
71. \(\left. h(x) = - 2 \middle| x - 4 \middle| + 3 \right.\)
Solution (click to reveal)
The graph of \(\left. f(x) = \middle| x \right|\) is stretched vertically by a factor of 2, shifted horizontally 4 units to the right, reflected across the horizontal axis, and then shifted vertically 3 units up.

72. \(k(x) = - 3\sqrt{x} - 1\)
73. \(m(x) = \frac{1}{2}x^{3}\)
Solution (click to reveal)
The graph of the function \(f(x) = x^{3}\) is compressed vertically by a factor of \(\frac{1}{2}.\)

74. \(\left. n(x) = \frac{1}{3} \middle| x - 2 \right|\)
75. \(p(x) = \left( {\frac{1}{3}x} \right)^{3} - 3\)
Solution (click to reveal)
The graph of the function is stretched horizontally by a factor of 3 and then shifted vertically downward by 3 units.

76. \(q(x) = \left( {\frac{1}{4}x} \right)^{3} + 1\)
77. \(a(x) = \sqrt{- x + 4}\)
Solution (click to reveal)
The graph of \(f(x) = \sqrt{x}\) is reflected across the \(y\)-axis and then shifted right 4 units.

For the following exercises, use the graph in Figure 32 to sketch the given transformations.

Figure 32
78. \(g(x) = f(x) - 2\)
79. \(g(x) = - f(x)\)
Solution (click to reveal)

80. \(g(x) = f(x + 1)\)
81. \(g(x) = f(x - 2)\)
Solution (click to reveal)






















![Two side-by-side graphs. The first graph has function for original population whose domain is [0,7] and range is [0,3]. The maximum value occurs at (3,3). The second graph has the same shape as the first except it is half as wide. It is a graph of transformed population, with a domain of [0, 3.5] and a range of [0,3]. The maximum occurs at (1.5, 3).](../images/CNX_Precalc_Figure_01_05_029ab.jpg)





