Composite & Inverse Functions

Two functions can be chained one after another, or a single function can be run in reverse. Here is how to build \(fg(x)\), why swapping the order changes the answer, and how to unpick \(f^{-1}(x)\) with algebra.

MYP 5Extended MathsFunctionsCriteria A · C · D~11 min read

Chaining functions together

A composite function is what you get when you run one function, then feed its output straight into a second function. The output of the first machine becomes the input of the second. We write this with the two function letters side by side.

Composite function \(fg(x)\)
Apply \(g\) first, then apply \(f\) to the result. In symbols \(fg(x) = f\big(g(x)\big)\). The function closest to the \(x\) is always the one that acts first.

The order looks backwards the first time you meet it, so say it out loud: "\(fg\) of \(x\) means do \(g\) first". The inner function, the one hugging the \(x\), goes first; the outer function acts on whatever comes out.

Where this is assessed

Building composites and inverses is core Criterion A knowledge. Setting the algebra out line by line, especially the "swap and rearrange" for an inverse, is marked under Criterion C for clear communication.

Working out \(fg(x)\)

To build a composite, replace the input of the outer function with the whole rule of the inner function. It is the "put in" idea from function notation, but this time you are putting in an entire expression.

Worked example

Given \(f(x) = 2x + 1\) and \(g(x) = x^2\), find \(fg(x)\) and then \(fg(3)\).

1
\(fg(x)\) means \(f\big(g(x)\big)\), so do \(g\) first. Here \(g(x) = x^2\).
2
Now put \(x^2\) into \(f\) in place of its input: \(f(x^2) = 2(x^2) + 1\).
3
Tidy up: \(fg(x) = 2x^2 + 1\).
4
For \(fg(3)\), put \(x = 3\) into the composite: \(2(3)^2 + 1 = 2(9) + 1 = 19\).
\(fg(x) = 2x^2 + 1\), and \(fg(3) = 19\)

Why the order matters

Swapping which function goes first usually changes the answer. \(fg(x)\) and \(gf(x)\) are different jobs done in a different order, so do not expect them to match.

Worked example

With the same \(f(x) = 2x + 1\) and \(g(x) = x^2\), find \(gf(x)\) and compare it with \(fg(x)\).

1
\(gf(x)\) means \(g\big(f(x)\big)\), so do \(f\) first: \(f(x) = 2x + 1\).
2
Put \(2x + 1\) into \(g\), which squares its input: \(g(2x+1) = (2x+1)^2\).
3
Expand: \((2x+1)^2 = 4x^2 + 4x + 1\).
4
Compare: \(fg(x) = 2x^2 + 1\) but \(gf(x) = 4x^2 + 4x + 1\). They are not the same.
\(gf(x) = 4x^2 + 4x + 1 \neq fg(x)\), so order matters.

Read the question twice

A single misread of \(fg\) as \(gf\) throws away the whole answer. Underline which letter sits next to the \(x\): that function moves first, every time.

Finding \(f^{-1}(x)\)

The inverse function undoes what the function did. If \(f\) turns \(3\) into \(11\), then \(f^{-1}\) turns \(11\) back into \(3\). It reverses every step, in reverse order.

Inverse function \(f^{-1}(x)\)
The function that reverses \(f\). It satisfies \(f\big(f^{-1}(x)\big) = x\) and \(f^{-1}\big(f(x)\big) = x\). Note that \(f^{-1}\) means the inverse, not \(\dfrac{1}{f}\).

The reliable method is three moves: write \(y = f(x)\), swap the roles so you make \(x\) the subject, then rename \(y\) as \(x\) in your final rule.

Worked example

Find the inverse of \(f(x) = 3x - 5\).

1
Write the rule as \(y = 3x - 5\).
2
Rearrange to make \(x\) the subject. Add \(5\) to both sides: \(y + 5 = 3x\).
3
Divide both sides by \(3\): \(x = \dfrac{y + 5}{3}\).
4
Rename \(y\) as \(x\) to write the inverse as a function: \(f^{-1}(x) = \dfrac{x + 5}{3}\).
\(f^{-1}(x) = \dfrac{x + 5}{3}\)

Check by composing

Test your inverse by feeding it back through \(f\). Here \(f\big(f^{-1}(x)\big) = 3\left(\dfrac{x+5}{3}\right) - 5 = (x + 5) - 5 = x\). Getting a clean \(x\) back confirms the inverse is right.

Check yourself

Work each one through fully before revealing the answer.

1. For \(f(x) = x + 4\) and \(g(x) = 3x\), find \(fg(x)\) and \(gf(x)\). +

\(fg(x) = f\big(g(x)\big) = f(3x) = 3x + 4\). For the other order, \(gf(x) = g\big(f(x)\big) = g(x+4) = 3(x+4) = 3x + 12\). So \(fg(x) = 3x + 4\) and \(gf(x) = 3x + 12\), which are different.

2. Find the inverse of \(f(x) = \dfrac{x - 2}{5}\). +

Write \(y = \dfrac{x-2}{5}\). Multiply both sides by \(5\): \(5y = x - 2\). Add \(2\): \(x = 5y + 2\). Rename \(y\) as \(x\): \(f^{-1}(x) = 5x + 2\).

3. If \(f(x) = 2x - 7\), find \(f^{-1}(9)\). +

First find the inverse: \(y = 2x - 7\) gives \(y + 7 = 2x\), so \(f^{-1}(x) = \dfrac{x + 7}{2}\). Then \(f^{-1}(9) = \dfrac{9 + 7}{2} = \dfrac{16}{2} = 8\). Check: \(f(8) = 2(8) - 7 = 9\). ✓ So \(f^{-1}(9) = 8\).


Part of the Extended Maths library. Spotted an error or want a topic added? That feedback makes the notes better.