Graphing Functions Using Stretches and Compressions

The last set of transformations you will explore on the graphs of functions are stretches and compressions. You will find out how the equation of a function changes when you stretch the graph in the x-direction or the y-direction.

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 2 f(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(2 x+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(2 x+3)=12? We would need 2 x+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(b x+p)=f\left(b\left(x+\dfrac{p}{b}\right)\right)

Let's work through an example.

f(x)=(2 x+4)^{2}

We can factor out a 2.

f(x)=(2(x+2))^{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.


COMBINING TRANSFORMATIONS

When combining vertical transformations written in the form a f(x)+k, first vertically stretch by a and then vertically shift by k.

When combining horizontal transformations written in the form f(b x-h), first horizontally shift by \dfrac{h}{b} and then horizontally stretch by \dfrac{1}{b}.

When combining horizontal transformations written in the form f(b(x-h)), first horizontally stretch by \dfrac{1}{b} 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 19

Finding a Triple Transformation of a Tabular Function

Given Table15 for the function f(x), create a table of values for the function g(x)=2 f(3 x)+1.

x 6 12 18 24
f(x) 10 14 15 17

Table 15


Solution

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

x 2 4 6 8
f(3x) 10 14 15 17

Table 16

 

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 17.

x 2 4 6 8
2f(3x) 20 28 30 34

Table 17

 

Finally, we can apply the vertical shift, which will add 1 to all the output values. See Table 18.

x 2 4 6 8
g(x)=2f(3x)+1 21 29 31 35

Table 18


EXAMPLE 20

Finding a Triple Transformation of a Graph

Use the graph of f(x) in Figure 27 to sketch a graph of k(x)=f\left(\dfrac{1}{2} x+1\right)-3.


Figure 27


Solution

To simplify, let's start by factoring out the inside of the function.

f\left(\dfrac{1}{2} x+1\right)-3=f\left(\dfrac{1}{2}(x+2)\right)-3

By factoring the inside, we can first horizontally stretch by 2, as indicated by the \dfrac{1}{2} on the inside of the function. Remember that twice the size of 0 is still 0, so the point (0,2) remains at (0,2) while the point (2,0) will stretch to (4,0). See Figure 28.


Figure 28


Next, we horizontally shift left by 2 units, as indicated by x+2. See Figure 29.


Figure 29

Last, we vertically shift down by 3 to complete our sketch, as indicated by the -3 on the outside of the function. See Figure 30.


Figure 30