Graphing Functions Using Vertical and Horizontal Shifts

In the next few sections, you will begin to strengthen your ability to graph functions without the aid of a graphing tool and without having to do a lot of algebra. You will learn some basic transformations that can be done to the graphs of the toolkit functions to make more complex functions. For example, we can take the graph of the square root function f(x) = \sqrt{x}, shift it to the left or right, and determine the resulting equation. Conversely we can begin with the equation of f(x) = \sqrt{x-2} and determine what has been done to the graph of f(x) = \sqrt{x} without doing a lot of algebra.

Graphing Functions Using Vertical and Horizontal Shifts

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 prio input by 2 units to yield the same output value as given in f.


HORIZONTAL SHIFT

Given a function f, a new function g(x)=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 3

Adding a Constant to an Input

Returning to our building airflow example from Figure 3, suppose that in autumn the facilities manager decides that the original venting plan starts too late, and wants to begin the entire venting program 2 hours earlier. Sketch a graph of the new function.

Solution

We can set V(t) to be the original program and F(t) to be the revised program.


\begin{aligned}
&V(t)=\text { the original venting plan } \\
&F(t)=\text { starting } 2 \mathrm{hrs} \text { sooner }
\end{aligned}

In the new graph, at each time, the airflow is the same as the original function V was 2 hours later. For example, in the original function V, the airflow starts to change at 8 a.m., whereas for the function F, the airflow starts to change at 6 a.m. The comparable function values are V(8)=F(6). See Figure 6. Notice also that the vents first opened to 220 \mathrm{ft}^{2} at 10 a.m. under the original plan, while under the new plan the vents reach 220 \mathrm{ft}^{2} at 8 a.m., so V(10)=F(8).

In both cases, we see that, because F(t) starts 2 hours sooner, h=-2. That means that the same output values are reached when F(t)=V(t-(-2))=V(t+2).


Figure 6


Analysis

Note that V(t+2) has the effect of shifting the graph to the left.

Horizontal changes or "inside changes" affect the domain of a function (the input) instead of the range and often seem counterintuitive. The new function F(t) uses the same outputs as V(t), but matches those outputs to inputs 2 hours earlier than those of V(t). Said another way, we must add 2 hours to the input of V to find the corresponding output for F: F(t)=V(t+2).


HOW TO

Given a tabular function, create a new row to represent a horizontal shift.

  1. Identify the input row or column.
  2. Determine the magnitude of the shift.
  3. Add the shift to the value in each input cell.


EXAMPLE 4

Shifting a Tabular Function Horizontally

A function f(x) is given in Table 4. Create a table for the function g(x)=f(x-3).

x 2 4 6 8
f(x) 1 3 7 11

Table 4

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{aligned}
g(5) &=f(5-3) \\
&=f(2) \\
&=1
\end{aligned}

We continue with the other values to create Table 5.

x 5 7 9 11
x−3 2 4 6 8
f(x–3) 1 3 7 11
g(x) 1 3 7 11
Table 5


Analysis

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


EXAMPLE 5

Identifying a Horizontal Shift of a Toolkit Function

Figure 8 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).


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)

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{aligned}
&f(x)=x^{2} \\
&g(x)=f(x-2) \\
&g(x)=f(x-2)=(x-2)^{2}
\end{aligned}


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.


EXAMPLE 6

Interpreting Horizontal versus Vertical Shifts

The function G(m) gives the number of gallons of gas required to drive m miles. Interpret G(m)+10 and G(m+10).

Solution

G(m)+10 can be interpreted as adding 10 to the output, gallons. This is the gas required to drive m miles, plus another 10 gallons of gas. The graph would indicate a vertical shift.

G(m+10) can be interpreted as adding 10 to the input, miles. So this is the number of gallons of gas required to drive 10 miles more than m miles. The graph would indicate a horizontal shift.


TRY IT #2

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?