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).
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-3<x[/latex], the graph of [latex]f(x)=|x+3|[/latex] is the graph of [latex]y=|x|[/latex] shifted left 3 units. Similarly, the graph of [latex]f(x)=|x-3|[/latex] is the graph of [latex]y=|x|[/latex] shifted right 3 units (Figure 16).
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<c<1[/latex], then the outputs of the function [latex]cf(x)[/latex] are smaller, so the graph has been compressed. For example, the graph of the function [latex]f(x)=3x^2[/latex] is the graph of [latex]y=x^2[/latex] stretched vertically by a factor of 3, whereas the graph of [latex]f(x)=\frac{x^2}{3}[/latex] is the graph of [latex]y=x^2[/latex] compressed vertically by a factor of 3 (Figure 17).
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<c<1[/latex], the graph of [latex]f(cx)[/latex] is the graph of [latex]f(x)[/latex] stretched horizontally. For example, consider the function [latex]f(x)=\sqrt{2x}[/latex] and evaluate [latex]f[/latex] at [latex]\dfrac{x}{2}.[/latex] Since [latex]f(\frac{x}{2})=\sqrt{x}[/latex], the graph of [latex]f(x)=\sqrt{2x}[/latex] is the graph of [latex]y=\sqrt{x}[/latex] compressed horizontally. The graph of [latex]y=\sqrt{\frac{x}{2}}[/latex] is a horizontal stretch of the graph of [latex]y=\sqrt{x}[/latex] (Figure 18).
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).
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.
- 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.
- 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.
- 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.
- 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.
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<c<1[/latex] |
[latex]f(cx)[/latex] | Horizontal stretch if [latex]0<c<1[/latex]; horizontal compression if [latex]c>1[/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.
- [latex]f(x)=−|x+2|-3[/latex]
- [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.