B8PureStretch

Composite and Inverse Functions

A function is a machine: put a number in, get one out. Composite functions chain two machines together, and inverse functions run a machine backwards. The two ideas you must nail are the order of composition and the domain–range swap of an inverse.

32 min Video by TLMaths Algebra and Functions

The big picture

Thinking of a function as a process\textbf{process} — input, transform, output — is one of the most powerful mental shifts in A-Level. It reframes everything: a composite fgfg is two processes back-to-back, and an inverse f−1f^{-1} is the process run in reverse. This language underpins the chain rule in calculus, transformations of graphs, and later work on exponentials and logarithms (which are inverse functions of each other). The two habitual pitfalls — reading fgfg in the wrong order, and forgetting that an inverse swaps domain and range — are worth crushing now, because they echo through the rest of the course.

A-Level Maths B8-08: Introducing Composite FunctionsCurated by Kepler, not produced by us. Watch it, then work through the notes below.
Open on YouTube

What you'll be able to do

  • Use function notation, domain and range confidently
  • Form and evaluate composite functions in the correct order
  • Find an inverse function by rearranging, and swap domain and range
  • Know when an inverse exists (one-to-one) and read the y=xy = x reflection
1

Functions, domain and range

A function\textbf{function} takes each input to exactly one output. The set of allowed inputs is the domain\textbf{domain}; the set of resulting outputs is the range\textbf{range}. For f(x)=x2f(x) = x^2 with domain all real numbers, the range is y≥0y \geq 0, because squaring never gives a negative.

Keeping domain and range straight matters enormously for inverses, because — as you will see — an inverse simply swaps them.

2

Composite functions — mind the order

The composite fg(x)fg(x) means “do gg first, then feed the result into ff”: fg(x)=f(g(x))fg(x) = f(g(x)). The function nearest the xx acts first. This order is not a convention you can bend — fgfg and gfgf are usually completely different.

fg(x)=f(g(x))(apply g first)fg(x) = f\big(g(x)\big) \quad (\text{apply } g \text{ first})
Read right-to-left: the inside function runs first.
Example 1For f(x)=x+1f(x) = x + 1 and g(x)=x2g(x) = x^{2}, find fg(x)fg(x) and gf(x)gf(x).
1fg(x)=f(g(x))=f(x2)=x2+1fg(x) = f(g(x)) = f(x^2) = x^2 + 1.
2gf(x)=g(f(x))=g(x+1)=(x+1)2=x2+2x+1gf(x) = g(f(x)) = g(x + 1) = (x + 1)^2 = x^2 + 2x + 1.
3They are different — order matters.
Answer
fg(x)=x2+1fg(x) = x^2 + 1; gf(x)=(x+1)2gf(x) = (x+1)^2.
Why this works

The function written closest to the xx is applied first. A useful check: fg(x)fg(x) substitutes gg into ff, so gg’s output becomes ff’s input.

3

Inverse functions — running the machine backwards

The inverse f−1f^{-1} undoes ff: if ff turns 3 into 7, then f−1f^{-1} turns 7 back into 3. To find it, write y=f(x)y = f(x), rearrange to make xx the subject, then swap the letters. Crucially, f−1f^{-1} is not\textbf{not} the reciprocal 1f\tfrac{1}{f} — the −1-1 here means “inverse”, not “to the power −1-1”.

Because an inverse reverses inputs and outputs, the domain of f−1\textbf{domain of } f^{-1} is the range of f\textbf{range of } f, and vice versa. Graphically, y=f−1(x)y = f^{-1}(x) is the reflection of y=f(x)y = f(x) in the line y=xy = x.

f(f−1(x))=x=f−1(f(x))f\big(f^{-1}(x)\big) = x = f^{-1}\big(f(x)\big)
Each undoes the other.
domain of f−1=range of f\text{domain of } f^{-1} = \text{range of } f
Inverses swap domain and range.
Example 1Find the inverse of f(x)=2x−3f(x) = 2x - 3.
1Write y=2x−3y = 2x - 3.
2Rearrange for xx: x=y+32x = \dfrac{y + 3}{2}.
3Swap letters: f−1(x)=x+32f^{-1}(x) = \dfrac{x + 3}{2}.
Answer
f−1(x)=x+32f^{-1}(x) = \dfrac{x + 3}{2}

Tip — Check an inverse by composing: ff−1(x)f f^{-1}(x) should simplify to xx. If it does not, you have made a slip.

4

When does an inverse exist?

An inverse exists only if the function is one-to-one\textbf{one-to-one} — each output comes from exactly one input. f(x)=x2f(x) = x^2 fails this on all reals, because 22 and −2-2 both map to 44, so the “inverse” would not know which to return. The fix is to restrict the domain\textbf{restrict the domain} (e.g. x≥0x \geq 0), making it one-to-one so f−1(x)=xf^{-1}(x) = \sqrt{x} is well defined.

Why this works

The reflection-in-y=xy=x picture explains the one-to-one rule visually: reflecting a curve that fails the “horizontal line test” produces something that fails the vertical line test — i.e. not a function. Restricting the domain removes the ambiguity.

Think like an examiner

  • For fg(x)fg(x), apply gg first — the inside function. Getting the order backwards is the most common composite-function error.
  • When finding an inverse, state the domain of f−1f^{-1} (it equals the range of ff) if the question asks — it is frequently worth a mark.
  • Never treat f−1(x)f^{-1}(x) as 1f(x)\tfrac{1}{f(x)}; the notation means the inverse function.
  • If a function is not one-to-one, expect to restrict the domain before inverting, and say so explicitly.

Common misconceptions

Reading fg(x)fg(x) as “ff first, then gg”.
fg(x)=f(g(x))fg(x) = f(g(x)): the inner function gg acts first.
Writing f−1(x)=1f(x)f^{-1}(x) = \dfrac{1}{f(x)}.
f−1f^{-1} is the inverse function, not the reciprocal — find it by rearranging.
Giving the inverse of f(x)=x2f(x) = x^2 on all reals as x\sqrt{x} without comment.
x2x^2 is not one-to-one on all reals; restrict to x≥0x \geq 0 first, then f−1(x)=xf^{-1}(x) = \sqrt x.
Ignoring the domain and range when inverting.
The domain of f−1f^{-1} is the range of ff — state it when required.

Functions toolkit

fg(x)=f(g(x))fg(x) = f(g(x))
Composite: inner function first.
ff−1(x)=xf f^{-1}(x) = x
Inverse undoes the function.
dom(f−1)=ran(f)\text{dom}(f^{-1}) = \text{ran}(f)
Domain–range swap.
y=f−1(x) reflects y=f(x) in y=xy = f^{-1}(x) \text{ reflects } y=f(x) \text{ in } y=x
Graphical inverse.

Stretch yourself

Given f(x)=x+1x−2f(x) = \dfrac{x + 1}{x - 2} for x≠2x \neq 2, find f−1(x)f^{-1}(x) and show that ff is its own inverse.

Hint — Set y=x+1x−2y = \dfrac{x+1}{x-2}, multiply out, collect the xx terms and make xx the subject, then swap letters.

Reveal solution
SolutionLet y=x+1x−2y = \dfrac{x+1}{x-2}. Then y(x−2)=x+1⇒xy−2y=x+1⇒xy−x=2y+1⇒x(y−1)=2y+1y(x-2) = x+1 \Rightarrow xy - 2y = x + 1 \Rightarrow xy - x = 2y + 1 \Rightarrow x(y-1) = 2y+1, so x=2y+1y−1x = \dfrac{2y+1}{y-1}. Swapping letters, f−1(x)=2x+1x−1f^{-1}(x) = \dfrac{2x+1}{x-1}. Comparing with ff, applying ff twice returns xx, so ff is a self-inverse function — its graph is symmetric in the line y=xy = x. ■\blacksquare

Questions students ask

Does fg(x)fg(x) mean apply ff first or gg first?
gg first. fg(x)=f(g(x))fg(x) = f(g(x)), so the function written next to the xx (the inner one) acts first, and its output becomes the input of the outer function.
Is f−1(x)f^{-1}(x) the same as 1f(x)\tfrac{1}{f(x)}?
No. The −1-1 denotes the inverse function, which undoes ff, not a reciprocal power. You find it by rearranging y=f(x)y = f(x) to make xx the subject and swapping the letters.
Why do some functions not have an inverse?
Because they are not one-to-one — two inputs share an output, so reversing the process is ambiguous. x2x^2 is the classic case. Restricting the domain (say x≥0x \ge 0) makes it one-to-one and invertible.
How are the domain and range of an inverse related to the original?
They swap: the domain of f−1f^{-1} is the range of ff, and the range of f−1f^{-1} is the domain of ff. This matches the reflection of the graph in the line y=xy = x.

Key takeaways

  • A function maps each input (domain) to one output (range).
  • Composite fg(x)=f(g(x))fg(x) = f(g(x)) — apply the inner function first; order matters.
  • Find an inverse by rearranging y=f(x)y = f(x) for xx and swapping letters; f−1f^{-1} is not a reciprocal.
  • An inverse swaps domain and range and reflects the graph in y=xy = x.
  • Inverses exist only for one-to-one functions — restrict the domain if needed.

How this fits the course

Related

Test yourself

Answer a few questions, then review anything you missed.

Prefer paper? Open the written self-check

Answer each question before opening its answer. This self-check does not record a quiz score.

  1. For f(x)=x−5f(x) = x - 5 and g(x)=3xg(x) = 3x, fg(x)=fg(x) =

    • 3x−53x - 5
    • 3x−153x - 15
    • 3(x−5)3(x-5)
    • x−15x - 15
    Show answer and explanation

    Answer: 3x−53x - 5

    fg(x)=f(3x)=3x−5fg(x) = f(3x) = 3x - 5 (apply gg first).

  2. The notation f−1(x)f^{-1}(x) means:

    • the inverse function
    • 1f(x)\tfrac{1}{f(x)}
    • f(x)f(x) to the power −1-1
    • the derivative
    Show answer and explanation

    Answer: the inverse function

    It is the function that undoes ff, not a reciprocal.

  3. The inverse of f(x)=3x+6f(x) = 3x + 6 is:

    • x−63\dfrac{x - 6}{3}
    • x+63\dfrac{x + 6}{3}
    • 3x−63x - 6
    • 13x+6\dfrac{1}{3x + 6}
    Show answer and explanation

    Answer: x−63\dfrac{x - 6}{3}

    y=3x+6⇒x=y−63y = 3x + 6 \Rightarrow x = \tfrac{y - 6}{3}, so f−1(x)=x−63f^{-1}(x) = \tfrac{x-6}{3}.

  4. The graph of y=f−1(x)y = f^{-1}(x) is a reflection of y=f(x)y = f(x) in:

    • y=xy = x
    • the xx-axis
    • the yy-axis
    • the origin
    Show answer and explanation

    Answer: y=xy = x

    Swapping inputs and outputs reflects the curve in the line y=xy = x.

  5. Why does f(x)=x2f(x) = x^{2} (all reals) have no inverse?

    • It is not one-to-one
    • It has no range
    • It is not continuous
    • It is negative
    Show answer and explanation

    Answer: It is not one-to-one

    Both 22 and −2-2 give 4, so reversing is ambiguous until the domain is restricted.

  6. If the range of ff is y≥1y \geq 1, the domain of f−1f^{-1} is:

    • x≥1x \geq 1
    • x≤1x \leq 1
    • all reals
    • x≥0x \geq 0
    Show answer and explanation

    Answer: x≥1x \geq 1

    The domain of the inverse equals the range of the original function.

Next step

Keep practising

Start with the quiz above to check the key ideas. You can also choose another topic from the practice library.

Browse practice topics

Related lessons

All 15 lessons

Put the methods into practice: see how A-Level maths duels work. An account is required to play; the overview and sample are public.