Basic Classes of Functions: Learn It 6

Transformations of Functions 

Understanding how to transform the graph of a function is essential in visualizing mathematical concepts. Transformations include shifting, stretching, or reflecting the graph. Shifting moves the graph up, down, left, or right, stretching alters its width or height, and reflecting flips it over an axis.

Vertical Shift

Vertical shifts in graphs occur when each point on the graph moves up or down by the same amount. This shift is the result of adding or subtracting a constant to the function’s output value [latex]y[/latex].

For a positive constant [latex]c[/latex], adding it to a function [latex]f(x)[/latex] results in [latex]f(x)+c[/latex], raising the graph up [latex]c[/latex] units. Conversely, subtracting [latex]c[/latex] from [latex]f(x)[/latex] to get [latex]f(x)-c[/latex] lowers the graph by [latex]c[/latex] units. These shifts do not affect the shape of the graph; they simply reposition it along the [latex]y[/latex]-axis.

vertical shift

Vertical shifts do not alter the shape of a function’s graph, only its position along the [latex]y[/latex]-axis. Adding a positive constant lifts the graph upwards, while subtracting it pushes the graph downwards.

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 [latex]4[/latex] 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

Horizontal shifts in function graphs reflect the influence of adding or subtracting a constant from each input value [latex]x[/latex].

For a positive constant [latex]c[/latex], subtracting it from [latex]x[/latex] to form [latex]f(x-c)[/latex] shifts the graph to the right by [latex]c[/latex] units. In contrast, adding [latex]c[/latex] to [latex]x[/latex], resulting in  [latex]f(x+c)[/latex], moves the graph to the left by [latex]c[/latex] units.

horizontal shift

Horizontal shifts alter the position of a function’s graph along the [latex]x[/latex]-axis but do not change its shape. Subtracting a positive constant from the input moves the graph to the right, while adding it shifts the graph to the left

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 [latex]3[/latex] units. Similarly, the graph of [latex]f(x)=|x-3|[/latex] is the graph of [latex]y=|x|[/latex] shifted right [latex]3[/latex] units (Figure 16).

An 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 [latex]c[/latex].

If [latex]c>1[/latex], the graph of the function [latex]cf(x)[/latex] appears vertically stretched, as the outputs are proportionally larger than those of the original function [latex]f(x)[/latex]. If [latex]0 < c <1[/latex], then the outputs of the function [latex]cf(x)[/latex] are smaller, so the graph has been compressed, resulting in a graph that is closer to the [latex]x[/latex]-axis.

vertical scaling

Vertical scaling changes the steepness of a function’s graph. Multiplying by a constant greater than [latex]1[/latex] stretches the graph away from the [latex]x[/latex]-axis, while multiplying by a constant between [latex]0[/latex] and [latex]1[/latex] compresses it towards the [latex]x[/latex]-axis.

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 [latex]3[/latex], 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 [latex]3[/latex] (Figure 17).

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)

Horizontal scaling modifies the width of a function’s graph by stretching or compressing it along the [latex]x[/latex]-axis. This effect is achieved by multiplying the input, [latex]x[/latex], by a constant [latex]c[/latex].

When [latex]c>0[/latex], the function [latex]f(cx)[/latex] is the graph of [latex]f(x)[/latex] is compressed, as each input value is effectively scaled down, bringing the points closer together horizontally. If [latex]0 < c <1[/latex], the function [latex]f(cx)[/latex] is stretched, because the input values are scaled up, spreading the points further apart on the [latex]x[/latex]-axis.

horizontal scaling

Horizontal scaling affects the horizontal spread of a function’s graph. Multiplying the input by a constant greater than [latex]1[/latex] compresses the graph, while a constant between [latex]0[/latex] and [latex]1[/latex] stretches it.

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

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

Reflections of a function’s graph across an axis create a mirror image. When we multiply the outputs of a function, [latex]f(x)[/latex], by [latex]-1[/latex] we achieve a reflection across the [latex]x[/latex]-axis, turning every point to its opposite position vertically. Similarly, multiplying the inputs by [latex]-1[/latex] before applying the function, as in [latex]f(-x)[/latex], reflects the graph across the y-axis, flipping it horizontally. 

reflections of functions

Reflecting a function’s graph across an axis is accomplished by multiplying by[latex]-1[/latex]. To mirror across the [latex]x[/latex]-axis, multiply the outputs by [latex]-1[/latex]. To reflect across the [latex]y[/latex]-axis, multiply the inputs by [latex]-1[/latex].

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

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.

It is beneficial when working with transformations to remember the basic toolkit functions. These will be your starting points when trying to identify how the function has been transformed.

Toolkit Functions
Name Function Graph
Constant [latex]f\left(x\right)=c[/latex], where [latex]c[/latex] is a constant Graph of a constant function.
Identity/Linear [latex]f\left(x\right)=x[/latex] Graph of a straight line.
Absolute value [latex]f\left(x\right)=|x|[/latex] Graph of absolute function.
Quadratic [latex]f\left(x\right)={x}^{2}[/latex] Graph of a parabola.
Cubic [latex]f\left(x\right)={x}^{3}[/latex] Graph of f(x) = x^3.
Reciprocal [latex]f\left(x\right)=\frac{1}{x}[/latex] Graph of f(x)=1/x.
Reciprocal squared [latex]f\left(x\right)=\frac{1}{{x}^{2}}[/latex] Graph of f(x)=1/x^2.
Square root [latex]f\left(x\right)=\sqrt{x}[/latex] Graph of f(x)=sqrt(x).
Cube root [latex]f\left(x\right)=\sqrt[3]{x}[/latex] Graph of f(x)=x^(1/3).

For each of the following functions, sketch a graph by using a sequence of transformations of a toolkit function.

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