Functions · Lesson 1 of 2

Composite functions and inverses

Put one function inside another, in the right order; find an inverse by making x the subject; and combine the two, as in g⁻¹∘f.

18 minYou should already know: Expressions, formulae & change of subject
  1. 1
  2. 2

In General Maths you met function notation and the inverse of a function (see algebraic expressions): f(3)f(3) means “put 3 in place of every xx”, and f−1f^{-1} undoes ff. Further Maths joins functions together. This lesson shows how to put one function inside another, then how inverses fit in.

WAEC often writes a function with an arrow: f:x→2x+1f: x \to 2x + 1 means the same as f(x)=2x+1f(x) = 2x + 1.

Values and unknowns

Two facts carry over from General Maths:

  • Put the input in everywhere. f(x+2)f(x + 2) means replace every xx by (x+2)(x + 2), in brackets.
  • Given values give equations. If f(1)=3f(1) = 3, substitute x=1x = 1 and set the result equal to 3. Two unknowns need two values, solved simultaneously (see polynomials).

More: values and unknowns

Composite functions: one inside another

f∘gf \circ g, also written fgfg, means do gg first, then ff:

f∘g(x)=f(g(x))f \circ g(x) = f\big(g(x)\big)

Read it from the inside out: the function nearest to xx acts first. The order matters, because doing the same two steps the other way round usually gives a different answer:

f∘g(x) = f(g(x)): g first2g: + 13f: x²9g∘f(x) = g(f(x)): f first2f: x²4g: + 15
Order mattersf∘g: g first. g∘f: f first

To find f∘g(x)f \circ g(x) as an expression, write out g(x)g(x), then put the whole of it, in brackets, in place of every xx in ff.

For example, with f(x)=2x+1{f(x) = 2x + 1} and g(x)=x2{g(x) = x^2}:

  • f∘g(x)=f(x2)f \circ g(x) = f(x^2). Replace xx in ff by x2x^2: 2x2+1{2x^2 + 1}.
  • g∘f(x)=g(2x+1)g \circ f(x) = g(2x + 1). Replace xx in gg by 2x+12x + 1: (2x+1)2=4x2+4x+1{(2x + 1)^2 = 4x^2 + 4x + 1}.

Run both orders on the same input:

Which machine first?Pick a pair, slide x

f∘g: g first, with f(x) = 2x + 1 and g(x) = x²

2→g→4→f→9

g∘f: f first

2→f→5→g→25
9f∘g(x) = 2x² + 125g∘f(x) = (2x + 1)² = 4x² + 4x + 1
f∘g means do g first, then f. Doing them the other way round gives 25, not 9: the order matters.

Worked example · WAEC 2011

WAEC 2011 · Paper 2 · Q9 (b)

Given that f:x→x2+1f: x \to x^2 + 1 and g:x→3x+1x−1g: x \to \dfrac{3x + 1}{x - 1}, x≠1x \ne 1, find: (i) g∘fg\circ f; (ii) g∘f(2)g\circ f(2).

  1. Which function first?

    • g∘fg \circ f means ff first, then gg.
    • So g∘f(x)=g(f(x))=g(x2+1){g \circ f(x) = g(f(x)) = g(x^2 + 1)}.

    Think first. In g∘f, which acts first?

  2. Put f(x) into g

    • The top: 3(x2+1)+1=3x2+4{3(x^2 + 1) + 1 = 3x^2 + 4}.
    • The bottom: (x2+1)−1=x2{(x^2 + 1) - 1 = x^2}.
    • So g∘f(x)=3x2+4x2{g \circ f(x) = \frac{3x^2 + 4}{x^2}}.
    • Divide each term by x2x^2: g∘f(x)=3+4x2{g \circ f(x) = 3 + \frac{4}{x^2}}.

    Think first. Replace every x in (3x + 1)/(x − 1) by x² + 1.

  3. The value at 2

    • g∘f(2)=3+44=4{g \circ f(2) = 3 + \frac44 = 4}.
    • Check the long way: f(2)=5{f(2) = 5}, then g(5)=164=4{g(5) = \frac{16}{4} = 4} ✓.

    Think first. Put x = 2 into 3 + 4/x².

More: composite functions

Inverse functions

The inverse f−1f^{-1} undoes ff: if ff takes 3 to 4, then f−1f^{-1} takes 4 back to 3. To find it:

  1. write y=f(x)y = f(x);
  2. make xx the subject;
  3. swap the letter: write the result with xx in place of yy.

On a graph, swapping xx and yy reflects the curve in the line y=xy = x:

(3, 4)(4, 3)y = xff⁻¹
f and f⁻¹Reflections in y = x: (3, 4) on f, (4, 3) on f⁻¹

For example, for f(x)=2x−2f(x) = 2x - 2:

  • Write y=2x−2{y = 2x - 2}.
  • Add 2 to both sides: y+2=2x{y + 2 = 2x}.
  • Divide by 2: x=y+22{x = \frac{y + 2}{2}}.
  • So f−1(x)=x+22{f^{-1}(x) = \frac{x + 2}{2}}. Check: f(3)=4f(3) = 4 and f−1(4)=3f^{-1}(4) = 3 ✓.

More: inverse functions

Inverses inside composites

Questions such as “find g−1∘fg^{-1} \circ f” combine both ideas. Find the inverse first, on its own line. Then compose as usual: the function nearest to xx acts first.

Worked example · WAEC 2011

WAEC 2011 · Paper 2 · Q10 (b)

Two functions ff and gg are defined by f:x→12x+1f: x \to \frac12x + 1 and g:x→5x−13g: x \to \frac{5x - 1}{3}. Find: (i) g−1g^{-1}; (ii) g−1∘fg^{-1}\circ f.

  1. The inverse of g

    • Write y=5x−13{y = \frac{5x - 1}{3}}.
    • Multiply by 3: 3y=5x−1{3y = 5x - 1}.
    • Add 1: 3y+1=5x{3y + 1 = 5x}.
    • Divide by 5: x=3y+15{x = \frac{3y + 1}{5}}, so g−1(x)=3x+15{g^{-1}(x) = \frac{3x + 1}{5}}.

    Think first. Write y = (5x − 1)/3 and make x the subject.

  2. Compose

    • ff acts first: g−1∘f(x)=g−1(12x+1){g^{-1} \circ f(x) = g^{-1}\left(\frac12x + 1\right)}.
    • Replace xx in g−1g^{-1}: 3(12x+1)+15{\frac{3\left(\frac12x + 1\right) + 1}{5}}.
    • Multiply out the top: 32x+45{\frac{\frac32x + 4}{5}}.
    • Multiply top and bottom by 2: g−1∘f(x)=3x+810{g^{-1} \circ f(x) = \frac{3x + 8}{10}}.

    Think first. g⁻¹∘f: which acts first?

More: inverses inside composites

Your turn

WAEC 2017 · Paper 2 · Q1 (a)

  1. (a)

    If f(x)=4−5x2f(x) = \dfrac{4 - 5x}{2} and g(x)=x+6g(x) = x + 6, x∈Rx \in \mathbb R, find f∘g−1f \circ g^{-1}.

Worked solution (try it first)

(a)

  1. Find g−1g^{-1} first: y=x+6y = x + 6 gives x=y−6x = y - 6, so g−1(x)=x−6g^{-1}(x) = x - 6.
  2. g−1g^{-1} acts first: f∘g−1(x)=f(x−6)f \circ g^{-1}(x) = f(x - 6)
    =4−5(x−6)2= \dfrac{4 - 5(x - 6)}{2}.
  3. Multiply out the top: 4−5x+30=34−5x4 - 5x + 30 = 34 - 5x.
  4. Divide each term by 2: f∘g−1(x)=17−52xf \circ g^{-1}(x) = 17 - \frac52x.

Report a problem with this question