1.6 Transformation of Functions

Learning Objectives

In this section, you will:

  • Describe and apply vertical and horizontal shifts and reflections of graphs, tables and function formulas.
  • Use function notation to express horizontal and vertical shifts and reflections of functions.
  • Determine whether a function is even, odd or neither from its algebraic formula or graph.
Figure_01_05_038

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.

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 [latex]g\left(x\right)=f\left(x\right)+k,[/latex] the function [latex]f\left(x\right)[/latex] is shifted vertically [latex]k[/latex] units. See Figure 2 for an example.

Figure_01_05_001

Figure 2 Vertical shift by [latex]k=1[/latex] of the cube root function [latex]f\left(x\right)=\sqrt[\leftroot{1}\uproot{2}3]{x}.[/latex]

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

Definition

Given a function [latex]f\left(x\right),[/latex] a new function [latex]g\left(x\right)=f\left(x\right)+k,[/latex] where  [latex]k[/latex] is a constant, is a vertical shift of the function [latex]f\left(x\right).[/latex] All the output values change by [latex]k[/latex] units. If [latex]k[/latex] is positive, the graph will shift up. If [latex]k[/latex] 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 [latex]V[/latex] (in square feet) throughout the day in hours after midnight, [latex]t.[/latex] 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_01_05_002

Figure 3

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 [latex]f\left(x\right)[/latex] is given in Table 2. Create a table for the function [latex]g\left(x\right)=f\left(x\right)-3.[/latex]

Table 2
[latex]x[/latex] 2 4 6 8
[latex]f\left(x\right)[/latex] 1 3 7 11

Try it #1

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

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 or the inside of the function change its graph and meaning.

A change to the input results in a movement of the graph of an original function left or right in what is known as a horizontal shift. We will be creating a new function [latex]g\left(x\right)[/latex] which is based on an original function [latex]f\left(x\right)[/latex] using the following function notation:  [latex]g\left(x\right)=f\left(x-h\right)[/latex] where [latex]h[/latex] is a constant.

For example, if [latex]f\left(x\right)={x}^{2},[/latex] then we can create a function in terms of [latex]f[/latex] by writing [latex]g\left(x\right)=f\left(x-2\right),[/latex] which is equivalent to [latex]g\left(x\right)={\left(x-2\right)}^{2}.[/latex]  Think about what happens carefully.

We can read the statement [latex]g\left(x\right)=f\left(x-2\right)[/latex] as saying that the output for [latex]g[/latex] at [latex]x[/latex] will be the same as the output we get for the original function [latex]f[/latex] evaluated two units earlier.  Perhaps an easier way to see this is to recognize that if [latex]x[/latex] is 5, then [latex]g\left(5\right)=f\left(5-2\right)=f\left(3\right).[/latex]  We get the same output for [latex]g[/latex] at the input of 5 as we did for the function [latex]f[/latex] for an input two untis earlier.  Therefore, in order to produce the graph of [latex]g[/latex], we will shift our original function [latex]f\left(x\right)[/latex] to the right by two units.

What if [latex]h[/latex] is negative?  Let’s consider the graph of [latex]f\left(x\right)=\sqrt[\leftroot{1}\uproot{2}3]{x}.[/latex]  If we let [latex]h=-1,[/latex] then we can consider a new function [latex]m\left(x\right)=f\left(x-\left(-1\right)\right)=f\left(x+1\right).[/latex]  This is equivalent to [latex]m\left(x\right)=\sqrt[\leftroot{1}\uproot{2}3]{x+1}.[/latex] Notice again that it is our input which has changed.  We can read this statement as saying that the output for [latex]m[/latex] evaluated at [latex]x[/latex] will be the same as the output we get for the original function [latex]f[/latex] evaluated one unit later.  Therefore, [latex]m\left(5\right)=f\left(5+1\right)=f\left(6\right).[/latex]  In order to produce the graph of [latex]m,[/latex] we will shift the original function [latex]f\left(x\right)[/latex] to the left by one unit.  Consider the picture shown in Figure 5.

Figure_01_05_004

Figure 5 Horizontal shift of the function [latex]f\left(x\right)=\sqrt[\leftroot{1}\uproot{2}3]{x}.[/latex] Note that [latex]f\left(x+1\right)[/latex] shifts the graph to the left by one unit.

Definition

Given a function [latex]f,[/latex] a new function [latex]g\left(x\right)=f\left(x-h\right),[/latex] where [latex]h[/latex] is a constant, is a horizontal shift of the function [latex]f.[/latex] If [latex]h[/latex] is positive, the graph will shift right. If [latex]h[/latex] 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.

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 [latex]f\left(x\right)[/latex] is given in Table 4. Create a table for the function [latex]g\left(x\right)=f\left(x-3\right).[/latex]

Table 4
[latex]x[/latex] [latex]f\left(x\right)[/latex]
2 1
4 3
6 7
8 11

Example 5:  Identifying a Horizontal Shift of a Toolkit Function

Figure 8 represents a transformation of the toolkit function [latex]f\left(x\right)={x}^{2}.[/latex] Relate this new function [latex]g\left(x\right)[/latex] to [latex]f\left(x\right),[/latex] and then find a formula for [latex]g\left(x\right).[/latex]

Graph of a parabola.

Figure 8

Example 6:  Interpreting Horizontal versus Vertical Shifts

The function [latex]G\left(m\right)[/latex] gives the number of gallons of gas required to drive [latex]m[/latex] miles. Interpret [latex]G\left(m\right)+10[/latex] and [latex]G\left(m+10\right).[/latex]

Try it #2

Given the function [latex]f\left(x\right)=\sqrt[\leftroot{1}\uproot{2} ]{x},[/latex] graph the original function [latex]f\left(x\right)[/latex] and the transformation [latex]g\left(x\right)=f\left(x+2\right)[/latex] 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 together. Vertical shifts are outside changes that affect the output, [latex]y\text{-}[/latex] axis values and shift the function up or down. Horizontal shifts are inside changes that affect the input, [latex]x\text{-}[/latex] 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 subtracted from the input. Move the graph right for a positive constant and left for a negative constant.
  4. Apply the shifts to the graph in either order.

Example 7:  Graphing Combined Vertical and Horizontal Shifts

Given [latex]f\left(x\right)=|x|,[/latex] sketch a graph of [latex]h\left(x\right)=f\left(x+1\right)-3.[/latex]

Try it #3

Given[latex]f\left(x\right)=|x|,[/latex] sketch a graph of [latex]h\left(x\right)=f\left(x-2\right)+4.[/latex]

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.

Graph of a square root function transposed right one unit and up 2.

Figure 11

Try it #4

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

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.

Graph of the vertical and horizontal reflection of a function.

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.

Definitions

Given a function [latex]f\left(x\right),[/latex] a new function [latex]g\left(x\right)=-f\left(x\right)[/latex] is a vertical reflection of the function [latex]f\left(x\right),[/latex] sometimes called a reflection about (or over, or through) the x-axis.

Given a function [latex]f\left(x\right),[/latex] a new function [latex]g\left(x\right)=f\left(-x\right)[/latex] is a horizontal reflection of the function [latex]f\left(x\right),[/latex] sometimes 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 9:  Reflecting a Graph Horizontally and Vertically

Reflect the graph of [latex]s\left(t\right)=\sqrt[\leftroot{1}\uproot{2} ]{t}[/latex] (a) vertically and (b) horizontally.

Try it #5

Reflect the graph of [latex]f\left(x\right)=|x-1|[/latex] (a) vertically and (b) horizontally.

Example 10:  Reflecting a Tabular Function Horizontally and Vertically

A function [latex]f\left(x\right)[/latex] is given as Table 6. Create a table for the functions below.

  1. [latex]g\left(x\right)=-f\left(x\right)[/latex]
  2. [latex]h\left(x\right)=f\left(-x\right)[/latex]
Table 6
[latex]x[/latex] 2 4 6 8
[latex]f\left(x\right)[/latex] 1 3 7 11

Try it #6

A function [latex]f\left(x\right)[/latex] is given as Table 9. Create a table for the functions below.

  1. [latex]g\left(x\right)=-f\left(x\right)[/latex]
  2. [latex]h\left(x\right)=f\left(-x\right)[/latex]
Table 9
[latex]x[/latex] −2 0 2 4
[latex]f\left(x\right)[/latex] 5 10 15 20

Example 11:  Applying a Learning Model Equation

A common model for learning has an equation similar to [latex]k\left(t\right)=-{2}^{-t}+1,[/latex] where [latex]k[/latex] is the percentage of mastery that can be achieved after [latex]t[/latex] practice sessions. This is a transformation of the function [latex]f\left(t\right)={2}^{t}[/latex] shown in Figure 15. Sketch a graph of [latex]k\left(t\right).[/latex]

Graph of k(t)

Figure 15

Try it #7

Given the toolkit function [latex]f\left(x\right)={x}^{2},[/latex] graph [latex]g\left(x\right)=-f\left(x\right)[/latex] and [latex]h\left(x\right)=f\left(-x\right).[/latex] Take note of any surprising behavior for these functions.

Determining Even and Odd Functions

Some functions exhibit symmetry so that reflections result in the original graph. For example, horizontally reflecting the toolkit functions [latex]f\left(x\right)={x}^{2}[/latex] or [latex]f\left(x\right)=|x|[/latex] 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 [latex]f\left(x\right)={x}^{3}[/latex] or [latex]f\left(x\right)=\frac{1}{x}[/latex] were reflected over both axes, the result would be the original graph, as shown in Figure 17.

Graph of x^3 and its reflections.

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, [latex]f\left(x\right)={2}^{x}[/latex] is neither even nor odd. Also, the only function that is both even and odd is the constant function [latex]f\left(x\right)=0.[/latex]

Definition

A function is called an even function if for every input [latex]x[/latex]

[latex]f\left(x\right)=f\left(-x\right).[/latex][latex]\\[/latex]

The graph of an even function is symmetric about the [latex]y\text{-}[/latex]axis.[latex]\\[/latex]

A function is called an odd function if for every input [latex]x[/latex]

[latex]f\left(x\right)=-f\left(-x\right)[/latex] or equivalently [latex]f\left(-x\right)=-f\left(x\right)[/latex][latex]\\[/latex]

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 [latex]f\left(x\right)=f\left(-x\right).[/latex] If it does, it is even.
  2. Determine whether the function satisfies [latex]f\left(x\right)=-f\left(-x\right).[/latex] If it does, it is odd.  Note that you can also show the equivalent statement [latex]f\left(-x\right)=-f\left(x\right).[/latex]
  3. If the function does not satisfy either rule, it is neither even nor odd.

Example 12:  Determining whether a Function Is Even, Odd, or Neither

Is the function [latex]f\left(x\right)={x}^{3}+2x[/latex] even, odd, or neither?

Try it #8

Is the function [latex]f\left(s\right)={s}^{4}+3{s}^{2}+7[/latex] even, odd, or neither?

Access this online resource for additional instruction and practice with transformation of functions.

Key Equations

Vertical shift [latex]g\left(x\right)=f\left(x\right)+k[/latex] (up for [latex]k>0[/latex])
Horizontal shift [latex]g\left(x\right)=f\left(x-h\right)[/latex] (right for [latex]h>0[/latex])
Vertical reflection [latex]g\left(x\right)=-f\left(x\right)[/latex]
Horizontal reflection [latex]g\left(x\right)=f\left(-x\right)[/latex]
Vertical stretch [latex]g\left(x\right)=af\left(x\right)[/latex] ([latex]a>1[/latex] )
Vertical compression [latex]g\left(x\right)=af\left(x\right)[/latex] [latex]\left(0<a<1\right)[/latex]
Horizontal stretch [latex]g\left(x\right)=f\left(bx\right)[/latex] [latex]\left(0<b<1\right)[/latex]
Horizontal compression [latex]g\left(x\right)=f\left(bx\right)[/latex] ([latex]b>1[/latex])

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 [latex]x\text{-}[/latex]axis. A graph can be reflected vertically by multiplying the output by –1.
  • A horizontal reflection reflects a graph about the [latex]y\text{-}[/latex]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 [latex]y\text{-}[/latex]axis, whereas odd functions are symmetric about the origin.
  • Even functions satisfy the condition [latex]f\left(x\right)=f\left(-x\right).[/latex]
  • Odd functions satisfy the condition [latex]f\left(x\right)=-f\left(-x\right).[/latex]
  • A function can be odd, even, or neither.

Glossary

even function
a function whose graph is unchanged by horizontal reflection, [latex]f\left(x\right)=f\left(-x\right),[/latex] and is symmetric about the [latex]y\text{-}[/latex]axis
horizontal reflection
a transformation that reflects a function’s graph across the y-axis by multiplying the input by [latex]-1[/latex]
horizontal shift
a transformation that shifts a function’s graph left or right by adding a positive or negative constant to the input
odd function
a function whose graph is unchanged by combined horizontal and vertical reflection, [latex]f\left(x\right)=-f\left(-x\right),[/latex] and is symmetric about the origin
vertical reflection
a transformation that reflects a function’s graph across the x-axis by multiplying the output by [latex]-1[/latex]
vertical shift
a transformation that shifts a function’s graph up or down by adding a positive or negative constant to the output