topic badge

3.05 Transformations of functions

Lesson

We have now studied the graphs and forms of many functions, including:

Function Base form Transformed
Quadratic $y=x^2$y=x2 $y=a\left(x-h\right)^2+k$y=a(xh)2+k
Cubic $y=x^3$y=x3 $y=a\left(x-h\right)^3+k$y=a(xh)3+k
Hyperbola $y=\frac{1}{x}$y=1x $y=\frac{a}{x-h}+k$y=axh+k
Square root $y=\sqrt{x}$y=x $y=a\sqrt{x-h}+k$y=axh+k

As we have experimented with applets and summarised the effects of $a$a, $h$h and $k$k for each type of function, did you notice that each variable always had the same effect?

We found that:

  • $a$a dilates (stretches) the graph by a factor of $a$a from the $x$x-axis
  • When $a<0$a<0 the graph was reflected over the $x$x-axis
  • $h$h translates the graph $h$h units horizontally
  • $k$k translates the graph $k$k units vertically

These transformations work in the same way for a general function $f\left(x\right)$f(x). Let's go through them and summarise now.

 

If we start with a base function $y_1=f\left(x\right)$y1=f(x), what effect does multiplying the function by $a$a have and why? In other words, how will the graph of the function $y_2=af\left(x\right)$y2=af(x) compare to the graph of $y_1$y1?

Let's take a quick look at the functions $y_1=x^2$y1=x2 and $y_2=2x^2$y2=2x2:

$x$x $-3$3 $-2$2 $-1$1 $0$0 $1$1 $2$2 $3$3
$y_1=x^2$y1=x2 $9$9 $4$4 $1$1 $0$0 $1$1 $4$4 $9$9
$y_2=2x^2$y2=2x2 $18$18 $8$8 $2$2 $0$0 $2$2 $8$8 $18$18

The $y$y-values for $y_2$y2 were all double that of $y_1$y1. This would have the effect of stretching the graph by a factor of $2$2 vertically (or from the $x$x-axis). As we are only multiplying the $y$y-coordinate of each point, we are not changing the horizontal location of any key features.

More generally if $y_1=f\left(x\right)$y1=f(x) has points $\left(x,f\left(x\right)\right)$(x,f(x)) then $y_2=af\left(x\right)$y2=af(x) will have coordinates $\left(x,af\left(x\right)\right)$(x,af(x)). Since we are multiplying the $y$y-coordinate by $a$a, this will stretch the graph by a factor of $a$a vertically.

 

We can also see that coordinates of $y_1=f\left(x\right)$y1=f(x) compared to $y_2=-f\left(x\right)$y2=f(x) will have $y$y-coordinates that differ only by their sign (one is multiplied by $-1$1 to give the other). This will make the point the same distance but the opposite side of the $x$x-axis. This will cause the graph to retain its shape but be reflected across the $x$x-axis.

 

How about $y_1=f\left(x\right)$y1=f(x) compared to $y_2=f\left(x\right)+k$y2=f(x)+k? Coordinates of $y_2$y2 are $\left(x,f\left(x\right)+k\right)$(x,f(x)+k), so we have added a constant value to each $y$y-coordinate. This will shift the whole graph vertically by $k$k units.

 

Now let's compare $y_1=f\left(x\right)$y1=f(x) to $y_2=f\left(x-h\right)$y2=f(xh). Consider the case where $y_1=x^2$y1=x2 and $y_2=\left(x-2\right)^2$y2=(x2)2. Let's compare their tables of values to understand the change:

$x$x $-3$3 $-2$2 $-1$1 $0$0 $1$1 $2$2 $3$3
$y_1=x^2$y1=x2 $9$9 $4$4 $1$1 $0$0 $1$1 $4$4 $9$9
$x$x $-1$1 $0$0 $1$1 $2$2 $3$3 $4$4 $5$5
$y_2=\left(x-2\right)^2$y2=(x2)2 $9$9 $4$4 $1$1 $0$0 $1$1 $4$4 $9$9

We can see the graphs have the same $y$y-coordinates but where these values occur is now shifted $2$2 to the right for the $x$x-coordinate.

In general, in comparison to the graph of $y_1=f\left(x\right)$y1=f(x) the graph of $y_2=f\left(x-h\right)$y2=f(xh) will be translated $h$h units horizontally.

 

We can also reflect across the $y$y-axis and dilate in the horizontal direction (from the $y$y-axis). Below is a summary of the transformations for a general function $f\left(x\right)$f(x):

Transformation Effect on graph Effect on coordinates
$-f\left(x\right)$f(x) reflects $f\left(x\right)$f(x) across the $x$x-axis multiplies $y$y-coordinate by $-1$1
$af\left(x\right)$af(x) dilates $f\left(x\right)$f(x) by a factor of $a$a from the $x$x-axis multiplies $y$y-coordinate by $a$a
$f\left(x\right)+k$f(x)+k translates $f\left(x\right)$f(x) by $k$k units vertically adds $k$k to each $y$y-coordinate
$f\left(x-h\right)$f(xh) translates $f\left(x\right)$f(x) by $h$h units horizontally adds $h$h to each $x$x-coordinate
$f\left(-x\right)$f(x) reflects $f\left(x\right)$f(x) across the $y$y-axis multiplies $x$x-coordinate by $-1$1
$f\left(ax\right)$f(ax) dilates $f\left(x\right)$f(x) by a factor of $\frac{1}{a}$1a from the y-axis divides $x$x-coordinates by $a$a

Consider some examples of functions that you are familiar with, and try to justify the last two lines in the summary table.

 

Transformation of relations

The circle centred on the origin with radius $2$2 has the equation $x^2+y^2=4$x2+y2=4.

Suppose we replace $x$x with $\left(x-15\right)$(x15) and $y$y with $\left(y-9\right)$(y9), so that our new equation becomes $\left(x-15\right)^2+\left(y-9\right)^2=4$(x15)2+(y9)2=4. The two relations are shown in the image below:

The change from $x$x to $\left(x-15\right)$(x15) and from $y$y to $\left(y-9\right)$(y9) caused the circle to shift to the right by $15$15 units and upward by $9$9 units. The centre moved from $\left(0,0\right)$(0,0) to $\left(15,9\right)$(15,9) and the radius (and thus the overall shape of the circle) remained unchanged.

More generally, for any relation in terms of $x$x and $y$y, we can make the substitution of $\left(x-h\right)$(xh) for $x$x and $\left(y-k\right)$(yk) for $y$y to translate the relation $h$h units horizontally and $k$k units vertically.

 

Practice questions

Question 1

How do we shift the graph of $y=f\left(x\right)$y=f(x) to get the graph of $y=f\left(x\right)+4$y=f(x)+4?

  1. Move the graph up by $4$4 units.

    A

    Move the graph down by $4$4 units.

    B

Question 2

How do we shift the graph of $y=g\left(x\right)$y=g(x) to get the graph of $y=g\left(x+6\right)$y=g(x+6)?

  1. Move the graph to the left by $6$6 units.

    A

    Move the graph to the right by $6$6 units.

    B

Question 3

If the graph of $y=-x^2$y=x2 is translated horizontally $6$6 units to the right and translated vertically $5$5 units upwards, what is its new equation?

Question 4

This is a graph of $y=3^x$y=3x.

Loading Graph...
A number plane with the exponential function y=3^x plotted.
  1. How do we shift the graph of $y=3^x$y=3x to get the graph of $y=3^x-4$y=3x4?

    Move the graph $4$4 units to the right.

    A

    Move the graph downwards by $4$4 units.

    B

    Move the graph $4$4 units to the left.

    C

    Move the graph upwards by $4$4 units.

    D
  2. Hence plot $y=3^x-4$y=3x4 on the same graph as $y=3^x$y=3x.

     

    Loading Graph...
    A number plane with the exponential function y=a^x plotted.

Question 5

Suppose that $f$f is a function, and that $\left(9,-12\right)$(9,12) is a point on the graph of $y=f\left(x\right)$y=f(x).

If the function $g$g is given by $g\left(x\right)=6f\left(x\right)$g(x)=6f(x), find the corresponding point on the graph of $y=g\left(x\right)$y=g(x).

  1. Make sure to give your answer as a coordinate pair:

Outcomes

ACMMM025

examine translations and the graphs of y=f(x)+a and y=f(x+b)

ACMMM026

examine dilations and the graphs of y=c f(x) and y=f(kx)

What is Mathspace

About Mathspace