topic badge

5.05 Transformations of functions

Introduction

We graphed linear functions in lessons  3.05 Graphing linear functions  and  3.06 Forms of linear functions  , exponential functions in lesson  5.01 Exponential functions  . Now, we will learn how to transform these graphs by changing their shape and shifting them up, down, left, and right.

Translations and reflections of functions

The function in any family with the simplest form is known as the parent function, and we frequently consider transformations as coming from the parent function.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y

The parent function of the linear function family is the function y = x.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y

The parent function of the absolute value function family is the function y = \left|x\right|.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y

The parent function of the exponential function family is the function y = b^x where b>0, b\neq 1.

Exploration

Move the sliders to see how each one affects the graph. Choose different functions to compare the affects across the various graphs.

Loading interactive...
  1. What happens to the graph when k is positive?
  2. What happens to the graph when k is negative?
  3. What happens to the graph when h is positive?
  4. What happens to the graph when h is negative?
  5. What happens to the graph when a is negative?
  6. What happens to the graph when b is negative?

A transformation of a function is a change in the position or shape of its graph. There are many ways functions can be transformed. In the examples of transformations shown below, the parent function is shown as a dashed line.

Reflection

A transformation that produces the mirror image of a figure across a line

A reflection across the x-axis can be represented algebraically by g\left(x\right) = -f\left(x\right)A reflection across the y-axis can be represented algebraically by g\left(x\right) = f\left(-x\right)

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Reflection across the x-axis: {g\left(x\right)=-f\left(x\right)}
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Reflection across the y-axis: {g\left(x\right)=f\left(-x\right)}
Translation

A transformation in which every point in a figure is moved in the same direction and by the same distance

Translations can be categorized as horizontal (moving left or right, along the x-axis) or vertical (moving up or down, along the y-axis), or a combination of the two.

Vertical translations can be represented algebraically by g\left(x\right) = f\left(x\right) + kwhere k > 0 translates upwards and k < 0 translates downwards.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Vertical translation of 4 units upwards: {g\left(x\right) = f\left(x\right) + 4}
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Vertical translation of 4 units downwards: {g\left(x\right)=f\left(x\right)-4}

Similarly, horizontal translations can be represented by g\left(x\right) = f\left(x - k\right) where k > 0 translates to the right and k < 0 translates to the left.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Horizontal translation of 3 units left: {g\left(x\right) = f\left(x+3\right)}
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Horizontal translation of 3 units to the right: {g\left(x\right) = f\left(x - 3\right)}

Examples

Example 1

Consider the function f\left(x\right)=3^x.

a

Complete the table of values.

xf\left(x\right)f\left(x-1\right)f\left(x-2\right)f\left(x-3\right)
-3\dfrac{1}{27}
-2\dfrac{1}{9}
-1\dfrac{1}{3}
01
13
29
327
Worked Solution
Create a strategy

To fill out the first column for we need to substitute the x-values into f\left(x-1\right). After simplifying the expression in parentheses, we can substitute the value into f\left(x \right) and look for patterns.

Apply the idea

Substituting x=-3 into f\left(x-1\right), we get \begin{aligned}f\left(-3-1\right)&=f\left(-4\right)\\&=3^{-4}\\&=\frac{1}{3^4}\\&=\frac{1}{81}\end{aligned}

Substituting x=-2 into f\left(x-1\right), we get f\left(-2-1\right)=f\left(-3\right). From the table that was given, we know f\left(-3\right)=\frac{1}{27}. All we need to do is move the element in the previous column and previous row into the next cell.

A table with 3 columns titled x, f of x and f of quantity x minus 1 and with 7 rows. The data by row is as follows: negative 3, 1 over 27, 1 over 81; negative 2, 1 ninth, 1 over 27; negative 1, 1 third, 1 ninth; 0, 1, 1 third; 1, 3, 1; 2, 9, 3; and 3, 27, 9. Arrows from the values in the second column to the third column are shown: from 1 over 27 to 1 over 27, from 1 ninth to 1 ninth, from 1 third to 1 third, from 1 to 1, from 3 to 3, and from 9 to 9.

If we keep substituting values of x into f\left(x-1\right), we'd see the rest of the values can be found in the previous row and column of the original table.\begin{aligned}x&=-1, f\left(-1-1\right)=f\left(-2\right)\\x&=0,f\left(0-1\right)=f\left(-1\right)\\x&=1,f\left(1-1\right)=f\left(0\right)\\x&=2,f\left(2-1\right)=f\left(1\right)\\x&=3,f\left(3-1\right)=f\left(2\right)\end{aligned}

Let's repeat our process to see if any patterns continue. Substituting x=-3 into f\left(x-2\right), we get \begin{aligned}f\left(-3-2\right)&=f\left(-5\right)\\&=3^{-5}\\&=\frac{1}{3^5}\\&=\frac{1}{243}\end{aligned}

Substituting x=-2 into f\left(x-2\right), we get f\left(-2-2\right)=f\left(-4\right). From our work above, we know f\left(-4\right)=\frac{1}{81}. Again, we can move the element in the previous column and previous row into the next cell.

A table with 4 columns titled x, f of x, f of quantity x minus 1, f of quantity x minus 2, and with 7 rows. The data by row is as follows: negative 3, 1 over 27, 1 over 81, 1 over 243; negative 2, 1 ninth, 1 over 27, 1 over 81; negative 1, 1 third, 1 ninth, 1 over 27; 0, 1, 1 third, 1 ninth; 1, 3, 1, 1 third; 2, 9, 3, 1; and 3, 27, 9, 3. Arrows from the values in the third column to the fourth column are shown: from 1 over 81 to 1 over 81, from 1 over 27 to 1 over 27, from 1 ninth to 1 ninth, from 1 third to 1 third, from 1 to 1, and from 3 to 3.

Again, the pattern we found before continues.\begin{aligned}x&=-1, f\left(-1-2\right)=f\left(-3\right)\\x&=0,f\left(0-2\right)=f\left(-2\right)\\x&=1,f\left(1-2\right)=f\left(-1\right)\\x&=2,f\left(2-2\right)=f\left(0\right)\\x&=3,f\left(3-2\right)=f\left(1\right)\end{aligned}

To verify the pattern we saw when completing the first two columns, we will repeat the process one more time. Substituting x=-3 into f\left(x-3\right), we get \begin{aligned}f\left(-3-3\right)&=f\left(-6\right)\\&=3^{-6}\\&=\frac{1}{3^6}\\&=\frac{1}{729}\end{aligned}Substituting x=-2 into f\left(x-3\right), we get f\left(-2-3\right)=f\left(-5\right). From our work above, we know f\left(-5\right)=\frac{1}{243}. Again, we can move the element in the previous column and previous row into the next cell. Since the pattern repeats, we will use it to fill in the rest of the column.

xf\left(x\right)f\left(x-1\right)f\left(x-2\right)f\left(x-3\right)
-3\dfrac{1}{27}\dfrac{1}{81}\dfrac{1}{243}\dfrac{1}{729}
-2\dfrac{1}{9}\dfrac{1}{27}\dfrac{1}{81}\dfrac{1}{243}
-1\dfrac{1}{3}\dfrac{1}{9}\dfrac{1}{27}\dfrac{1}{81}
01\dfrac{1}{3}\dfrac{1}{9}\dfrac{1}{27}
131\dfrac{1}{3}\dfrac{1}{9}
2931\dfrac{1}{3}
327931
b

Describe how the original function is transformed when values are subtracted from x.

Worked Solution
Create a strategy

To determine what happened when we subtracted values from x while building the table, we can focus on what happened to individual points. An easy point to focus on is the y-intercept of the original function, \left(0,1\right).

Apply the idea

After subtracting 1 from x, the point \left(0,1\right) moved to \left(1,1\right). This shows that each value moved to the right 1 unit.

When we subtracted 2 from x, the point \left(0,1\right) moved to \left(2,1\right). This shows that each value moved to the right 2 units. The patten continues, so the y-intercept of the original function moved to the right 3 units when we subtracted 3 from x.

Analyzing what has happened to the rest of the points, we can see that each of the y-values have been shifted to subsequent x-values, translating each point to the right. So for f\left(x-c\right), f\left(x\right) is translated c units to the right.

Reflect and check

We can see this transformation clearly if we draw the graphs of the functions:

-5
-4
-3
-2
-1
1
2
3
4
5
x
-1
1
2
3
4
5
6
7
8
9
10
11
y

Example 2

Consider the parent absolute value function, f\left(x\right)=\left|x\right|.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
a

Reflect f\left(x\right) across the x-axis.

Worked Solution
Create a strategy

All the points on the parent graph are above the x-axis. To refect the function across the x-axis, we need to move each point below the x-axis. Each point should be the same distance below the axis as they were above the axis.

Apply the idea

The point \left(-4,4\right) is 4 units above the x-axis. After reflecting the point, it should be 4 units below the x-axis.

Similarly, the point \left(-2,2\right) is 2 units above the x-axis. After reflecting the point, it should be 2 units below the x-axis.

Doing the same for each point on the graph, we get the blue graph shown below.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
b

Create a table of values for f\left(x\right) and its reflection, g\left(x\right).

Worked Solution
Create a strategy

Graphing both functions on the same coordinate plane can help us observe the points on the graphs easier.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Apply the idea
x-4-3-2-101234
f\left(x\right)432101234
g\left(x\right)-4-3-2-10-1-2-3-4
c

Use the table to create an equation for g\left(x\right).

Worked Solution
Create a strategy

To create an equation for g\left(x\right), we can use f\left(x\right) as a starting point. We will compare the outputs of both functions to determine what has changed, then apply the change to the equation of f\left(x\right).

Apply the idea

When comparing the outputs of both functions, we can see that the y-values of f\left(x\right) are all positive while the y-values of g\left(x\right) are all negative. In other words, the outputs of g\left(x\right) can be obtained by multiplying the outputs of f\left(x\right) by -1. In function notation, this can be represented by g\left(x\right)=-1\cdot f\left(x\right).

Therefore, the equation for g\left(x\right) is \begin{aligned}g\left(x\right)&=-1\cdot f\left(x\right)\\&=-1\cdot\left|x\right|\\&=-\left|x\right|\end{aligned}

Example 3

The drama club is trying to raise money for a field trip to see a Broadway musical. To raise the money, they decided to set up a face-painting stand during the high-school football game. The function {R\left(x\right)=8.5x} represents their revenue in dollars where x represents the number of faces painted.

a

The club members spent \$45 on face-painting supplies. Write the function P\left(x\right) that represents their profit.

Worked Solution
Create a strategy

Profit is calculated by subtracting cost from the revenue.

Apply the idea

P\left(x\right)=8.5x-45

b

Graph R\left(x\right) and P\left(x\right) on the same coordinate plane.

Worked Solution
Create a strategy

R\left(x\right) has a y-intercept at \left(0,0\right), and P\left(x\right) has a y-intercept at \left(0,-45\right). They both have the same slope of m=\dfrac{8.5}{1}. We can graph both functions by plotting the y-intercepts and using the slope to find other points for each line.

To graph the functions using the slope, we can rewrite the slope as m=\dfrac{8.5}{1}=\dfrac{17}{2}. This allows us to work with whole number values when counting the rise and the run.

Apply the idea
-8
-6
-4
-2
2
4
6
8
x
-40
-30
-20
-10
10
20
30
40
y
c

Describe the transformation applied to R\left(x\right) to get P\left(x\right).

Worked Solution
Create a strategy

We have subtracted 45 from the revenue function which can be represented by P\left(x\right)=R\left(x\right)-45. Also, the graphs have the same slope which makes them parallel. The only difference between them are their y-intercepts, meaning a translation has occurred.

Apply the idea

R\left(x\right) has been translated down 45 units to get P\left(x\right).

Reflect and check

In context, this means that the revenue is decreased by the costs of the supplies, and that is how we get the profit function.

Idea summary

Reflections and translations are ways a function can be transformed. These transformations are considered rigid transformations because only the position of the function changes. The shape of the function does not change.

Reflections and translations can be summarized as follows:

A figure showing a summary of reflections and translations: a f of x, when a is greater than 0: no reflection, when a is less than 0: reflection across the x-axis; f of b x, when b is greater than 0: no reflection, when b is less than 0: reflection across the y-axis; f of x plus k, when k is greater than 0: vertical translation up, when k is less than 0: vertical translation down; and f of quantity x minus h, when h is greater than 0: horizontal translation up, when h is less than 0: horizontal translation down.

Stretches and compressions of functions

Exploration

Move the sliders to see how each one affects the graph. Choose different functions to compare the affects across the various graphs.

Loading interactive...
  1. What happens to the graph when \left|a\right|>1?
  2. What happens to the graph when 0<\left|a\right|<1?
  3. What happens to the graph when 0<\left|b\right|<1?
  4. What happens to the graph when \left|b\right|>1?
Vertical compression

A transformation that scales all of the y-values of a function by a constant factor towards the x-axis

Vertical stretch

A transformation that scales all of the y-values of a function by a constant factor away from the x-axis

A vertical compression or stretch can be represented algebraically by g\left(x\right) = af\left(x\right)where 0 < \left|a\right| < 1 corresponds to a compression and \left|a\right| > 1 corresponds to a stretch.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Vertical compression with scale factor of 0.5: {g\left(x\right) = 0.5f\left(x\right)}
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Vertical stretch with a scale factor of 2: {g\left(x\right) = 2f\left(x\right)}
Horizontal compression

A transformation that scales all of the x-values of a function by a constant factor toward the y-axis

Horizontal stretch

A transformation that scales all of the x-values of a function by a constant factor away from the y-axis

A horizontal compression or stretch can be represented algebraically by g\left(x\right) = f\left(bx\right)where \left|b\right| > 1 corresponds to a compression and 0 < \left|b\right| < 1 corresponds to a stretch.

For horizontal stretches and compressions, b=\dfrac{1}{\text{scale factor}}.

-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Horizontal compression with a scale factor of 0.5: {g\left(x\right)=f\left(2x\right)}
-4
-3
-2
-1
1
2
3
4
x
-4
-3
-2
-1
1
2
3
4
y
Horizontal stretch by a scale factor of 2: {g\left(x\right)=f\left(0.5x\right)}

Examples

Example 4

Consider the table of values below.

x-3-2-10123
f\left(x\right)3210123
g\left(x\right)1\frac{2}{3}\frac{1}{3}0\frac{1}{3}\frac{2}{3}1
a

Describe how f\left(x\right) has been transformed to get g\left(x\right).

Worked Solution
Create a strategy

The outputs of f\left(x\right) and g\left(x\right) are not the same. If we can find a relationship between the outputs, then we will know that a vertical stretch or compression was applied.

Apply the idea

The outputs of g\left(x\right) are \frac{1}{3} of the outputs of f\left(x\right). This means a vertical compression by a factor of \frac{1}{3} has been applied to f\left(x\right) to get g\left(x\right).

b

Create an equation for g\left(x\right).

Worked Solution
Create a strategy

In part (a), we found that the outputs of f\left(x\right) were multiplied by \frac{1}{3} to get the outputs of g\left(x\right). In function notation, this can be written as g\left(x\right)=\frac{1}{3}f\left(x\right) Now, we need to analyze the table from part (a) to determine the equation of f\left(x\right).

Apply the idea

Looking at the outputs of f\left(x\right), we can see that they have an average rate of change of -1 or 1. This means it is an absolute value function. The vertex is at the origin, so f\left(x\right)=\left|x\right|.

Therefore, the equation for g\left(x\right) is

\displaystyle g\left(x\right)\displaystyle =\displaystyle \frac{1}{3}f\left(x\right)
\displaystyle =\displaystyle \frac{1}{3}\left|x\right|
Reflect and check

Graphing both functions on the same coordinate plane will help us clearly see the transformation and check our work.

-3
-2
-1
1
2
3
x
1
2
3
4
5
6
7
y

Example 5

The exponential functions f\left(x\right) and g\left(x\right) are represented on the given graph.

-3
-2
-1
1
2
3
4
5
x
2
4
6
8
10
12
14
16
18
y
a

Describe the type of transformation that transforms f\left(x\right) to g\left(x\right).

Worked Solution
Create a strategy

Both functions have the same y-intercept which tells us a translation has not taken place. We can look at the x- and y-values of other key points and build a table of values to help describe which transformation has taken place.

Apply the idea

First, we can look at the change in y-values by identifying points on the graph that have the same x-values. If there has been a vertical stretch or compression, the y-values would have been multiplied by the same number.

-3
-2
-1
1
2
3
4
5
x
2
4
6
8
10
12
14
16
18
y

When x=1, the output of f\left(x\right) was multiplied by 2 to get the output of g\left(x\right).

But when x=2, the output of f\left(x\right) was multiplied by 4 to get the output of g\left(x\right).

This means a vertical stretch or compression was not applied to f\left(x\right).

We now know that a horizontal transformation was applied, but we still need to analyze the x-values of the functions to determine how they changed.

-3
-2
-1
1
2
3
4
5
x
2
4
6
8
10
12
14
16
18
y

When y=2, the x-value of g\left(x\right) is \frac{1}{2} the x-value of f\left(x\right).

When y=8, the x-value of g\left(x\right) is \frac{1}{2} the x-value of f\left(x\right).

When y=16, the x-value of g\left(x\right) is \frac{1}{2} the x-value of f\left(x\right).

This shows that a horizontal compression by a factor of \frac{1}{2} was applied to f\left(x\right) to get g\left(x\right).

b

Write an equation for g\left(x\right) in terms of f\left(x\right).

Worked Solution
Create a strategy

In part (a), we found that the x-values of g\left(x\right) were \frac{1}{2} the x-values of f\left(x\right). However, the equation will be written in terms of the outputs, so we need to determine the relationship between the inputs and outputs of both functions.

Building a table of values can help us understand what is happening to the outputs.

Apply the idea
xf\left(x\right)g\left(x\right)
011
124
2416
38
416

Looking at the table, we see that g\left(1\right)=4. To get the equivalent output from f\left(x\right), x would need to be 2. In other words, the input of g\left(x\right) must be multiplied by 2 to get the equivalent output from f\left(x\right). g\left(1\right)=f\left(2\cdot 1\right) We will look at the next output of g\left(x\right) to determine if this relationship continues. The next point is g\left(2\right)=16. To get the equivalent output from f\left(x\right), x would need to be 4. In other words, the input of g\left(x\right) must be multiplied by 2 to get the equivalent output from f\left(x\right). g\left(2\right)=f\left(2\cdot 2\right)

Because the pattern continues, this relationship can be generalized as g\left(x\right)= f\left(2\cdot x\right).

Reflect and check

By analyzing the outputs on the graph of f\left(x\right), we can determine the equation is f\left(x\right)=2^x. This means the equation for g\left(x\right) is

\displaystyle g\left(x\right)\displaystyle =\displaystyle f\left(2x\right)
\displaystyle =\displaystyle 2^{2x}

This equation can also be written as g\left(x\right)=4^x.

Idea summary

Stretches and compressions are other ways a function can be transformed. The shape of of the function changes when these transformations are applied.

Stretches and compressions can be summarized as follows:

A figure showing a summary of stretches and compression: a f of x, when absolute value of a is greater than 1: vertical stretch, when absolute value of a is greater than 0 but less than 1: vertical compression; f of b x, when absolute value of b is greater than 1: horizontal compression, when absolute value of b is greater than 0 but less than 1: horizontal stretch.

Outcomes

F.BF.A.1.B

Combine standard function types using arithmetic operations.

F.BF.B.3

Identify the effect on the graph of replacing f(x) by f(x) + k, kf(x), f(kx), and f(x + k) for specific values of k (both positive and negative); find the value of k given the graphs. Experiment with cases and illustrate an explanation of the effects on the graph using technology. Include recognizing even and odd functions from their graphs and algebraic expressions for them.

What is Mathspace

About Mathspace