40% off

Ends 15 Aug

Lock in £90

Graph Transformations

Updated July 2026

Knowledge of the effect of simple transformations on the graph of y=f(x)y = f(x) with positive or negative value of aa as represented by y=af(x)y = af(x), y=f(x)+ay = f(x) + a, y=f(x+a)y = f(x + a), y=f(ax)y = f(ax). Compositions of these transformations. Knowledge and use of the notation f(g(x))f(g(x)).

This topic tends to be poorly understood. Usually, when these ideas are first met, students tend to learn the rules without much understanding of what is going on. It is made more tricky by the fact that some of the ways graphs shift tend to be exactly opposite of what you might first expect; for instance, y=f(x+a)y = f(x + a) looks like it ought to shift [translate] the graph of y=f(x)y = f(x) to the right [in the positive xx direction] by a distance aa BUT THAT IS WRONG!!

We will look at each of the case in turn and explain what transformation of y=f(x)y = f(x) each represents and then we will look at a couple of examples.

The first thing to get clear is what the notation means. You are already familiar with the notation y=f(x)y = f(x). This notation tells you that the yy value 'above' [i.e. the yy value for the point on the curve corresponding to the given xx value] any xx value is calculated using f(x)f(x). So, as an example, for y=x2+3y = x^2 + 3 the yy value above x=2x = 2 must be y=22+3=7y = 2^2 + 3 = 7, and similarly the yy value above x=4x = 4 is 19, and so on.

We can use this to understand what the notation in this section means and then use our understanding to deduce how the graphs are related to the graph of y=f(x)y = f(x).

y=af(x)y = a f (x)

We will look at specific example: We will take y=f(x)y = f(x) to be y=x3y = x^3 and we will take a=4a = 4

We want to compare the graphs of y=x3y = x^3 [y=f(x)y = f(x)] with y=4x3y = 4x^3 [y=4f(x)y = 4f(x)]

Here the transformation is reasonably straightforward to grasp: each yy value is four times as big for y=4x3y = 4x^3 than it is for y=x3y = x^3. This is like taking the graph of y=x3y = x^3 and stretching it vertically by a factor of 4, and the vertical stretching is away from the xx axis up [when the yy values are positive] or down [when the yy values are negative]

Here is a diagram of the before and after:

img-78.jpeg

And here is a general diagram

img-79.jpeg

And note that if 0<a<10 < a < 1 then the graphs effectively get less tall: so, if a=12a = \frac{1}{2} then the graphs of y=12f(x)y = \frac{1}{2}f(x) would be half the height of y=f(x)y = f(x)

And if aa is negative the heights change by a|a| and the graphs are flipped by the minus signs.

Exercise

Use a graph drawing package [e.g., DESMOS GRAPHING] to explore the following pairs of functions:

y=f(x)=x2 and y=af(x)=ax2 for a=2,3,1,2,12,12y = f(x) = x^2 \text{ and } y = af(x) = ax^2 \text{ for } a = 2, 3, -1, -2, \frac{1}{2}, -\frac{1}{2}

y=f(x)=cosx and y=af(x)=acosx for a=2,3,1,2,12,12y = f(x) = \cos x \text{ and } y = af(x) = a\cos x \text{ for } a = 2, 3, -1, -2, \frac{1}{2}, -\frac{1}{2}

What do you notice when 0<a<10 < a < 1?

What do you notice when a<0a < 0?

y=f(x)+ay = f(x) + a

We will look at specific example: we will take y=f(x)y = f(x) to be y=x2y = x^2 and we will take a=3a = 3

We want to compare the graphs of y=x2y = x^2 [y=f(x)y = f(x)] with y=x2+3y = x^2 + 3 [y=f(x)+ay = f(x) + a]

If we sketch both graphs [you can do this on DESMOS GRAPHING], we can see that going from y=x2y = x^2 to y=x2+3y = x^2 + 3 all the yy values go up by 3 units. In other words, the graph is shifted up by 3 units ['up' means parallel to the yy-axis]. We can say this more formally by saying that we translate the graph by (03)\binom{0}{3}

In general, y=f(x)+ay = f(x) + a takes the graph of y=f(x)y = f(x) and translates it by (0a)\binom{0}{a}

Exercise

Use a graph drawing package [e.g., DESMOS GRAPHING] to explore the following pairs of functions:

y=f(x)=x2 and y=f(x)+a=x2+a for a=2,3,1,2,12,12y = f(x) = x^2 \text{ and } y = f(x) + a = x^2 + a \text{ for } a = 2, 3, -1, -2, \frac{1}{2}, -\frac{1}{2}

y=f(x)=cosx and y=f(x)+a=a+cosx for a=2,3,1,2,12,12y = f(x) = \cos x \text{ and } y = f(x) + a = a + \cos x \text{ for } a = 2, 3, -1, -2, \frac{1}{2}, -\frac{1}{2}

What do you notice when a<0a < 0?

An aside: note here we have written a+cosxa + \cos x instead of cosx+a\cos x + a as this latter expression is ambiguous – it could mean either (cosx)+a(\cos x) + a, which is what we intend, or it could mean cos(x+a)\cos(x + a) which is not what we intend. This sort of issue is not uncommon with trigonometry so you need to be a little careful with how you write things and how you interpret things – there are usually conventions that all mathematicians follow [for example contrasting cos2x\cos^2 x with cosx2\cos x^2]. A common example is the inverse trigonometric functions, which are often written as, for instance, cos1x\cos^{-1} x. Here the 1-1 is not taken to mean 1cosx\frac{1}{\cos x} [as we might initially expect from our discussion of indices above] but instead the convention is that it means 'the inverse of cos\cos' which is sometimes written as arccos\arccos. Later in your maths courses, you will probably learn things like 'the secant of xx' [or secx\sec x] etc, which are the specific symbols used by mathematicians for 1cosx\frac{1}{\cos x}. In the TMUA/ESAT, we are very careful with the way we use notation to ensure these sorts of ambiguities do not arise; and if there is any potential ambiguity, we make sure we clarify things carefully in the way we phrase a question, or in the way we set out the mathematics.

y=f(x+a)y = f(x + a)

This particular transformation is often poorly understood and can lead to errors. Errors and misunderstandings arise because it seems [perhaps intuitively at first glance?] that if you ADD something to an xx then things should 'shift to the right'; whereas, in fact, the opposite happens – curves shift 'to the left' [when aa is positive]. Of course, you could just learn what happens for this transformation, but it is [much much] better, as always, to understand things. We will unpack this transformation in following discussion: take your time working through our discussion to make sure you develop a good understanding.

There are two things to unpack here. One is how to work out an expression for f(x+a)f(x + a) given f(x)f(x); and the other is to work out how the transformation relates to the graphs of y=f(x)y = f(x) and y=f(x+a)y = f(x + a).

First, let's tackle how to work out an expression for f(x+a)f(x + a) given f(x)f(x). This is straightforward and we can look at a couple of examples to see how it works:

Example

Given f(x)=x2+2x5f(x) = x^2 + 2x - 5 find an expression for f(x+3)f(x + 3)

We do this as follows: every xx in the expression f(x)f(x) is replaced by x+3x + 3:

x2+2x5(x+3)2+2(x+3)5x^2 + 2x - 5 \rightarrow (x + 3)^2 + 2(x + 3) - 5

So f(x+3)=(x+3)2+2(x+3)5f(x + 3) = (x + 3)^2 + 2(x + 3) - 5

Example

Given f(x)=cos(2x)f(x) = \cos(2x) find an expression for f(xπ2)f(x - \frac{\pi}{2})

We do this as follows: every xx in the expression f(x)f(x) is replaced by xπ2x - \frac{\pi}{2}:

f(xπ2)=cos2(xπ2)=cos(2xπ)f\left(x - \frac{\pi}{2}\right) = \cos 2\left(x - \frac{\pi}{2}\right) = \cos(2x - \pi)

We could simplify this further, but the mathematics needed to do so is outside the scope of the TMUA/ESAT. If you sketch y=cos(2xπ)y = \cos(2x - \pi) you might be able to work out what it could simplify to.

In this example, it is quite easy to forget that the 2 in cos(2x)\cos(2x) multiples everything that we replace xx by: so we must have cos2(xπ2)=cos(2xπ)\cos 2\left(x - \frac{\pi}{2}\right) = \cos(2x - \pi) and NOT cos2xπ2\cos 2x - \frac{\pi}{2}

Now you know how to work out an expression for f(x+a)f(x + a) given f(x)f(x), we turn to look at how the graphs of each of y=f(x)y = f(x) and y=f(x+a)y = f(x + a) relate to each other.

First, we need to be very clear what the notation is telling us:

  • y=f(x)y = f(x) tells us that the yy value directly above a given xx is calculated using f(x)f(x)
  • y=f(x+a)y = f(x + a) tells us that the yy value directly above a given xx value is calculated using f(x+a)f(x + a)

Let's check this is clear using an example.

Example

Let's look at:

f(x)=2x and f(x+3)f(x) = 2^x \text{ and } f(x + 3)

If we were to sketch y=f(x)y = f(x) we can calculate the yy values for some xx values:

  • When x=2x = 2, y=22=4y = 2^2 = 4
  • When x=5x = 5, y=25=32y = 2^5 = 32

So if we sketch y=f(x)y = f(x) we would find that when xx is 2 the yy value directly above it would be 4, and when xx is 5 the yy value directly above it would be 32.

Now let's look at what happens if we were to sketch y=f(x+3)y = f(x + 3):

  • When x=2x = 2, the yy value directly above it must f(2+3)f(2 + 3) which is f(5)f(5) and we worked that out to be y=25=32y = 2^5 = 32
  • When x=5x = 5, the yy value directly above it must f(5+3)f(5 + 3) which is f(8)f(8) and we can work that out to be y=28=256y = 2^8 = 256

So [and think about this carefully] the yy value above a given xx value in y=f(x+3)y = f(x + 3) comes from the yy above the xx value that is three units further along on the sketch of y=f(x)y = f(x):

  • The yy value above x=2x = 2 is actually f(2+3)=f(5)f(2 + 3) = f(5)
  • The yy value above x=5x = 5 is actually f(5+3)=f(8)f(5 + 3) = f(8)

We have to translate the graph of y=f(x)y = f(x) to the left to make sure that the yy value above x=2x = 2 in the graph of y=f(x+3)y = f(x + 3) is the one from f(5)f(5) and that the yy value above x=5x = 5 is the one from f(8)f(8).

We can draw a sketch of this to show what is happening:

img-80.jpeg

img-81.jpeg

So, we can now look at this in general terms. If you look at the graph of y=f(x+a)y = f(x + a) then the yy value above an xx value is actually f(x+a)f(x + a) and this is the yy value that is above x+ax + a on the original graph.

This means that the graph of y=f(x+a)y = f(x + a) is the same as the graph of y=f(x)y = f(x) when it is translated backwards parallel to the xx axis a distance of aa. We can say:

y=f(x+a) is the same as the graph of y=f(x) translated by (a0)y = f(x + a) \text{ is the same as the graph of } y = f(x) \text{ translated by } \binom{-a}{0}

And note that if aa is negative [e.g., y=f(x4)y = f(x - 4)] then the graph shifts “to the right” by 4, that is a translation of (40)\binom{4}{0}

It is worth thinking carefully about this transformation – it can seem a little complicated with lots of f(x)f(x) and f(x+a)f(x + a) and yy values flying about. But once you have grasped what is going on, it can all seem very easy and “obvious”.

We strongly recommend you do the following exercise to get used to this transformation.

Exercise

Sketch the following in pairs of functions without using a graphing package, and then check your answers using a graphing package [such as DESMOS GRAPHING]. Think about how each pair of graphs relates to what we discussed above when unpacking the transformation from y=f(x)y = f(x) to y=f(x+a)y = f(x + a)

y=f(x)=x2 and y=f(x+2)=(x+2)2y = f(x) = x^2 \text{ and } y = f(x + 2) = (x + 2)^2

y=f(x)=x2 and y=f(x3)=(x3)2y = f(x) = x^2 \text{ and } y = f(x - 3) = (x - 3)^2

y=f(x)=cosx and y=f(x+π3)=cos(x+π3)y = f(x) = \cos x \text{ and } y = f\left(x + \frac{\pi}{3}\right) = \cos\left(x + \frac{\pi}{3}\right)

y=f(x)=cosx and y=f(x2π3)=cos(x2π3)y = f(x) = \cos x \text{ and } y = f\left(x - \frac{2\pi}{3}\right) = \cos\left(x - \frac{2\pi}{3}\right)

y=f(ax)y = f(ax)

This transformation is very similar to the one we have just looked at. It is initially counter-intuitive but the reason it “squashes” a graph by a factor of aa is “obvious” once you have thought it through with some examples.

We will first look at some examples that illustrate how to find the expression for f(ax)f(ax) given an expression for f(x)f(x); and then we will look at how the graphs of f(ax)f(ax) and f(x)f(x) relate.

Example

Given y=f(x)=x2y = f(x) = x^2 find an expression for f(3x)f(3x)

To find f(3x)f(3x) we replace xx by 3x3x: f(3x)=(3x)2=9x2f(3x) = (3x)^2 = 9x^2

And note that we do NOT write f(3x)=3x2f(3x) = 3x^2

Example

Given y=f(x)=cos(2x+30)y = f(x) = \cos(2x + 30) find an expression for f(4x)f(4x)

As before, we replace every xx in f(x)f(x) by 4x4x to get

f(4x)=cos(2(4x)+30)=cos(8x+30)f(4x) = \cos(2(4x) + 30) = \cos(8x + 30)

Now, let’s turn to look at how the graphs of y=f(x)y = f(x) and y=f(ax)y = f(ax) are related. We will do this using simple examples. You will note that the discussion is similar to that we set out for f(a+x)f(a + x) above.

Example

Let's look at:

f(x)=x33x2+2 and f(2x)f(x) = x^3 - 3x^2 + 2 \text{ and } f(2x)

If we were to sketch y=f(x)y = f(x) we can calculate the yy values for some xx values:

  • When x=1x = -1, y=2y = -2
  • When x=0x = 0, y=2y = 2
  • When x=1x = 1, y=0y = 0
  • When x=2x = 2, y=2y = -2

So, if we sketch y=f(x)y = f(x) we would find that when xx is 1-1 the yy value directly above it would be 2-2, when xx is 22 the yy value directly above it would be 2-2, ...and so on

Now let's look at what happens if we were to sketch y=f(2x)y = f(2x):

  • When x=1x = -1, the yy value directly above it must f(2×1)f(2 \times -1) which is f(2)f(-2) and this is 18-18
  • When x=0x = 0, the yy value directly above it must f(2×0)f(2 \times 0) which is f(0)f(0) and this is 22
  • When x=1x = 1, the yy value directly above it must f(2×1)f(2 \times 1) which is f(2)f(2) and this is 2-2
  • When x=2x = 2, the yy value directly above it must f(2×2)f(2 \times 2) which is f(4)f(4) and this is 1818

So [and think about this carefully] the yy value above a given xx value in y=f(2x)y = f(2x) comes from the yy above the xx value that is twice as large on the xx-axis on the sketch of y=f(x)y = f(x)

We have to 'squash' the graph of y=f(x)y = f(x) towards the yy-axis by a factor of 22.

We can draw some diagrams to show what is happening here:

img-82.jpeg

img-83.jpeg

Exercise

Using a graphing package [such as DESMOS GRAPHING], draw the following pairs of functions:

From the example above: f(x)=x33x2+2f(x) = x^3 - 3x^2 + 2 and f(2x)=(2x)33(2x)2+2f(2x) = (2x)^3 - 3(2x)^2 + 2

Then look at f(x)=x33x2+2f(x) = x^3 - 3x^2 + 2 and f(12x)=(12x)33(12x)2+2f\left(\frac{1}{2}x\right) = \left(\frac{1}{2}x\right)^3 - 3\left(\frac{1}{2}x\right)^2 + 2

What does this tell you about y=f(ax)y = f(ax) when 0<a<10 < a < 1 ?

Now look at f(x)=x33x2+2f(x) = x^3 - 3x^2 + 2 and f(2x)=(2x)33(2x)2+2f(-2x) = (-2x)^3 - 3(-2x)^2 + 2 ; in this, what does the minus sign do in f(2x)f(-2x) and what does the 2 do in f(2x)f(-2x)? Can you explain your answers?

Let's summarise the transformations we have looked at.

af(x)af(x)Vertical [parallel to yy-axis] stretch away from xx-axis by a factor of aa. If a<0a < 0 [i.e., negative] there is a reflection in the xx-axis too.
f(x)+af(x) + aTranslation by (0a)\binom{0}{a}
f(x+a)f(x + a)Translation by (a0)\binom{-a}{0}
f(ax)f(ax)Horizontal [parallel to xx-axis] squash towards yy-axis by a factor of aa. If a<0a < 0 [i.e., negative] there is a reflection in the yy-axis too.

Exercise

Sketch y=f(x)y = |f(x)| and y=f(x)y = f(|x|) for f(x)=sinxf(x) = \sin x and for y=cosxy = \cos x

You can use DESMOS GRAPHING to help you, but try to sketch the graphs without using any graphing packages

Combining these transformations

In this section we will look at some examples where more than one of the transformations listed above is used.

It is important to be very careful when using certain combinations of the transformations above because the order in which you interpret the transformation must be correct.

We will look at this using a test case:

Consider y=f(x)=cosxy = f(x) = \cos x and y=f(2x+π6)=cos(2x+π6)y = f\left(2x + \frac{\pi}{6}\right) = \cos\left(2x + \frac{\pi}{6}\right)

If you were asked to sketch y=cosxy = \cos x and use your sketch to deduce a sketch of y=cos(2x+π6)y = \cos\left(2x + \frac{\pi}{6}\right), it would be tempting to suggest it is

  1. a "horizontal squash" by a factor of 2 followed by a translation by (π6)\left(-\frac{\pi}{6}\right);
  2. or perhaps it is tempting to suggest that it is a translation by (π6)\left(-\frac{\pi}{6}\right) followed by a "horizontal squash" by a factor of 2.

Before reading on, which of the two suggested transformations is the one you would choose? Or would you propose something else instead? You can use a graph sketching package to explore before we look at the answer.

To answer this, we can look at the transformations suggested in stages:

  1. "horizontal squash" by a factor of 2 followed by a translation by (π6)\left(-\frac{\pi}{6}\right):

cosxcos2xcos2(x+π6)=cos(2x+π3)OH NO !!!\cos x \rightarrow \cos 2x \rightarrow \cos 2\left(x + \frac{\pi}{6}\right) = \cos\left(2x + \frac{\pi}{3}\right) \quad \text{OH NO !!!}

  1. translation by (π6)\left(-\frac{\pi}{6}\right) followed by a "horizontal squash" by a factor of 2

cosxcos(x+π6)cos(2x+π6)\cos x \rightarrow \cos\left(x + \frac{\pi}{6}\right) \rightarrow \cos\left(2x + \frac{\pi}{6}\right)

We can see here that 2 gives the correct final answer and 1 gives the incorrect answer. Can you explain why? (If we replace xx by 2x2x first, then the translation by π6\frac{\pi}{6} is also affected by the 2 in the 2x2x.)

We can write the function slightly differently to get another perspective on the transformation:

  1. “horizontal squash” by a factor of 2 followed by a translation by (π12)\left(-\frac{\pi}{12}\right):

cosxcos2xcos2(x+π12)=cos(2x+π6)\cos x \rightarrow \cos 2x \rightarrow \cos 2\left(x + \frac{\pi}{12}\right) = \cos\left(2x + \frac{\pi}{6}\right)

Exercise

Consider the graph of y=f(x)=3xy = f(x) = 3^x

Sketch both y=f(x+2)y = f(x + 2) and y=9f(x)y = 9f(x)

What do you notice? Explain your answer.

Now consider y=f(x)=log10xy = f(x) = \log_{10} x

Sketch both y=f(10x)y = f(10x) and y=1+f(x)y = 1 + f(x)

What do you notice? Explain your answer.

The notation f(g(x))f(g(x)).

We will look briefly at the notation f(g(x))f(g(x)) [which we tend to say as “ff of gg of xx”]

We have been using the ideas connected to this notation already.

Let’s take a simple case to illustrate how to unpack his notation:

Let’s take g(x)=2xg(x) = 2x and f(x)=x2+3x2f(x) = x^2 + 3x - 2

The xx in f(x)f(x) is just a label to tell you what to do with what you input into the function. That is once you are given an input for f(x)f(x), the output is given as (input)2+3×(input)2(input)^2 + 3 \times (input) - 2

So, you can guess what f(g(x))f(g(x)) might mean: it means that you take g(x)g(x) as the input for f(x)f(x). We can write this out:

  1. Replace xx [which labels the input to f(x)f(x)] in f(x)f(x) by g(x)g(x):

f(g(x))=[g(x)]2+3×g(x)2f(g(x)) = [g(x)]^2 + 3 \times g(x) - 2

  1. And then replace g(x)g(x) by 2x2x

f(g(x))=f(2x)=[2x]2+3×2x2=4x2+6x2f(g(x)) = f(2x) = [2x]^2 + 3 \times 2x - 2 = 4x^2 + 6x - 2

But it is easier to put 2x2x in immediately and skip step 1.

Exercise

Given

f(x)=x2f(x) = x^2

g(x)=x33g(x) = x^3 - 3

h(x)=2x+3x4h(x) = \frac{2x+3}{x-4}

Find simplified expression for

f(g(x))f(g(x))

g(f(x))g(f(x))

g(h(x))g(h(x))

h(g(x))h(g(x))

What do you notice?

Is it true that f(g(x))=g(f(x))f(g(x)) = g(f(x))?

Ready to test your knowledge?

You've reached the end of this section. Start a practice session to solidify your understanding and master this topic.