Graphing Functions Using Vertical and Horizontal Shifts

Site: Saylor Academy
Course: MA001: College Algebra
Book: Graphing Functions Using Vertical and Horizontal Shifts
Printed by: Guest user
Date: Sunday, May 19, 2024, 3:28 AM

Description

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.

Transformation of Functions

Learning Objectives

In this section, you will:

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

Figure 1
 

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.



Source: Rice University, https://openstax.org/books/college-algebra/pages/3-5-transformation-of-functions
Creative Commons License This work is licensed under a Creative Commons Attribution 4.0 License.

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.


VERTICAL SHIFT

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

Adding a Constant to a Function

To regulate temperature in a green building, airflow vents near the roof open and close throughout the day. Figure 3 shows the area of open vents V (in square feet) throughout the day in hours after midnight, t. During the summer, the facilities manager decides to try to better regulate temperature by increasing the amount of open vents by 20 square feet throughout the day and night. Sketch a graph of this new function.


Figure 3


Solution

We can sketch a graph of this new function by adding 20 to each of the output values of the original function. This will have the effect of shifting the graph vertically up, as shown in Figure 4.


Figure 4


Notice that in Figure 4 , for each input value, the output value has increased by 20 , so if we call the new function S(t), we could write

S(t)=V(t)+20

This notation tells us that, for any value of t, S(t) can be found by evaluating the function V at the same input and then adding 20 to the result. This defines S as a transformation of the function V, in this case a vertical shift up 20 units. Notice that, with a vertical shift, the input values stay the same and only the output values change. See Table 1.

t 0 8 10 17 19 24
V(t) 0 0 220 220 0 0
S(t) 20 20 240 240 20 20

Table 1


HOW TO

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

  1. Identify the output row or column.
  2. Determine the magnitude of the shift.
  3. Add the shift to the value in each output cell. Add a positive value for up or a negative value for down.


EXAMPLE 2

Shifting a Tabular Function Vertically

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

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


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:

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


\begin{array}{rlr}
f(2) & =1 & \text { Given } \\
g(x) & =f(x)-3  & \text { Given transformation } \\
g(2) & =f(2)-3 & \\
& =1-3 & \\
& =-2 &
\end{array}

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

Table 3


Analysis

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


TRY IT #1

The function h(t)=-4.9 t^{2}+30 t 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).


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?

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.


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 7

Graphing Combined Vertical and Horizontal Shifts

Given f(x)=|x|, sketch a graph of h(x)=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 h 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 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 9


Figure 10 shows the graph of h.


Figure 10


TRY IT #3

Given f(x)=|x|, sketch a graph of h(x)=f(x-2)+4.


EXAMPLE 8

Identifying Combined Vertical and Horizontal Shifts

Write a formula for the graph shown in Figure 11, which is a transformation of the toolkit square root function.


Figure 11

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

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

h(x)=\sqrt{x-1}+2


Analysis

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


TRY IT #4

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.

Function Transformations: Horizontal and Vertical Translations



Source: Mathispower4u, https://youtu.be/CESXLJaq6Mk
Creative Commons License This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.