Educerie · IB Diploma · Mathematics: analysis and approaches
Topic 2 Functions · 2.2 Functions, domain, range and inverse
What you must be able to do
| You must be able to | Level | What it looks like in the exam |
|---|---|---|
| Say whether a relation is a function, from a rule, a set of pairs, a mapping or a graph | SL, HL | "Explain why this graph does not represent a function" (1 to 2 marks) |
| Use function notation such as f(x), v(t), C(n), and f: x ↦ … | SL, HL | "Find f(−2)"; "Solve f(x) = 8" (2 to 3 marks, Paper 1) |
| Find the largest possible domain of a function | SL, HL | "Write down the largest possible domain of f" (1 to 2 marks) |
| Find the range, using a graph to see it | SL, HL | "Find the range of f" (2 to 3 marks), including on a restricted domain |
| Use a function as a model, with the domain its context allows | SL, HL | Paper 2: "State a suitable domain for h in this context" (1 to 2 marks) |
| Explain that an inverse undoes a function, and use f⁻¹ notation | SL, HL | "Find f⁻¹(10)", read as "solve f(x) = 10" (2 marks) |
| Sketch the inverse as the reflection of the graph in y = x | SL, HL | "On the same axes, sketch the graph of f⁻¹" (2 to 3 marks) |
| Know that only one-to-one functions have inverses, and that the domain of f⁻¹ is the range of f | SL, HL | "Write down the domain of f⁻¹" (1 mark); "Explain why f has no inverse" (1 mark) |
Before you start
You need the idea of a mapping, from set to set, shown as pairs, tables or arrow diagrams; that is prior learning in the guide. You need to solve linear and quadratic equations, and to know that you cannot divide by zero or take the square root of a negative number in the real numbers. Straight lines from 2.1 help, because the line y = x is the mirror for every inverse on this page.
1The idea in one paragraph
A function is a rule that takes an input and gives back exactly one output. That "exactly one" is the whole definition, and it is what lets you write f(3) and mean one number. The set of inputs the rule is allowed to take is the domain. The set of outputs it actually produces is the range. A graph shows both at once: the domain is how far the graph stretches left and right, and the range is how far it stretches up and down. Some functions can be run backwards, so that each output leads you back to the one input it came from. That backwards function is the inverse, f⁻¹, and its graph is the graph of f reflected in the line y = x. It exists only when no two inputs share an output.
2What makes a rule a function
A relation is any pairing of inputs with outputs. A function is a relation with one extra promise: each input is paired with exactly one output. Figure 1 shows the difference with arrow diagrams, which the guide calls mappings.
In panel (a) the rule is "square it". Both −2 and 2 go to 4. That is allowed: two inputs may share an output, which is called many-to-one. Each input still has only one arrow leaving it. In panel (b) the rule is "take the square root, positive or negative". The input 4 has two arrows, to −2 and to 2. That is one-to-many, and it is not a function, because "the output for 4" does not name one number.
On a graph the same test becomes the vertical line test, as Figure 2 shows. Every vertical line is one value of x. If any vertical line crosses the graph more than once, that x has more than one y, and the graph is not a function. The parabola y = x² − 2 passes. The circle x² + y² = 9 fails: the line x = 1.5 meets it twice.
The same check works on a list of pairs. {(1, 4), (2, 4), (3, 5)} is a function, since each first coordinate appears once. {(1, 4), (1, 5), (2, 6)} is not, since the input 1 has two outputs.
3Function notation
Function notation names the function and its input together. f(x) is read "f of x" and means "the output of f when the input is x". The letters change with the context: v(t) is a velocity at time t, C(n) is the cost of n items. The IB also uses mapping notation, f: x ↦ 3x² − 2x, which reads "f maps x to 3x² − 2x" and means the same as f(x) = 3x² − 2x.
The input is the independent variable; you choose it. The output is the dependent variable; it depends on your choice. On a graph the input goes across and the output goes up, so y = f(x).
Take f(x) = 3x² − 2x. Evaluating means substituting the input everywhere x appears, in brackets.
Solving runs the other way: you are given an output and asked for the input or inputs.
Two inputs give the output 8. That is fine for a function, but it will matter in section 9.
Keep the two apart: f(2) asks for an output; f(x) = 2 asks for an input. Most sign and method errors in this topic come from blurring them.
4Domain: which inputs are allowed
The domain of a function is the set of inputs it is defined for. Unless a question says otherwise, the exam takes the largest possible domain, which will usually be all real numbers, x ∈ ℝ. You only have to restrict it when something would break. At standard level three things break a rule for real numbers:
- Dividing by zero. g(x) = 5 ÷ (x − 3) is undefined at x = 3. Domain: x ∈ ℝ, x ≠ 3.
- The square root (or any even root) of a negative number. h(x) = √(2x + 8) needs 2x + 8 ≥ 0, so the domain is x ≥ −4.
- The logarithm of zero or a negative number. ln(x − 1) needs x − 1 > 0, so x > 1. You meet this properly in 2.9.
Combine them when they appear together. For k(x) = 1 ÷ √(6 − x), the root needs 6 − x ≥ 0 and the division needs √(6 − x) ≠ 0, so 6 − x > 0 and the domain is x < 6, with a strict inequality.
The guide's own example is f(x) = √(2 − x). The expression under the root must not be negative: 2 − x ≥ 0, so the domain is x ≤ 2. Figure 3 shows it. The graph starts at (2, 0) and runs away to the left forever; along the x-axis, that is exactly x ≤ 2.
Write domains as inequalities in x, like x ≤ 2 or x ≠ 3, or with set notation, x ∈ ℝ, x ≠ 3.
5Range: which outputs you get
The range is the set of outputs the function actually produces from its domain. It is written in terms of the output: f(x) ≥ 0, or y ≥ 0. The guide says it plainly: a graph is helpful in visualising the range. Read it by looking at how far the graph reaches up and down.
For f(x) = √(2 − x) in Figure 3, the square root is never negative, it equals 0 when x = 2, and it grows without limit as x runs left. So the range is f(x) ≥ 0.
Three more cases, each with its own lesson.
A square pushed up. f(x) = x² + 3. Since x² ≥ 0 for every x, x² + 3 ≥ 3. The range is f(x) ≥ 3. The minimum is where the square is zero.
A line on a restricted domain. h(x) = 2x − 1 for −1 ≤ x ≤ 4. A line with positive gradient is lowest at the left end and highest at the right: h(−1) = −3 and h(4) = 7. The range is −3 ≤ h(x) ≤ 7.
A curve on a restricted domain. p(x) = (x − 1)² for −2 ≤ x ≤ 2. The end points give p(−2) = 9 and p(2) = 1. It is tempting to write 1 ≤ p(x) ≤ 9, and it is wrong. Figure 4 shows why: the curve dips to its vertex at (1, 0) inside the domain. The range is 0 ≤ p(x) ≤ 9.
Find a range from the graph, not from the end points. Sketch it, or look at it on your GDC, and read off the lowest and the highest outputs, including any turning point inside the domain.
On Paper 1 you reason as above: squares and roots are never negative, and a line is lowest and highest at its ends.
6A function as a model
The guide treats a function as a mathematical model: a rule that describes a real quantity. When it does, the context sets the domain, and that is often smaller than the domain the algebra allows.
A ball is thrown straight up from the ground. Its height in metres after t seconds is modelled by h(t) = 20t − 4.9t². The formula works for any t. The ball does not. It leaves the ground at t = 0 and lands when h(t) = 0 again.
So a sensible domain is 0 ≤ t ≤ 4.08. The highest point is at t = 20 ÷ 9.8 ≈ 2.04 s, where h ≈ 20.4 m, so the range in context is 0 ≤ h(t) ≤ 20.4. Figure 5 shows the model and the part of the curve that means nothing.
Other contexts restrict the domain differently: a cost C(n) for n tickets only makes sense for whole numbers n ≥ 0. When a Paper 2 question asks for "a suitable domain", it wants the domain the context allows, with a reason.
7The inverse: undoing a function
An inverse function reverses the effect of a function. If f takes a to b, then f⁻¹ takes b back to a.
f(a) = b means exactly the same as f⁻¹(b) = a.
Temperature conversion is the everyday example. f(x) = 1.8x + 32 turns degrees Celsius into degrees Fahrenheit: multiply by 1.8, then add 32. To undo it you do the opposite operations in the opposite order: subtract 32, then divide by 1.8. So f⁻¹(x) = (x − 32) ÷ 1.8 turns Fahrenheit back into Celsius. Body temperature of 98.6 °F is f⁻¹(98.6) = 66.6 ÷ 1.8 = 37 °C.
This gives the guide's key link: solving f(x) = k is the same as finding f⁻¹(k). You do not need a formula for f⁻¹ to find one value of it.
On Paper 2, for a function you cannot rearrange easily, the GDC does it: to find f⁻¹(20) for f(x) = x³ + 2x + 1, solve x³ + 2x + 1 = 20 with the equation solver or by intersecting y = f(x) with y = 20.
One warning about the notation. f⁻¹(x) is the inverse function, not 1 ÷ f(x). The −1 here is not a power. For f(x) = 1.8x + 32, 1 ÷ f(x) is 1 ÷ (1.8x + 32), which converts nothing into anything.
Finding a formula for f⁻¹ by algebra is the job of 2.5.
8The inverse as a reflection in y = x
If (a, b) is on the graph of f, then f(a) = b, so f⁻¹(b) = a, and the point (b, a) is on the graph of f⁻¹. Swapping the coordinates of every point is the same as reflecting the whole graph in the line y = x. So:
The graph of y = f⁻¹(x) is the reflection of the graph of y = f(x) in the line y = x.
Figure 6 does it for the guide's function f(x) = √(2 − x). Take four points on f: (−7, 3), (−2, 2), (1, 1) and (2, 0). Swap each: (3, −7), (2, −2), (1, 1) and (0, 2). Join them with the reflected shape. The point (1, 1) lies on the mirror line, so it stays where it is. The inverse here is f⁻¹(x) = 2 − x² for x ≥ 0, a result 2.5 shows you how to find.
The reflection swaps x and y, so it swaps what you read along the x-axis with what you read up the y-axis. That is why:
- the domain of f⁻¹ is the range of f, and
- the range of f⁻¹ is the domain of f.
In Figure 6, the range of f is f(x) ≥ 0, so the domain of f⁻¹ is x ≥ 0. That is where the "x ≥ 0" in f⁻¹(x) = 2 − x² comes from. Without it, 2 − x² would be a whole parabola, and half of it would not be the reflection of anything.
To sketch an inverse in the exam: draw the line y = x lightly, pick three or four clear points on f including any intercepts and end points, swap their coordinates, and join them with the mirror-image shape. An x-intercept (a, 0) on f becomes a y-intercept (0, a) on f⁻¹, and the other way round. If f has an asymptote y = k, f⁻¹ has the asymptote x = k.
9Only one-to-one functions have inverses
A function is one-to-one when every output comes from exactly one input: no two inputs share an output. Only a one-to-one function has an inverse, because the inverse has to send each output back to a single input.
Figure 7 shows what goes wrong otherwise. f(x) = x² on all real numbers sends both −1.58 and 1.58 to 2.5; the horizontal line y = 2.5 meets the graph twice. Reflect the graph in y = x and you get a sideways curve that fails the vertical line test, so the reflection is not a function. This is the horizontal line test: if any horizontal line meets the graph of f more than once, f is not one-to-one and has no inverse.
The fix is to restrict the domain. On x ≥ 0 alone, x² is one-to-one, and its inverse is √x, as panel (b) shows.
Section 3 gave a warning sign for this. f(x) = 3x² − 2x had two solutions to f(x) = 8, so two inputs share the output 8, so f is not one-to-one on ℝ and has no inverse there.
A function that only ever increases, or only ever decreases, over its domain always passes the horizontal line test. That is the quickest reason to give when a question asks you to explain why an inverse exists.
10Where marks are lost
Reading f⁻¹(x) as 1 ÷ f(x). The −1 is a label for the inverse, not a power. The reciprocal of f is written 1/f(x) or (f(x))⁻¹.
Finding the range from the end points only. On a restricted domain, a turning point inside the domain can give an output lower or higher than either end. Sketch first.
Writing the range in terms of x. The range is a set of outputs: f(x) ≥ 3 or y ≥ 3, not x ≥ 3.
Forgetting a restriction that comes from a denominator. 5 ÷ (x − 3) needs x ≠ 3. A root in the denominator needs a strict inequality, because zero is no longer allowed.
Calling a many-to-one rule "not a function". Many-to-one is still a function; only one-to-many breaks the definition. Many-to-one does mean there is no inverse.
Reflecting in the wrong line. The inverse is the reflection in y = x, not in the x-axis or the y-axis. Swap the coordinates of each point, and check that points on y = x stay put.
Giving the inverse the wrong domain. The domain of f⁻¹ is the range of f. An inverse written without its domain, when f had a restricted range, usually loses the last mark.
Ignoring the context in a model. A time, a length or a number of people cannot be negative, and a number of people is a whole number. "A suitable domain" means one that makes sense for the situation.
11Work it right
- To decide if something is a function, check that each input has one output; on a graph, use the vertical line test.
- For a domain, look for three dangers: a denominator that could be zero, an even root of something that could be negative, a logarithm of something that could be zero or negative. Write the answer as an inequality in x.
- For a range, sketch the graph (on Paper 2, look at it on the GDC) and read off the lowest and highest outputs, including any vertex inside the domain. Write it in terms of f(x) or y.
- In a model, state the domain the context allows and say why in a few words.
- For f⁻¹(k), solve f(x) = k.
- To sketch f⁻¹, draw y = x, reflect three or four labelled points by swapping coordinates, and join them in the mirror-image shape.
- Before claiming an inverse exists, check the horizontal line test; state the domain of f⁻¹ as the range of f.
12Try it
Marks in brackets. Q1 to Q3 are Paper 1 style, no calculator. Q4 and Q5 are Paper 2 style, with a GDC.
Q1. The function f is defined by f(x) = √(10 − 2x).
(a) Find the largest possible domain of f. 2 marks
(b) Write down the range of f. 1 mark
(c) Find f(3). 1 mark
(d) Find the value of x for which f(x) = 4, and hence write down f⁻¹(4). 3 marks
Q2. For each of the following, state whether it represents a function, giving a reason.
(a) The set of pairs {(0, 5), (1, 5), (2, 7)}. 1 mark
(b) The set of pairs {(3, 1), (3, 2), (4, 6)}. 1 mark
(c) The graph of y² = x. 1 mark
Q3. The function g is defined by g(x) = 2x − 1 for −2 ≤ x ≤ 3.
(a) Find the range of g. 2 marks
(b) Sketch the graph of g and, on the same axes, the graph of g⁻¹, labelling the end points of each. 3 marks
(c) Write down the domain of g⁻¹. 1 mark
Q4. A ball is thrown upwards from a balcony. Its height above the ground, in metres, t seconds after it is thrown is modelled by h(t) = 1.5 + 14t − 5t², for t ≥ 0 until the ball hits the ground.
(a) Find the time at which the ball hits the ground, and hence state a suitable domain for h. 2 marks
(b) Find the range of h on this domain. 3 marks
(c) Explain why h does not have an inverse on this domain. 1 mark
Q5. The function f is defined by f(x) = x³ + 2x + 1 for x ∈ ℝ.
(a) Write down the value of f⁻¹(1). 1 mark
(b) Find f⁻¹(20). 2 marks
(c) Explain, with reference to the graph of f, why f⁻¹ exists. 1 mark
13In one breath
A function gives each input exactly one output; many-to-one is allowed, one-to-many is not, and on a graph that is the vertical line test. f(x) is the output for input x, and v(t) or C(n) are the same idea with other letters. The domain is the set of allowed inputs, the largest possible one unless you are told otherwise: exclude anything that divides by zero or takes an even root of a negative, and in a model keep only what the context allows. The range is the set of outputs, read off a graph, written in terms of f(x), and never found from the end points alone when a vertex sits inside the domain. An inverse undoes a function, so f(a) = b means f⁻¹(b) = a, and solving f(x) = k is finding f⁻¹(k). Its graph is the reflection of f in y = x, its domain is the range of f, and it exists only when f is one-to-one, which the horizontal line test checks; if f is not, restrict its domain until it is. And f⁻¹(x) is never 1 ÷ f(x).
Answers
Q1. (a) 10 − 2x ≥ 0, so x ≤ 5. M1 for setting the expression under the root ≥ 0, A1 for x ≤ 5. The strict x < 5 scores M1 A0.
(b) f(x) ≥ 0. A1. "x ≥ 0" scores 0: the range is about outputs.
(c) f(3) = √(10 − 6) = √4 = 2. A1.
(d) √(10 − 2x) = 4, so 10 − 2x = 16, giving x = −3. Hence f⁻¹(4) = −3. M1 for squaring both sides correctly, A1 for x = −3, A1 for f⁻¹(4) = −3 written down from it. Check: −3 ≤ 5, so it is in the domain.
Q2. (a) A function: each input 0, 1, 2 has one output; two inputs sharing the output 5 is allowed. A1 for the verdict with the reason.
(b) Not a function: the input 3 has two outputs, 1 and 2. A1.
(c) Not a function: for x = 4, y = 2 and y = −2, so the vertical line x = 4 meets the graph twice. A1 for the verdict with a specific input or the vertical line test.
Q3. (a) g is a line with positive gradient, so it is lowest at x = −2 and highest at x = 3: g(−2) = −5 and g(3) = 5. Range −5 ≤ g(x) ≤ 5. M1 for evaluating g at both end points, A1 for the inequality with both ends included.
(b) g is the segment from (−2, −5) to (3, 5). g⁻¹ is its reflection in y = x, the segment from (−5, −2) to (5, 3). The two segments cross on y = x at (1, 1). A1 for g as a straight segment with correct end points, A1 for g⁻¹ as its reflection with end points (−5, −2) and (5, 3), A1 for both drawn as segments that stop at their end points, not as full lines.
(c) The domain of g⁻¹ is the range of g: −5 ≤ x ≤ 5. A1. Follow-through from their (a).
Q4. (a) Solve 1.5 + 14t − 5t² = 0 on the GDC: t = −0.103 or t = 2.90. The negative root is rejected, so the ball lands at t = 2.90 s (3 s.f.) and a suitable domain is 0 ≤ t ≤ 2.90. A1 for 2.90, A1 for the domain, with the negative root rejected.
(b) The maximum from the GDC is at t = 1.4, where h = 1.5 + 19.6 − 9.8 = 11.3. The lowest height on the domain is 0, when the ball lands. The range is 0 ≤ h(t) ≤ 11.3. M1 for finding the maximum, A1 for 11.3, A1 for the full range with 0 as the lower bound. A lower bound of 1.5, from t = 0 only, scores A0.
(c) h is not one-to-one: every height between 1.5 m and 11.3 m is reached twice, once going up and once coming down, so a horizontal line meets the graph twice. R1 for "not one-to-one" with the reason in context or the horizontal line test.
Q5. (a) f(0) = 1, so f⁻¹(1) = 0. A1.
(b) Solve x³ + 2x + 1 = 20 on the GDC: x = 2.42 (3 s.f.), so f⁻¹(20) = 2.42. M1 for setting f(x) = 20, A1 for 2.42.
(c) The graph of f is increasing for all x, so every horizontal line meets it exactly once: f is one-to-one, so its inverse exists. R1 for one-to-one with a reason from the graph, such as always increasing or the horizontal line test.
Educerie · written from the published IB Diploma Programme Mathematics: analysis and approaches guide, first assessment 2021, section 2.2 Functions, domain, range and inverse. Original text, examples and questions. Diagrams drawn by Educerie. Last reviewed 25 September 2026.