Transformations of Functions

Learning Outcomes

  • Sketch the graph of a function that has been shifted, stretched, or reflected from its initial graph position

We have seen several cases in which we have added, subtracted, or multiplied constants to form variations of simple functions. In the previous example, for instance, we subtracted 2 from the argument of the function [latex]y=x^2[/latex] to get the function [latex]f(x)=(x-2)^2[/latex]. This subtraction represents a shift of the function [latex]y=x^2[/latex] two units to the right. A shift, horizontally or vertically, is a type of transformation of a function. Other transformations include horizontal and vertical scalings, and reflections about the axes.

Vertical Shift

A vertical shift of a function occurs if we add or subtract the same constant to each output [latex]y[/latex]. For [latex]c>0[/latex], the graph of [latex]f(x)+c[/latex] is a shift of the graph of [latex]f(x)[/latex] up [latex]c[/latex] units, whereas the graph of [latex]f(x)-c[/latex] is a shift of the graph of [latex]f(x)[/latex] down [latex]c[/latex] units. For example, the graph of the function [latex]f(x)=x^3+4[/latex] is the graph of [latex]y=x^3[/latex] shifted up 4 units; the graph of the function [latex]f(x)=x^3-4[/latex] is the graph of [latex]y=x^3[/latex] shifted down 4 units (Figure 15).

An image of two graphs. The first graph is labeled “a” and has an x axis that runs from -4 to 4 and a y axis that runs from -1 to 10. The graph is of two functions. The first function is “f(x) = x squared”, which is a parabola that decreases until the origin and then increases again after the origin. The second function is “f(x) = (x squared) + 4”, which is a parabola that decreases until the point (0, 4) and then increases again after the origin. The two functions are the same in shape, but the second function is shifted up 4 units. The second graph is labeled “b” and has an x axis that runs from -4 to 4 and a y axis that runs from -5 to 6. The graph is of two functions. The first function is “f(x) = x squared”, which is a parabola that decreases until the origin and then increases again after the origin. The second function is “f(x) = (x squared) - 4”, which is a parabola that decreases until the point (0, -4) and then increases again after the origin. The two functions are the same in shape, but the second function is shifted down 4 units.

Figure 15. (a) For [latex]c>0[/latex], the graph of [latex]y=f(x)+c[/latex] is a vertical shift up [latex]c[/latex] units of the graph of [latex]y=f(x)[/latex]. (b) For [latex]c>0[/latex], the graph of [latex]y=f(x)-c[/latex] is a vertical shift down [latex]c[/latex] units of the graph of [latex]y=f(x)[/latex].

Horizontal Shift

A horizontal shift of a function occurs if we add or subtract the same constant to each input [latex]x[/latex]. For [latex]c>0[/latex], the graph of [latex]f(x+c)[/latex] is a shift of the graph of [latex]f(x)[/latex] to the left [latex]c[/latex] units; the graph of [latex]f(x-c)[/latex] is a shift of the graph of [latex]f(x)[/latex] to the right [latex]c[/latex] units. Why does the graph shift left when adding a constant and shift right when subtracting a constant? To answer this question, let’s look at an example.

Consider the function [latex]f(x)=|x+3|[/latex] and evaluate this function at [latex]x-3.[/latex] Since [latex]f(x-3)=|x|[/latex] and [latex]x-3An image of two graphs. The first graph is labeled “a” and has an x axis that runs from -8 to 5 and a y axis that runs from -3 to 5. The graph is of two functions. The first function is “f(x) = absolute value of x”, which decreases in a straight line until the origin and then increases in a straight line again after the origin. The second function is “f(x) = absolute value of (x + 3)”, which decreases in a straight line until the point (-3, 0) and then increases in a straight line again after the point (-3, 0). The two functions are the same in shape, but the second function is shifted left 3 units. The second graph is labeled “b” and has an x axis that runs from -5 to 8 and a y axis that runs from -3 to 5. The graph is of two functions. The first function is “f(x) = absolute value of x”, which decreases in a straight line until the origin and then increases in a straight line again after the origin. The second function is “f(x) = absolute value of (x - 3)”, which decreases in a straight line until the point (3, 0) and then increases in a straight line again after the point (3, 0). The two functions are the same in shape, but the second function is shifted right 3 units.

Figure 16. (a) For [latex]c>0[/latex], the graph of [latex]y=f(x+c)[/latex] is a horizontal shift left [latex]c[/latex] units of the graph of [latex]y=f(x)[/latex]. (b) For [latex]c>0[/latex], the graph of [latex]y=f(x-c)[/latex] is a horizontal shift right [latex]c[/latex] units of the graph of [latex]y=f(x)[/latex].

Vertical Scaling (Stretched/Compressed)

A vertical scaling of a graph occurs if we multiply all outputs [latex]y[/latex] of a function by the same positive constant. For [latex]c>0[/latex], the graph of the function [latex]cf(x)[/latex] is the graph of [latex]f(x)[/latex] scaled vertically by a factor of [latex]c[/latex]. If [latex]c>1[/latex], the values of the outputs for the function [latex]cf(x)[/latex] are larger than the values of the outputs for the function [latex]f(x)[/latex]; therefore, the graph has been stretched vertically. If [latex]0

An image of two graphs. The first graph is labeled “a” and has an x axis that runs from -3 to 3 and a y axis that runs from -2 to 9. The graph is of two functions. The first function is “f(x) = x squared”, which is a parabola that decreases until the origin and then increases again after the origin. The second function is “f(x) = 3(x squared)”, which is a parabola that decreases until the origin and then increases again after the origin, but is vertically stretched and thus increases at a quicker rate than the first function. The second graph is labeled “b” and has an x axis that runs from -4 to 4 and a y axis that runs from -2 to 9. The graph is of two functions. The first function is “f(x) = x squared”, which is a parabola that decreases until the origin and then increases again after the origin. The second function is “f(x) = (1/3)(x squared)”, which is a parabola that decreases until the origin and then increases again after the origin, but is vertically compressed and thus increases at a slower rate than the first function.

Figure 17. (a) If [latex]c>1[/latex], the graph of [latex]y=cf(x)[/latex] is a vertical stretch of the graph of [latex]y=f(x)[/latex]. (b) If [latex]0<c<1[/latex], the graph of [latex]y=cf(x)[/latex] is a vertical compression of the graph of [latex]y=f(x)[/latex].

Horizontal Scaling (Stretched/Compressed)

The horizontal scaling of a function occurs if we multiply the inputs [latex]x[/latex] by the same positive constant. For [latex]c>0[/latex], the graph of the function [latex]f(cx)[/latex] is the graph of [latex]f(x)[/latex] scaled horizontally by a factor of [latex]c[/latex]. If [latex]c>1[/latex], the graph of [latex]f(cx)[/latex] is the graph of [latex]f(x)[/latex] compressed horizontally. If [latex]0

An image of two graphs. Both graphs have an x axis that runs from -2 to 4 and a y axis that runs from -2 to 5. The first graph is labeled “a” and is of two functions. The first graph is of two functions. The first function is “f(x) = square root of x”, which is a curved function that begins at the origin and increases. The second function is “f(x) = square root of 2x”, which is a curved function that begins at the origin and increases, but increases at a faster rate than the first function. The second graph is labeled “b” and is of two functions. The first function is “f(x) = square root of x”, which is a curved function that begins at the origin and increases. The second function is “f(x) = square root of (x/2)”, which is a curved function that begins at the origin and increases, but increases at a slower rate than the first function.

Figure 18. (a) If [latex]c>1[/latex], the graph of [latex]y=f(cx)[/latex] is a horizontal compression of the graph of [latex]y=f(x)[/latex]. (b) If [latex]0<c<1[/latex], the graph of [latex]y=f(cx)[/latex] is a horizontal stretch of the graph of [latex]y=f(x)[/latex].

Reflection

We have explored what happens to the graph of a function [latex]f[/latex] when we multiply [latex]f[/latex] by a constant [latex]c>0[/latex] to get a new function [latex]cf(x)[/latex]. We have also discussed what happens to the graph of a function [latex]f[/latex] when we multiply the independent variable [latex]x[/latex] by [latex]c>0[/latex] to get a new function [latex]f(cx)[/latex]. However, we have not addressed what happens to the graph of the function if the constant [latex]c[/latex] is negative. If we have a constant [latex]c<0[/latex], we can write [latex]c[/latex] as a positive number multiplied by [latex]-1[/latex]; but, what kind of transformation do we get when we multiply the function or its argument by [latex]-1[/latex]? When we multiply all the outputs by [latex]-1[/latex], we get a reflection about the [latex]x[/latex]-axis. When we multiply all inputs by [latex]-1[/latex], we get a reflection about the [latex]y[/latex]-axis. For example, the graph of [latex]f(x)=−(x^3+1)[/latex] is the graph of [latex]y=(x^3+1)[/latex] reflected about the [latex]x[/latex]-axis. The graph of [latex]f(x)=(−x)^3+1[/latex] is the graph of [latex]y=x^3+1[/latex] reflected about the [latex]y[/latex]-axis (Figure 19).

An image of two graphs. Both graphs have an x axis that runs from -3 to 3 and a y axis that runs from -5 to 6. The first graph is labeled “a” and is of two functions. The first graph is of two functions. The first function is “f(x) = x cubed + 1”, which is a curved increasing function that has an x intercept at (-1, 0) and a y intercept at (0, 1). The second function is “f(x) = -(x cubed + 1)”, which is a curved decreasing function that has an x intercept at (-1, 0) and a y intercept at (0, -1). The second graph is labeled “b” and is of two functions. The first function is “f(x) = x cubed + 1”, which is a curved increasing function that has an x intercept at (-1, 0) and a y intercept at (0, 1). The second function is “f(x) = (-x) cubed + 1”, which is a curved decreasing function that has an x intercept at (1, 0) and a y intercept at (0, 1). The first function increases at the same rate the second function decreases for the same values of x.

Figure 19. (a) The graph of [latex]y=−f(x)[/latex] is the graph of [latex]y=f(x)[/latex] reflected about the [latex]x[/latex]-axis. (b) The graph of [latex]y=f(−x)[/latex] is the graph of [latex]y=f(x)[/latex] reflected about the [latex]y[/latex]-axis.

Multiple Transformations

If the graph of a function consists of more than one transformation of another graph, it is important to transform the graph in the correct order. Given a function [latex]f(x)[/latex], the graph of the related function [latex]y=cf(a(x+b))+d[/latex] can be obtained from the graph of [latex]y=f(x)[/latex] by performing the transformations in the following order.

  1. Horizontal shift of the graph of [latex]y=f(x)[/latex]. If [latex]b>0[/latex], shift left. If [latex]b<0[/latex], shift right.
  2. Horizontal scaling of the graph of [latex]y=f(x+b)[/latex] by a factor of [latex]|a|[/latex]. If [latex]a<0[/latex], reflect the graph about the [latex]y[/latex]-axis.
  3. Vertical scaling of the graph of [latex]y=f(a(x+b))[/latex] by a factor of [latex]|c|[/latex]. If [latex]c<0[/latex], reflect the graph about the [latex]x[/latex]-axis.
  4. Vertical shift of the graph of [latex]y=cf(a(x+b))[/latex]. If [latex]d>0[/latex], shift up. If [latex]d<0[/latex], shift down.

We can summarize the different transformations and their related effects on the graph of a function in the following table.

Transformations of Functions
Transformation of [latex]f(c>0)[/latex] Effect on the graph of[latex]f[/latex]
[latex]f(x)+c[/latex] Vertical shift up [latex]c[/latex] units
[latex]f(x)-c[/latex] Vertical shift down [latex]c[/latex] units
[latex]f(x+c)[/latex] Shift left by [latex]c[/latex] units
[latex]f(x-c)[/latex] Shift right by [latex]c[/latex] units
[latex]cf(x)[/latex] Vertical stretch if [latex]c>1[/latex];
vertical compression if [latex]0
[latex]f(cx)[/latex] Horizontal stretch if [latex]01[/latex]
[latex]−f(x)[/latex] Reflection about the [latex]x[/latex]-axis
[latex]f(−x)[/latex] Reflection about the [latex]y[/latex]-axis

Example: Transforming a Function

For each of the following functions, a. and b., sketch a graph by using a sequence of transformations of a well-known function.

  1. [latex]f(x)=−|x+2|-3[/latex]
  2. [latex]f(x)=3\sqrt{−x}+1[/latex]

 

Watch the following video to see the worked solution to Example: Transforming a Function

Try It

Describe how the function [latex]f(x)=−(x+1)^2-4[/latex] can be graphed using the graph of [latex]y=x^2[/latex] and a sequence of transformations.

 

 

Try It