6.7 Transformation of Functions

Often when given a problem, we try to model the scenario using mathematics in the form of words, tables, graphs and equations in order to explain or solve it. When building models, it is often helpful to build off of existing formulas or models.  Knowing the basic graphs of your tool-kit functions can help you solve problems by being able to model new behavior by adapting something you already know.  Unfortunately, the models and existing formulas we know are not always exactly the same as the ones presented in the problems we face.

Fortunately, there are systematic ways to shift, stretch, compress, flip and combine functions to help them become better models for the problems we are trying to solve.  We can transform what we already know into what we need, hence the name, “Transformation of functions.” When we have a story problem, formula, graph, or table, we can then transform that function in a variety of ways to form new functions.

Parent Functions

Before we begin transforming them, let’s review the parent functions that everyone should know.

Function Graph Domain Range
Linear f(x)=x Basic Linear Graph (-\infty,\infty) (-\infty,\infty)
Absolute Value: f(x)=|x| Basic Absolute Value Graph (-\infty,\infty) [0,\infty)
Quadratic: f(x)=x^2 Basic Quadratic Graph (-\infty,\infty) [0,\infty)
Cubic: f(x)=x^3 Basic Cube Graph (-\infty,\infty) (-\infty,\infty)
Square Root: f(x)=\sqrt{x} Basic Square Root Graph [0,\infty) [0,\infty)
Cube Root: f(x)=\sqrt[3]{x} Basic Cube Root Graph (-\infty,\infty) (-\infty,\infty)
Reciprocal: f(x)=\dfrac{1}{x} Basic Reciprocal Graph ( - \infty ,0) \cup (0,\infty ) ( - \infty ,0) \cup (0,\infty )
Reciprocal Squared: f(x)=\dfrac{1}{x^2} Basic Squared Reciprocal Graph ( - \infty ,0) \cup (0,\infty ) (0,\infty )

Knowing these functions, we can consider how to transform them, which creates a much easier way to graph, or sketch many different functions.

Shifts

If we want to look at the function g(x)=x^2+4, we know from graphing quadratic functions that this means the vertex is (0,4) instead of (0,0) which is the vertex of the parent function, f(x)=x^2.  Notice that this moves up the vertex 4 units. Graph of x squared and shift up 4 units

Similarly, we could look at the other points, such as f(1) and g(1), which are 1 and 5 respectively, we see that g(x) is just the graph f(x) moved up 4 units.

This is an example of a vertical shift.  The input values stay the same and only the output values change.  The range also changes.  The range of f(x) is [0,\infty) and the range of g(x) is moved up 4 with the graph to [4,\infty)

Vertical Shift

Given a function f(x), if we define a new function g(x) as
g(x)=f(x)+k, where k is a constant

then g(x) is a vertical shift of the function f(x), where all the output values have been increased by k.

If k is positive, then the graph will shift up
If k is negative, then the graph will shift down

Example of a Vertical Shift with a Function Defined as a Table

A function f(x) is given as a table below.  Create a table for the function g(x)=f(x)-3

x 2 4 6 8
f(x) 1 3 7 11

The formula g(x)=f(x)-3 tells us that we can find the output values of the g function by subtracting 3 from the output values of the f function.  For example,
f(2)=1
g(x)=f(x)-3
g(2)=f(2)-3=1-3=-2

Subtracting 3 from each f(x) value, we can complete a table of values for g(x)

x 2 4 6 8
g(x) -2 0 4 8

As with the earlier vertical shift, notice the input values stay the same and only the output values change.

Try it Now 1

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

The vertical shift is a change to the output, or outside, of the function.  We will now look at how changes to input, on the inside of the function, change its graph and meaning.

Consider the function g(x)=(x-4)^3. In a similar, parent function, f(x)=x^3, there is a point in the center at (0,0). But, in order for g(x) to have an output of 0, x would have to be 4. So we have a point at (4,0).  Now consider, what we would need to have an output of 1.

g(x)=(x-4)^3=1

Take the cube root of both sides:
\sqrt[3]{x-4^3}=\sqrt[3]{1}
x-4=1
x=5

So we have a point at (5,1) for g(x) and (1,1) for f(x)  Notice that now the outputs stay the same, but the inputs change. g(x) is f(x) moved to the right 4 units as seen below:

graph of x-cubed and shifted right 4 units

Horizontal changes or “inside changes” affect the domain of a function (the input) instead of the range and often seem counter-intuitive.  The new function g(x) uses the same outputs as f(x), but matches those outputs to inputs 4 units less than those of f(x).  Said another way, we must add 4 to the input of f to find the corresponding output for g(x)g(x)=f(x+4).

Horizontal Shift

Given a function f(x), if we define a new function g(x) as
g(x)=f(x-h), where h is a constant
then g(x) is a horizontal shift of the function f(x)
If h is positive, then the graph will shift right
If h is negative, then the graph will shift left

Example of a Horizontal Shift with a Table

A function f(x) is given as a table below. Create a table for the function g(x)=f(x-3)

x 2 4 6 8
f(x) 1 3 7 11

The formula g(x)=f(x-3) tells us that the output values of g are the same as the output value of f with an input value three smaller.  For example, we know that . To get the same output from the g function, we will need an input value that is 3 larger: We input a value that is three larger for g(x) because the function takes three away before evaluating the function f.

g(5) = f(5 - 3) = f(2) = 1

x 5 7 9 11
g(x) 1 3 7 11

The result is that the function g(x) has been shifted to the right by 3. Notice the output values for g(x) remain the same as the output values for f(x) in the chart, but the corresponding input values, x, have shifted to the right by 3:  2 shifted to 5, 4 shifted to 7, 6 shifted to 9 and 8 shifted to 11.

Example of a Horizontal Shift with a Graph

The graph shown is a transformation of a parent function .  Relate this new function g(x) to f(x), and then find a formula for g(x).Graph of Parabola with vertex at (2,0)

Notice that the graph looks almost identical in shape to the f(x)=x^2 function, but the x values are shifted to the right two units.  The vertex used to be at (0, 0) but now the vertex is at (2, 0) .  The graph is the basic quadratic function shifted two to the right, so g(x)=f(x-2)

Notice how we must input the value x = 2, to get the output value y = 0;  the x values must be two units larger, because of the shift to the right by 2 units.

We can then use the definition of the f(x) function to write a formula for g(x) by evaluating f(x-2) :
Since f(x)=x^2 and g(x)=f(x-2)
g(x)=f(x-2)=(x-2)^2

Notice how the domain and range are the same for this function. The domain is subject to change with horizontal shifts, but in this case, both are all real numbers or (-\infty,\infty)

If you find yourself having trouble determining whether the shift is +2 or -2, it might help to consider a single point on the graph.  For a quadratic, looking at the vertex is convenient.  In the original function, f(0)=0.  In our shifted function, g(2)=0. To obtain the output value of 0 from the f function, we need to decide whether a +2 or -2 will work to satisfy g(2)=f(2?2)=f(0)=0.  For this to work, we will need to subtract 2 from our input values.

When thinking about horizontal and vertical shifts, it is good to keep in mind that vertical shifts are affecting the output values of the function, while horizontal shifts are affecting the input values of the function.

Example of an Application with a Shift

The function G(m) gives the number of gallons of gas required to drive m miles.  Interpret  G(m)+10 and G(m+10) .

G(m)+10 is adding 10 to the output gallons.  This is 10 gallons of gas more than is required to drive m miles. So, this is the gas required to drive m miles, plus another 10 gallons of gas, or maybe the amount of gas required to drive m miles and have 10 gallons left in the tank.

G(m+10) is adding 10 to the input, miles.  This is the number of gallons of gas required to drive 10 miles more than m miles. So this might be what you want if you want to give yourself a 10 mile buffer before you run out of gas.

Try it Now 2

Given the function f(x)=\sqrt{x}  graph the original function f(x) and the transformation g(x)=f(x+2) .
a. Is this a horizontal or a vertical change?
b. Which way is the graph shifted and by how many units?
c. Graph f(x) and g(x) on the same axes.
d. What is the domain and range of g(x)?

Now that we have two transformations, we can combine them together.

Reminder

Vertical Shifts are outside changes that affect the output (vertical) axis values shifting the transformed function up or down. Up if the constant is added, down if subtracted.

Horizontal Shifts are inside changes that affect the input (horizontal) axis values shifting the transformed function left or right. Right if the constant is subtracted and left if it is added.

Examples of a Functions Shifted both Horizontally and Vertically

Given f(x) = \left| x \right|, sketch a graph of h(x) = \left| x+1 \right|- 3 and give the new domain and range.

The function f  is our parent absolute value function.  We know that this graph has a V shape, with the point at the origin.  The graph of h has transformed f  in two ways: \left| x+1 \right|  is a change on the inside of the function, giving a horizontal shift left by 1, then the subtraction by 3 in \left| x+1 \right|- 3.  is a change to the outside of the function, giving a vertical shift down by 3.  Transforming the graph gives:

Graph of absolute value function shift left 1 unit and down 3

The domain of the transformed function is still (-\infty,\infty), but the range has changed to [3,\infty).

b.Write a formula for the graph shown, a transformation of the parent square root function.Square root function shifted 1 right and 2 up

The graph of the parent function starts at the origin, so this graph has been shifted 1 to the right, and up 2.  In function notation, we could write that as h(x)=f(x-1)+2.  Using the formula for the square root function we can write h(x)=\sqrt{x-1}+2

Note that this transformation has changed the domain and range of the function.  This new graph has domain [1,\infty) and range [2,\infty).

Reflections

Another transformation that can be applied to a function is a reflection over the horizontal or vertical axis.

Examples

Reflect the graph of s(t)=\sqrt{t} both vertically and horizontally.

Reflecting the graph vertically, each output value will be reflected over the horizontal t axis:

square root parent function      \longrightarrow square root function reflected on the horizontal axis

Since each output value is the opposite of the original output value, we can write:
V(t)=-s(t)
V(t)=-\sqrt{t}

Notice this is an outside change or vertical change that affects the output s(t) values so the negative sign belongs outside of the function.

Reflecting horizontally, each input value will be reflected over the vertical axis.Horizontally reflected graph of the square root function

Since each input value is the opposite of the original input value, we can write:
H(t)=s(-t)
H(t)=\sqrt{-t}

Notice this is an inside change or horizontal change that affects the input values so the negative sign is on the inside of the function.

Note that these transformations can affect the domain and range of the functions. While the original square root function has domain [0,\infty) and range [0,\infty), the vertical reflection gives the V(t) function the range (-\infty,0], and the horizontal reflection gives the H(t) function the domain (-\infty,0]. (Because in order to take the square root of -t, t must be negative, for example, -2, as -(-2)=2.

Reflections

Given a function f(x), if we define a new function g(x) as

g(x)=-f(x),

then g(x) is a vertical reflection of the function f(x), sometimes called a reflection about the x-axis or horizontal axis.

If we define a new function g(x) as

g(x)=f(-x),

then g(x) is a horizontal reflection of the function f(x), sometimes called a reflection about the y-axis or vertical axis.

Example of Reflections with Functions defined as Tables

A function f(x) is given as a table below. Create a table for the function g(x)=-f(x) andh(x)=f(-x)

x 2 4 6 8
f(x) 1 3 7 11

For g(x), this is a vertical reflection, so the x values stay the same and each output value will be the opposite of the original output value:

x 2 4 6 8
g(x) -1 -3 -7 -11

For h(x), this is a horizontal reflection, and each input value will be the opposite of the original input value and the h(x) values stay the same as the f(x) values:

x -2 -4 -6 -8
h(x) 1 3 7 11

Try it Now 3

Given the parent function f(x)=x^2, graph g(x) = −f(x)  and h(x) = f(−x). Do you notice anything surprising?

Stretches and Compressions

With shifts, we saw the effect of adding or subtracting to the inputs or outputs of a function.  We now explore the effects of multiplying the inputs or outputs.

Remember, we can transform the inside (input values) of a function or we can transform the outside (output values) of a function. Each change has a specific effect that can be seen graphically.

Consider the function g(x)=2\sqrt[3]{x}. In the parent function, f(x)=\sqrt[3]{x}, the point in the center at (0,0) is still there in g(x). However, what about an input of 1, the parent function has the point (1,1), but g(x) multiplies it by 2, so the point is at (1,2). If we consider an input at 8, the parent function has a point at (8,2), but g(x) is (8,4). So the output is doubled each time. This is a vertical stretch as seen below:
graph of vertical stretch by 2 of cube root function

Vertical Stretch and Compression

Given a function f(x), if we define a new function g(x) as

g(x)=kf(x), where k is a constant
then g(x) is a vertical stretch or compression of the function f(x).

If k > 1, then the graph will be stretched
If 0<k<1, then the graph will be compressed
If k < 0, then there will be combination of a vertical stretch or compression with a vertical reflection

Example of a Vertical Compression with a Table

A function f(x) is given as a table below. Create a table for the function g(x)=\dfrac{1}{2}f(x)

x 2 4 6 8
f(x) 1 3 7 11

The formula g(x)=\dfrac{1}{2}f(x) tells us that the output values of g are half the output values of f with the same inputs. For example, we know that f(4)=3, so g(4)=\dfrac{1}{2}f(4)=\dfrac{1}{2}(3)=\dfrac{3}{2}

x 2 4 6 8
g(x) 1/2 3/2 7/2 11/2

The result is that the function g(x) has been compressed vertically by ½.  Each output value has been cut in half, so the graph would now be half the original height.

Example of a Vertical Stretch/Compression of a Graph

The graph shown is a transformation of the parent function f(x)=x^3. Transformation of x^3Relate this new function g(x) to f(x), then find a formula for g(x).

When trying to determine a vertical stretch or shift, it is helpful to look for a point on the graph that is relatively clear.  In this graph, it appears that g(2)=2  With the basic cubic function at the same input, f(2) = {2^3} = 8

Based on that, it appears that the outputs of g are ¼ the outputs of the function f, since
g(2)=\dfrac{1}{4}f(2)

From this we can fairly safely conclude that:
g(x)=\dfrac{1}{4}f(x)

We can write a formula for g by using the definition of the function f
g(x)=\dfrac{1}{4}f(x)=\dfrac{1}{4}x^3

Try it Now 4

Use the parent function f(x)=|x| to graph g(x)=-3|x| and give the domain and range of g(x).

Horizontal stretches and compressions are also possible, but we can usually re-write the function so that this is a vertical stretch or compression.   For example, a horizontal compression of the function f(x)=x^2  by ½ would result in a new function g(x)=(2x)^2, but this can also be written as g(x)=4x^2, a vertical stretch of f(x) by 4.  When writing a formula for a transformed parent function, we only need to find one transformation that would produce the graph.

Combining Transformations

When combining transformations, it is very important to consider the order of the transformations.  For example, vertically shifting by 3 and then vertically stretching by 2 does not create the same graph as vertically stretching by 2 then vertically shifting by 3.

When we see an expression like 2f(x)+3, which transformation should we start with?  The answer here follows nicely from order of operations, for outside transformations.  Given the output value of f(x), we first multiply by 2, causing the vertical stretch, then add 3, causing the vertical shift.  (Multiplication before Addition)

Combining Vertical Transformations

When combining vertical transformations written in the form af(x)+k,

first vertically stretch by a, then vertically shift by k.

Horizontal transformations are a little trickier to think about.  When we write g(x)=f(3-x) for example, we have to think about how the inputs to the g function relate to the inputs to the f function.  Suppose we know f(7)=12.  What input to g would produce that output?  In other words, what value of x will allow g(x)=f(3-x)=f(12)?  We would need 3-x=12.  To solve for x, we would first subtract 3, resulting in horizontal shift, then multiply by -1, causing a horizontal reflection.

Independence of Horizontal and Vertical Transformations

Horizontal and vertical transformations are independent.  It does not matter whether horizontal or vertical transformations are done first.

Example of Several Transformations with a Table

Given the table of values for the function f(x) below, create a table of values for the function g(x)=3f(x+2)+1

x 6 12 18 24
f(x) 10 14 15 17

There are 3 steps to this transformation and we will work from the inside out.  Starting with the horizontal transformations,  is a horizontal shift to the left by 2, which means we subtract each x value by 2.

x 4 10 16 22
f(x+2) 10 14 15 17

Looking now to the vertical transformations, we start with the vertical stretch, which will multiply the output values by 3.  We apply this to the previous transformation.

x 4 10 16 22
3f(x+2) 30 42 45 51

Finally, we can apply the vertical shift, which will add 1 to all the output values.

x 4 10 16 22
3f(x+2)+1 31 43 46 52

 

Example of Multiple Transformation of a Graph

Use the parent function f(x)=\dfrac{1}{x}, sketch a graph of g(x)=\dfrac{-1}{2(x-3)}-1

First, we see that 2 in the denominator and we did not cover horiztonal stretches, so we will change this slightly to g(x)=-\dfrac{1}{2} \cdot  \dfrac{1}{x-3}. This makes a little easier to see that the -1/2 is just a vertical compression and reflection.

See the animation below: We begin with our parent function: f(x)=\dfrac{1}{x}.

Let’s start with our horizontal (inside) transformation and graph \dfrac{1}{x-3} which is just a shift of 3 to the left.

Then, we will do our vertical transformations, starting with a vertical compression by 1/2 and then a reflection across the x-axis.

Finally we have the vertical shift of 1 unit down.

Example Writing a Transformed Function from the Graph

Write an equation for the transformed graph functionTransformed Parabola with vertex at (3,1) shown and give the domain and range.

This looks like a parabola so let’s try our parent function f(x)=x^2

Observing the graph, we notice several transformations:

The original parent function has been flipped over the x axis, a vertical stretch has occurred, and we can see a shift to the right 3 units and a shift up 1 unit.

In total there are four operations:

  • Vertical reflection, requiring a negative sign outside the function
  • Vertical Stretch of 2 (remember that concave down parabolas start with over 1 down 1, this one is over 1, down 2)
  • Horizontal Shift Right 3 units, which tells us to put x-3 on the inside of the function
  • Vertical Shift up 1 unit, telling us to add 1 on the outside of the function

So this takes our parent function,  f(x)=x^2:

  • First do the horizontal shift f(x-3)=(x-3)^2
  • Now the Stretch: 2f(x-3)=2(x-3)^2
  • Now the Reflection: -2f(x-3)=-2(x-3)^2
  • And now the vertical shift: -2f(x-3)+1=-2(x-3)^2+1

This looks familiar, it is the vertex form of a parabola!  If you had trouble figuring out the transformations, that’s okay. We can still find the formula for a parabola using the techniques we discussed in chapter 5. All we need is the vertex and another point.

The domain is still (-\infty,\infty) but the range is now (-\infty,1]

Try it Now 5

a. Try graphing 2\sqrt{x+1}+3 and give the domain and range.

b. Try to figure out the what the parent function (it’s one of the ones at the beginning of the section) and transformations are, figure out the domain and range and write an equation for this graph:

Graph of a transforms squared reciprocal

Try it Now Answers

  1. b(t)=h(t)+10=-4.9t^2+30t+10
  2. a. Horizontal shift
    b. The function is shifted to the LEFT by 2 units
    c.

    Try in Now answer graph 2c
    Answer Graph 2c

    d. Domain: [-2,\infty) Range:[0,\infty)

  3. Notice h(x)=f(-x) looks the same as f(x)
    Try in Now 3 Answer Graph shows x^2 and -x^2
    Answer Graph 3

     

  4. Domain: (-\infty,\infty)   Range: (-\infty,0]
    Try it Now 4 Answer Graph
    Answer Graph 4
  5. a. Domain: [-1,\infty)  Range: [3,\infty)
    Try it Now Answer 5a
    Answer Graph 5a

    b. The parent function is the square reciprocal: f(x)=\dfrac{1}{x^2}. It is shifted right 2 units, reflected on the x-axis and up 3: g(x)=-\left(\frac{1}{x-2}\right)^{2}+3

    Domain: (-\infty,2) \cup (2,\infty)   Range: (-\infty,3)

 

Media Attributions

  • linear
  • absvalue
  • square
  • cubic
  • sqroot
  • cuberoot
  • recip
  • squaredrecip
  • graphofverticalshift
  • graphofhorizshift
  • 66example6
  • Reminder is licensed under a Public Domain license
  • 67example1
  • 67example2
  • 67example3
  • 67example4
  • 67example5
  • graphofvertstretch
  • 67example7
  • 67example6
  • TIN67
  • tinasnwer672
  • tinanswer673
  • tinanswer674
  • tinanswer675

License

Icon for the Creative Commons Attribution-ShareAlike 4.0 International License

College Algebra for the Managerial Sciences Copyright © by Terri Manthey is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book