James Ashton MathsFREE MATHEMATICS. OPEN TO EVERYONE.
HomeIB DiplomaA levelAbout
IB Diploma › Maths AA SL › Topic 2: Functions › Functions, composite & inverse

Functions, composite & inverse

What a function is, its domain and range, combining functions, and finding and graphing inverse functions.

SL 2.2SL 2.5Paper 1Paper 2≈ 60 min to work through
Before you start: substitution and rearranging formulae. Shaky on these? See Before you start SL › Rearranging.

1What you need to know

Tick these off as you go. By the end of the page you should be able to do all of them without notes.

  • Use function notation f(x) and evaluate functionsSL 2.2
  • Find the domain and range of a functionSL 2.2
  • Find composite functions (f∘g)(x)=f(g(x))SL 2.5
  • Find the inverse function f−1(x)SL 2.2, 2.5
  • Know that the graph of f−1 is the reflection of f in y=xSL 2.2
  • Know that (f∘f−1)(x)=x, and that the domain and range swapSL 2.5

2Notes & worked examples

Each idea is followed by a worked example. Try the question yourself first, then reveal the solution one step at a time.

The big idea

A function is a rule that turns each input into exactly one output. You can chain functions together (composite functions) and reverse them (inverse functions), and the domain and range tell you which inputs and outputs are possible.

2.1 Domain and range

Think of a function as a machine. You put in a number, the machine follows its rule, and one number comes out. f(x)=2x+1 means "double the input, then add 1", so f(3)=7.

A function gives exactly one output for each input. The domain is the set of allowed inputs; the range is the set of outputs. Look out for square roots (the inside must be ≥0), fractions (the denominator cannot be 0) and logarithms (the inside must be >0).

Some inputs are not allowed because the rule breaks. You cannot divide by zero, and (for real numbers) you cannot take the square root of a negative number or the logarithm of zero or a negative number. These are the usual reasons for restricting the domain. On a graph, the domain is the spread of the graph across the x-axis, and the range is its spread up the y-axis.

Worked example 1Paper 1
Find the domain and range of f(x)=x−3.
The inside must be non-negative: x−3≥0, so the domain is x≥3.
A square root is never negative: the range is f(x)≥0.

2.2 Composite functions

Composite
(f∘g)(x)=f(g(x))

Apply g first, then f. In general f∘g≠g∘f.

f(g(x)) is read from the inside out: the output of g becomes the input of f. The order matters, and in general f(g(x)) and g(f(x)) are different. For example, "square then add 1" is not the same as "add 1 then square".

Worked example 2Paper 1
f(x)=2x+1 and g(x)=x2. Find (f∘g)(x), (g∘f)(x) and (g∘f)(−1).
(f∘g)(x)=f(x2)=2x2+1
(g∘f)(x)=g(2x+1)=(2x+1)2
(g∘f)(−1)=(−1)2=1

2.3 Inverse functions

If f is "double, then add 1", its inverse reverses each step in the opposite order: "subtract 1, then halve". So f(3)=7 and f−1(7)=3. In general f−1(f(x))=x.

The inverse f−1 undoes f. To find it: write y=f(x), make x the subject, then swap x and y. The domain of f−1 is the range of f, and f(f−1(x))=f−1(f(x))=x. The graph of y=f−1(x) is the reflection of y=f(x) in the line y=x.

When does an inverse exist?

An inverse only exists if each output comes from just one input, so that you know which input to go back to. f(x)=x2 sends both 3 and −3 to 9, so it has no inverse unless the domain is restricted, for example to x≥0. This is a one-to-one function. On a graph, the graph of y=f−1(x) is the reflection of y=f(x) in the line y=x, because swapping x and y swaps the coordinates of every point.

Worked example 3Paper 1
Find f−1(x) for f(x)=3x−12.
y=3x−12⇒2y=3x−1
x=2y+13
f−1(x)=2x+13
Worked example 4Paper 1
f(x)=x2+2, x≥0. Find f−1(x) and its domain.
y=x2+2⇒x=y−2 (positive root, since x≥0)
f−1(x)=x−2
Domain of f−1: x≥2, the range of f.
Without the restriction x≥0, f would not have an inverse: it would not be one-to-one.
Worked example 5 (faded)Paper 1
f(x)=5−2x. Find f−1(1).
f−1(1) is the input that gives 1: solve 5−2x=1, so x= 2  ← you work this out
On your TI-Nspire Calculator tricks →

Define a function: menu → 1: Actions → 1: Define, e.g. Define f(x)=2x+1. Then f(g(3)) evaluates a composite. On a Graphs page, plot f, y=x and your inverse to check that they are reflections.

3Explore it

Choose a function. Move the point P along it: its reflection in y=x lies on the inverse.

4Common mistakes & exam tips

Common mistakes

  • Doing a composite in the wrong order: f(g(x)) means g first.
  • Confusing f−1(x) with 1f(x).
  • Forgetting to swap x and y at the end when finding an inverse.
  • Giving the domain of f−1 as the domain of f: it is the range of f.

Exam tips

  • To find f−1(a) for a number a, you can solve f(x)=a instead of finding the whole inverse.
  • Points where f meets f−1 usually lie on y=x, so solve f(x)=x.
  • State domain restrictions with your inverse, e.g. f−1(x)=x−2, x≥2.

5Practice

Fluency questions build the basics. Problem-solving questions make you think about which method to use.

FluencyP1
f(x)=x2−4. Find f(−3).
9−4=5
FluencyP2
State the domain of f(x)=1x−2.
x≠2
FluencyP3
f(x)=3x−2 and g(x)=x+5. Find f(g(x)).
3(x+5)−2=3x+13
FluencyP4
Find f−1(x) for f(x)=4x+7.
f−1(x)=x−74
Problem solvingP5
f(x)=2x+k and f(f(1))=11. Find k.
f(1)=2+k, so f(2+k)=2(2+k)+k=4+3k=11, giving k=73.
Problem solvingP6
f(x)=1x−1+2, x≠1. Find f−1(x) and state its domain.
y−2=1x−1⇒x=1+1y−2, so f−1(x)=1+1x−2, x≠2.

6Exam-style questions

Original questions in the style of the IB exam, with full markschemes. Give yourself about 1 minute per mark.

Question 1Paper 1[6 marks]

f(x)=3x−5 and g(x)=x2+1.

  • (a)Find (g∘f)(2).[2]
  • (b)Find f−1(x).[2]
  • (c)Solve (f∘g)(x)=10.[2]
(a)
f(2)=1A1
g(1)=2A1
(b)
y=3x−5⇒x=y+53M1
f−1(x)=x+53A1
(c)
3(x2+1)−5=10M1
x=±2A1
Question 2Paper 1[6 marks]

f(x)=x+4, x≥−4.

  • (a)Write down the range of f.[1]
  • (b)Find f−1(x).[2]
  • (c)Write down the domain of f−1.[1]
  • (d)The graphs of f and f−1 meet at one point. Find its x-coordinate.[2]
(a)
f(x)≥0A1
(b)
y2=x+4⇒x=y2−4M1
f−1(x)=x2−4A1
(c)
x≥0A1
(d)
Solve x+4=x, i.e. x2−x−4=0M1
x=1+172A1
Question 3Paper 2[5 marks]

A liquid is heated. Its temperature in °C after t minutes is C(t)=20+5t. Temperatures convert to °F using F(C)=1.8C+32.

  • (a)Find (F∘C)(t).[2]
  • (b)Find the time when the temperature is 104 °F.[2]
  • (c)Find F−1(x).[1]
(a)
1.8(20+5t)+32M1
68+9tA1
(b)
68+9t=104M1
t=4 minutesA1
(c)
F−1(x)=x−321.8A1

7Check yourself

Six quick questions, marked instantly. Aim for 6/6 before moving on. Fractions like 3/2 are accepted.

8Past-paper practice

Once you're scoring well above, try real IB questions. Your school or teacher will have these papers.

PaperQuestionFocusDifficulty
May 2025 · TZ3 · Paper 1Q3Read f(-3) from graph, domain of inverse, solve f⁻¹(2x-7)=-3★☆☆
May 2023 · TZ2 · Paper 1Q6Two possible linear f with (g∘f)(x) = 4x² − 14x + 15★★☆
May 2021 · TZ2 · Paper 2Q5Range of 6x² − 12x + 1; set of c with (g∘f)(x) ≤ 0 for all x★★☆
Nov 2022 · Paper 1Q7Vertex form from vertex and root; find parameters, range, distinct intersections★★★
Spotted a mistake on this page?Tell me and I'll fix it. The button opens an email with this page already named, or write to jamesashtonmaths@gmail.com.
Report a mistake