40% off

Early-bird ends 15 Aug, 9am

Lock in £90

Transformations and Compositions of Functions

Updated August 2025

Master the effect of transformations on the graph of y=f(x)y = f(x) for university admissions tests. This guide explains vertical and horizontal translations, stretches, and squashes, including how to combine these operations and use composite function notation f(g(x))f(g(x)) to analyse complex curves accurately.

Core concept

A transformation maps the graph of y=f(x)y = f(x) to a new position or shape. Vertical changes af(x)af(x) and f(x)+af(x)+a affect the yy coordinates directly, while horizontal changes f(ax)f(ax) and f(x+a)f(x+a) modify the input xx and often produce a counter-intuitive effect on the graph.

Introduction to Transformations

Graph transformation is a topic that is often poorly understood because students frequently learn rules without grasping the underlying mechanics. It is particularly tricky because horizontal shifts like y=f(x+a)y = f(x + a) appear as though they should shift a graph to the right, yet they actually move it to the left when aa is positive. To truly master this topic for the TMUA, you must understand how the notation y=f(x)y = f(x) identifies the yy value above a given xx coordinate as the result of a calculation, and how modifications to that calculation affect the resulting curve.

Vertical Stretch: y=af(x)y = af(x)

In the transformation y=af(x)y = af(x), every original yy value is multiplied by the factor aa. For example, if we compare y=f(x)=x3y = f(x) = x^3 with y=4f(x)=4x3y = 4f(x) = 4x^3, each yy value is four times as large. This corresponds to a vertical stretch away from the xx axis by a factor of aa.

img-78.jpeg

If 0<a<10 < a < 1, the graph becomes less tall (a compression towards the xx axis). If aa is negative, the graph is reflected in the xx axis in addition to the vertical stretch.

img-79.jpeg

Vertical Translation: y=f(x)+ay = f(x) + a

Adding a constant aa to the function result, as in y=f(x)+ay = f(x) + a, shifts every point on the graph up by aa units. This is a translation by the vector (0a)\binom{0}{a}. For instance, moving from y=x2y = x^2 to y=x2+3y = x^2 + 3 shifts the entire parabola up by 3 units parallel to the yy axis.

Horizontal Translation: y=f(x+a)y = f(x + a)

This transformation shifts the graph parallel to the xx axis. To find the expression for f(x+a)f(x+a) given f(x)f(x), replace every xx in the original function with (x+a)(x + a).

Worked Example 1 Given f(x)=x2+2x5f(x) = x^2 + 2x - 5, find an expression for f(x+3)f(x + 3). Substituting (x+3)(x+3) for xx: f(x+3)=(x+3)2+2(x+3)5f(x + 3) = (x + 3)^2 + 2(x + 3) - 5.

Worked Example 2 Given f(x)=cos(2x)f(x) = \cos(2x), find an expression for f(xπ2)f(x - \frac{\pi}{2}). Replacing xx with (xπ2)(x - \frac{\pi}{2}): f(xπ2)=cos2(xπ2)=cos(2xπ)f(x - \frac{\pi}{2}) = \cos 2(x - \frac{\pi}{2}) = \cos(2x - \pi).

Note that the 2 multiplies the entire replacement: we must have cos2(xπ2)\cos 2(x - \frac{\pi}{2}) and not cos(2xπ2)\cos(2x - \frac{\pi}{2}).

Understanding the Shift Consider f(x)=2xf(x) = 2^x. In y=f(x)y = f(x), x=2x = 2 gives y=4y = 4. In y=f(x+3)y = f(x + 3), x=2x = 2 gives y=f(2+3)=f(5)=32y = f(2 + 3) = f(5) = 32. The yy value found at x=5x = 5 on the original graph now appears at x=2x = 2 on the new graph. This means the graph of y=f(x+a)y = f(x + a) is the graph of y=f(x)y = f(x) translated by (a0)\binom{-a}{0}. If aa is positive, it moves left.

img-80.jpeg

img-81.jpeg

Horizontal Squash: y=f(ax)y = f(ax)

In y=f(ax)y = f(ax), the yy value above a given xx is the value that would have occurred at axax in the original function. If a=2a = 2, the yy values occur at half the xx distance from the yy axis, effectively 'squashing' the graph towards the yy axis by a factor of aa.

Worked Example 3 Given f(x)=x2f(x) = x^2, find f(3x)f(3x). Replacing xx by 3x3x: f(3x)=(3x)2=9x2f(3x) = (3x)^2 = 9x^2.

Worked Example 4 Given f(x)=cos(2x+30)f(x) = \cos(2x + 30), find f(4x)f(4x). Replacing xx by 4x4x: f(4x)=cos(2(4x)+30)=cos(8x+30)f(4x) = \cos(2(4x) + 30) = \cos(8x + 30).

img-82.jpeg

img-83.jpeg

Summary of Transformations

TransformationEffect
af(x)af(x)Vertical stretch away from the xx axis by factor aa. If a<0a < 0, includes reflection in xx axis.
f(x)+af(x) + aTranslation by (0a)\binom{0}{a} (Vertical shift).
f(x+a)f(x + a)Translation by (a0)\binom{-a}{0} (Horizontal shift).
f(ax)f(ax)Horizontal squash towards the yy axis by factor aa. If a<0a < 0, includes reflection in yy axis.

Combining Transformations and Composite Functions

Order matters when combining transformations. Consider y=cos(2x+π6)y = \cos(2x + \frac{\pi}{6}). If we translate by π6-\frac{\pi}{6} then squash by factor 2, we get: cos(x)cos(x+π6)cos(2x+π6)\cos(x) \rightarrow \cos(x + \frac{\pi}{6}) \rightarrow \cos(2x + \frac{\pi}{6}). This is correct. However, squashing by 2 then translating by π6-\frac{\pi}{6} gives: cos(x)cos(2x)cos(2(x+π6))=cos(2x+π3)\cos(x) \rightarrow \cos(2x) \rightarrow \cos(2(x + \frac{\pi}{6})) = \cos(2x + \frac{\pi}{3}). This is incorrect.

Composite Function Notation f(g(x))f(g(x)) The notation f(g(x))f(g(x)) means taking the output of g(x)g(x) and using it as the input for f(x)f(x).

Worked Example 5 Let g(x)=2xg(x) = 2x and f(x)=x2+3x2f(x) = x^2 + 3x - 2. To find f(g(x))f(g(x)), replace the input xx in f(x)f(x) with 2x2x: f(g(x))=(2x)2+3(2x)2=4x2+6x2f(g(x)) = (2x)^2 + 3(2x) - 2 = 4x^2 + 6x - 2.

Key takeaways

  • Horizontal transformations f(x+a)f(x+a) and f(ax)f(ax) generally have the opposite effect to what is intuitive: +a+a shifts left and multiplying by aa squashes the graph.
  • Vertical transformations af(x)af(x) and f(x)+af(x)+a affect the yy coordinates directly and behave intuitively.
  • Order is critical when combining transformations: for horizontal changes, apply the translation then the stretch, or factorise the argument to f(a(x+b/a))f(a(x + b/a)).
  • Composite notation f(g(x))f(g(x)) involves substituting the entire expression for g(x)g(x) into every instance of xx within f(x)f(x).
Tips

When transforming trigonometric graphs, keep the period in mind. For y=cos(ax)y = \cos(ax), the new period is the original period (360360^{\circ} or 2π2\pi) divided by aa.

Cautions

Always be careful with brackets when substituting for xx. In f(ax)f(ax), the factor aa must multiply everything substituted for xx. Forgetting brackets is the most common cause of errors in transformation questions.

Insight

Thinking of transformations as mappings of individual points (x,y)(x, y) can help clarify complex compositions. For y=af(x+b)+cy = af(x+b)+c, the point (x,y)(x, y) on the original graph maps to (xb,ay+c)(x-b, ay+c) on the new graph.

Worked Examples

Example 1
It is given that f(x)=x3+3qx2+2f(x) = x^3 + 3qx^2 + 2, where qq is a real constant.
The equation
f(x)=0f(x) = 0 has 3 distinct real roots.
Which of the following statements is/are necessarily true?
I The equation
f(x)+1=0f(x) + 1 = 0 has 3 distinct real roots.
II The equation
f(x+1)=0f(x + 1) = 0 has 3 distinct real roots.
III The equation
f(x)1=0f(-x) - 1 = 0 has 3 distinct real roots.
A:none of them
B:I only
C:II only
D:III only
E:I and II only
F:I and III only
G:II and III only
H:I, II and III

Practice Questions

Practice Question 1
The functions f1f_1 to f5f_5 are defined on the real numbers by
f1(x)=cosxf_1(x) = \cos x
f2(x)=sin(cosx)f_2(x) = \sin(\cos x)
f3(x)=cos(sin(cosx))f_3(x) = \cos(\sin(\cos x))
f4(x)=sin(cos(sin(cosx)))f_4(x) = \sin(\cos(\sin(\cos x)))
f5(x)=cos(sin(cos(sin(cosx))))f_5(x) = \cos(\sin(\cos(\sin(\cos x))))
where all numbers are taken to be in radians.
These functions have maximum values
m1,m2,m3,m4m_1, m_2, m_3, m_4 and m5m_5, respectively.
Which one of the following statements is true?
A:m1,m2,m3,m4m_1, m_2, m_3, m_4 and m5m_5 are all equal to 1
B:0<m5<m4<m3<m2<m1=10<m_5<m_4<m_3 <m_2 < m_1 = 1
C:m1=m3=m5=1m_1 = m_3 = m_5 = 1 and 0<m2=m4<10 < m_2 = m_4 <1
D:m1=m3=m5=1m_1 = m_3 = m_5 = 1 and 0<m4<m2<10<m_4<m_2<1
E:m1=m3=1m_1 = m_3 = 1 and 0<m2=m4<10<m_2 = m_4<1 and 0<m5<10<m_5<1
F:m1=m3=1m_1 = m_3 = 1 and 0<m4<m2<10<m_4<m_2<1 and 0<m5<10<m_5<1

Frequently asked questions

Why does f(x+a)f(x+a) move the graph to the left instead of the right?

Because the yy value that used to occur at x=5x=5 now occurs when x+a=5x+a=5, which means x=5ax = 5-a. Every point must exist at an xx value that is aa units smaller to produce the same function input.

How do I handle a negative aa in y=f(ax)y = f(ax)?

A negative aa represents two distinct transformations: a horizontal squash by a factor of a|a| and a reflection in the yy axis.

Is f(g(x))f(g(x)) always the same as g(f(x))g(f(x))?

No, function composition is not generally commutative. For example, if f(x)=x2f(x) = x^2 and g(x)=x+1g(x) = x+1, then f(g(x))=(x+1)2f(g(x)) = (x+1)^2 while g(f(x))=x2+1g(f(x)) = x^2+1.

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.