Educerie · IB Diploma · Mathematics: analysis and approaches
Topic 2 Functions · 2.5 Composite and inverse functions
What you must be able to do
| You must be able to | Level | What it looks like in the exam |
|---|---|---|
| Evaluate a composite function at a number, in the right order | SL, HL | "Find (f ∘ g)(3)" (2 marks) |
| Find an expression for a composite function (f ∘ g)(x) = f(g(x)) and simplify it | SL, HL | "Find (g ∘ f)(x), giving your answer in the form ax² + bx + c" (2 to 3 marks) |
| Solve equations involving composite functions | SL, HL | "Solve (f ∘ g)(x) = 25" (3 marks) |
| Know the identity function and that (f ∘ f⁻¹)(x) = (f⁻¹ ∘ f)(x) = x | SL, HL | "Show that (f ∘ f⁻¹)(x) = x", or using it to check a found inverse |
| Know that an inverse exists only for a one-to-one function, restricting the domain where needed | SL, HL | "State why f⁻¹ does not exist"; "Find the least value of k for which f has an inverse on x ≥ k" |
| Find the inverse function f⁻¹(x) by algebra, with its domain | SL, HL | "Find f⁻¹(x)" (3 marks); "State the domain of f⁻¹" (1 mark) |
| Link f⁻¹ to the reflection of the graph in y = x | SL, HL | "Sketch the graph of f⁻¹ on the same axes" (2 marks) |
Before you start
You need function notation, domain and range, and the idea of an inverse as an "undo" that reflects the graph in y = x, all from 2.2. You need to expand brackets, rearrange formulas to change the subject, and solve linear and quadratic equations. Section 6 uses one example with a logarithm; if you have not met logarithms yet (1.5 and 2.9), skip that example and come back.
1The idea in one paragraph
Functions can be joined end to end. Put x into g, then put the result into f, and you have a new function, the composite f ∘ g, written (f ∘ g)(x) = f(g(x)). The function nearest the x acts first, so f ∘ g and g ∘ f are usually different. The identity function is the one that does nothing, x ↦ x. A function and its inverse cancel out to the identity: f(f⁻¹(x)) = x and f⁻¹(f(x)) = x. That is the definition of the inverse, and it gives the method for finding one: undo the steps of f in reverse order, which in practice means writing y = f(x), swapping x and y, and making y the subject again. The inverse only exists when f is one-to-one, its domain is the range of f, and its graph is the reflection of f in the line y = x.
2Composite functions
A composite function is two functions applied one after the other. Figure 1 draws it as two machines in a row, with f(x) = 2x + 1 and g(x) = x².
(f ∘ g)(x) = f(g(x)): g acts first, then f. Read from the inside out, or from right to left.
The notation looks backwards until you read it as a bracket: f(g(x)) is "f of g of x", and you always work out the inside bracket first.
At a number. Work from the inside out, one function at a time.
As an expression. Replace every x in the outer function with the whole inner function, in brackets.
Check the expression against the number: (f ∘ g)(3) = 2(9) + 1 = 19. It agrees.
Order matters. Figure 2 runs the same input through both orders. (f ∘ g)(3) = 19 but (g ∘ f)(3) = 7² = 49. Squaring then doubling is not the same as doubling then squaring. In general f ∘ g ≠ g ∘ f, and a question that asks for one will not accept the other.
A function can also be composed with itself. (f ∘ f)(x) = f(f(x)) = 2(2x + 1) + 1 = 4x + 3.
Solving an equation with a composite. Build the composite first, then solve as usual.
Both answers are valid, because g squares away the sign. Check one: (f ∘ g)(−3) = 2(9) + 1 = 19.
3When the inner output must fit the outer domain
The output of g becomes the input of f, so it has to be something f is allowed to take. With f(x) = √x (domain x ≥ 0) and g(x) = x − 5:
- (f ∘ g)(x) = √(x − 5). The inner result x − 5 must be at least 0, so the composite only works for x ≥ 5. The domain of f ∘ g is smaller than the domain of g.
- (g ∘ f)(x) = √x − 5. Here f acts first, so x ≥ 0 is needed, and after that g accepts anything. Domain x ≥ 0.
So (f ∘ g)(2) does not exist: g(2) = −3, and f cannot take −3. When a question asks you to explain why a composite is undefined at some value, this is the explanation: the inner output falls outside the domain of the outer function.
Taking a composite apart. Often you need to see a function as a composite. h(x) = (3x − 1)⁴ is "take 3x − 1, then raise it to the fourth power", so h = f ∘ g with g(x) = 3x − 1 and f(x) = x⁴. That skill is exactly what the chain rule in calculus needs, so practise naming the inside and the outside now.
In context. Composites describe chains of conversions. Suppose, as an illustration, that one US dollar buys 0.9 euros and one euro buys 160 yen. Then g(x) = 0.9x converts dollars to euros and f(x) = 160x converts euros to yen. The composite (f ∘ g)(x) = 160(0.9x) = 144x converts dollars straight to yen: $50 is 7200 yen. The order is forced by the units: g must act first, because f expects euros.
4The identity function, and what an inverse really is
The identity function leaves every input unchanged: I(x) = x. Composing with it changes nothing: f(I(x)) = f(x) and I(f(x)) = f(x). Its graph is the line y = x, the mirror line from 2.2.
The inverse of f is the function that brings you back to where you started, whichever order you apply the two in.
(f ∘ f⁻¹)(x) = (f⁻¹ ∘ f)(x) = x
This is the whole meaning of an inverse, written as algebra. It also gives you a way to check any inverse you find: compose the two and simplify. If you do not get x, the inverse is wrong.
Take the temperature conversion from 2.2: f(x) = 1.8x + 32 turns Celsius into Fahrenheit, and f⁻¹(x) = (x − 32) ÷ 1.8 turns it back.
5Which functions have an inverse
An inverse has to send each output back to exactly one input. So f has an inverse only if it is one-to-one: no two inputs share an output. On a graph, every horizontal line meets it at most once (the horizontal line test from 2.2).
When a function is not one-to-one, restrict its domain until it is. For f(x) = (x − 3)² + 1 on all real numbers, f(2) = f(4) = 2, so there is no inverse. Its vertex is at x = 3, and on either side of the vertex it is one-to-one. The usual choice is the right-hand half, x ≥ 3, which is also the answer to "find the smallest value of k such that f has an inverse on x ≥ k": k = 3, the x-coordinate of the vertex.
6Finding the inverse by algebra
The inverse undoes the steps of f in reverse order, as Figure 3 shows for f(x) = 4x − 7: f multiplies by 4 and then subtracts 7, so f⁻¹ adds 7 and then divides by 4.
For anything longer than two steps, use the algebraic method. It works for every function on the syllabus.
To find f⁻¹(x): write y = f(x), swap x and y, then rearrange to make y the subject.
Swapping x and y is the algebra of reflecting in y = x: every point (a, b) becomes (b, a). You may also rearrange first and swap last; the answer is the same. What you must not do is stop before the swap, because then your formula has y in terms of x the wrong way round.
Example 1 · a linear function. f(x) = 4x − 7.
Example 2 · a rational function. f(x) = (2x + 3) ÷ (x − 1), x ≠ 1. The move to learn is collecting every y term on one side and factorising y out.
The domain of f⁻¹ is the range of f. The range of f is every real number except 2, its horizontal asymptote, so the domain of f⁻¹ is x ≠ 2, which agrees with the denominator. Figure 4 shows what the reflection does to the asymptotes: f has x = 1 and y = 2, and f⁻¹ has x = 2 and y = 1. The asymptotes swap, as every other feature does.
Check with the identity. Substituting f⁻¹ into f:
Example 3 · a restricted quadratic. f(x) = (x − 3)² + 1, for x ≥ 3. Here the square root brings a choice of sign, and the domain makes it.
The range of f is f(x) ≥ 1 (the vertex is (3, 1)), so the domain of f⁻¹ is x ≥ 1. The domain of f is x ≥ 3, so the range of f⁻¹ is y ≥ 3, and that is why the positive root is the right one: 3 − √(x − 1) would give values below 3. Figure 5 draws both. They meet on the line y = x, at the point where f(x) = x:
For an increasing function like this one, the graphs of f and f⁻¹ can only meet on y = x, so solving f(x) = x is the fast way to find where f and f⁻¹ intersect.
Example 4 · an exponential. If you have met logarithms: f(x) = 2ˣ − 1. Swap to x = 2ʸ − 1, so 2ʸ = x + 1 and y = log₂(x + 1). The range of f is f(x) > −1, so f⁻¹(x) = log₂(x + 1), x > −1. Exponentials and logarithms are inverses of each other, which is the whole story of 2.9.
Some functions are their own inverse. For f(x) = (3x + 1) ÷ (x − 3), swapping and rearranging gives f⁻¹(x) = (3x + 1) ÷ (x − 3) again, so f(f(x)) = x. Its graph is symmetric in y = x. It is a curiosity, but a question that asks you to "find f⁻¹ and comment" wants you to notice it.
7Using inverses without finding the formula
Two shortcuts save time on Paper 1.
f⁻¹ at one value. f⁻¹(k) is the input that gives output k, so solve f(x) = k. For f(x) = (2x + 3) ÷ (x − 1), f⁻¹(7) solves (2x + 3) = 7(x − 1), so 5x = 10 and f⁻¹(7) = 2. Check: f(2) = 7 ÷ 1 = 7. Using the formula from Example 2, (7 + 3) ÷ (7 − 2) = 2, the same.
Composites with inverses. (f⁻¹ ∘ g)(x) means g first, then f⁻¹. Work from the inside out exactly as before: find g(x) at your number, then apply f⁻¹ to the result.
And a composite chain can be undone too. To undo "g then f", you undo f first and then undo g, just as you take off your shoes before your socks. In the currency example, (f ∘ g)(x) = 144x changes dollars to yen, and its inverse x ÷ 144 changes yen back to dollars: 7200 yen is $50.
8Where marks are lost
Doing the composite in the wrong order. (f ∘ g)(x) = f(g(x)): g first. Writing g(f(x)) for f ∘ g is the most common error in this subtopic and scores no marks for that part.
Substituting without brackets. g(2x + 1) with g(x) = x² is (2x + 1)², not 2x² + 1. Put the whole inner function in brackets before simplifying.
Treating f⁻¹(x) as 1 ÷ f(x). The inverse of 4x − 7 is (x + 7) ÷ 4, not 1 ÷ (4x − 7).
Forgetting to swap x and y. Rearranging y = 4x − 7 into x = (y + 7) ÷ 4 and stopping gives an answer in the wrong variable. The final answer must be f⁻¹(x) = … in terms of x.
Failing to collect the y terms. In a rational function, y appears twice after cross-multiplying. Gather both on one side, then factorise y out; dividing by part of an expression is not rearranging.
Keeping ± in the answer. An inverse is a function, so it has one output. Use the domain of f (which is the range of f⁻¹) to choose the sign.
Leaving out the domain of the inverse. When f has a restricted domain or range, the last mark for f⁻¹ is usually for stating its domain, which is the range of f.
Ignoring the inner domain of a composite. (f ∘ g)(a) does not exist when g(a) is outside the domain of f, even if both f and g are defined at a.
9Work it right
- For (f ∘ g)(a), find g(a) first, write it down, then apply f.
- For (f ∘ g)(x), write f( g(x) ), put g(x) in brackets in place of every x in f, then simplify.
- For an equation such as (f ∘ g)(x) = k, build the composite, then solve and check each answer.
- Before finding an inverse, check f is one-to-one on its domain; if not, restrict the domain.
- Write y = f(x), swap x and y, and rearrange for y. In a fraction: multiply by the denominator, collect the y terms, factorise y out.
- Choose any ± sign using the range of f⁻¹, which is the domain of f.
- State the domain of f⁻¹ as the range of f.
- Check with f(f⁻¹(x)) = x, or at one number: if f(a) = b then f⁻¹(b) should be a.
10Try it
Marks in brackets. Q1 to Q4 are Paper 1 style, no calculator. Q5 is Paper 2 style, with a GDC.
Q1. Let f(x) = 3x − 2 and g(x) = x² + 1.
(a) Find (f ∘ g)(2). 2 marks
(b) Find (g ∘ f)(x), giving your answer in the form ax² + bx + c. 2 marks
(c) Solve (f ∘ g)(x) = 25. 3 marks
Q2. Let f(x) = (x + 4) ÷ (x − 2), for x ≠ 2.
(a) Find f⁻¹(x). 3 marks
(b) Write down the domain of f⁻¹. 1 mark
(c) Find f⁻¹(3). 1 mark
Q3. Let g(x) = √(x + 2), for x ≥ −2, and h(x) = x² − 6.
(a) Find (h ∘ g)(x), simplifying your answer, and state its domain. 3 marks
(b) Show that (g ∘ h)(3) = √5. 2 marks
(c) Explain why (g ∘ h)(1) does not exist. 1 mark
Q4. Let f(x) = (x − 2)² + 3, for x ≥ 2.
(a) Find f⁻¹(x) and state its domain. 4 marks
(b) Show that the graphs of y = f(x) and y = f⁻¹(x) do not intersect. 3 marks
Q5. The function C(F) = (F − 32) ÷ 1.8 converts a temperature in degrees Fahrenheit to degrees Celsius, and K(C) = C + 273.15 converts degrees Celsius to kelvin.
(a) Find an expression for (K ∘ C)(F), and say what it does. 2 marks
(b) Find the temperature in degrees Fahrenheit that is equal to 300 K. 2 marks
(c) Find (K ∘ C)⁻¹(x). 2 marks
11In one breath
(f ∘ g)(x) = f(g(x)): the function nearest the x acts first, so work from the inside out, put the whole inner function in brackets in place of x, and do not expect f ∘ g to equal g ∘ f. The inner output must lie in the domain of the outer function, or the composite does not exist there. The identity function is x ↦ x, and an inverse is whatever composes with f to give it: f(f⁻¹(x)) = f⁻¹(f(x)) = x. Only a one-to-one function has an inverse, so restrict the domain when it is not. To find f⁻¹, write y = f(x), swap x and y, and make y the subject; in a fraction, multiply out, collect the y terms and factorise y out; pick any ± using the domain of f. The domain of f⁻¹ is the range of f, its graph is f reflected in y = x, asymptotes and all, and for an increasing function the two graphs meet only where f(x) = x. Check every inverse by composing it with f.
Answers
Q1. (a) g(2) = 5, so (f ∘ g)(2) = f(5) = 15 − 2 = 13. M1 for finding g(2) first, A1 for 13. Finding f(2) = 4 then g(4) = 17 is the wrong order and scores M0 A0.
(b) (g ∘ f)(x) = (3x − 2)² + 1 = 9x² − 12x + 4 + 1 = 9x² − 12x + 5. M1 for substituting 3x − 2 into g with brackets, A1 for the expanded form.
(c) (f ∘ g)(x) = 3(x² + 1) − 2 = 3x² + 1. So 3x² + 1 = 25, x² = 8, and x = ±2√2. M1 for a correct expression for (f ∘ g)(x), M1 for setting it equal to 25 and rearranging, A1 for both values. Only x = 2√2 scores A0.
Q2. (a) Swap: x = (y + 4) ÷ (y − 2). Then xy − 2x = y + 4, so xy − y = 2x + 4, y(x − 1) = 2x + 4, and f⁻¹(x) = (2x + 4) ÷ (x − 1). M1 for interchanging x and y (at any stage), M1 for collecting the y terms and factorising, A1 for the answer.
(b) x ≠ 1 (x ∈ ℝ). The range of f excludes 1, its horizontal asymptote. A1.
(c) f⁻¹(3) = (6 + 4) ÷ (3 − 1) = 5. Check: f(5) = 9 ÷ 3 = 3. A1. Solving f(x) = 3 directly is equally acceptable.
Q3. (a) (h ∘ g)(x) = (√(x + 2))² − 6 = x + 2 − 6 = x − 4, with domain x ≥ −2, because g acts first and needs x ≥ −2. M1 for substituting g into h, A1 for x − 4, A1 for the domain. The domain x ∈ ℝ, read off the simplified line, scores A0.
(b) h(3) = 9 − 6 = 3, and g(3) = √(3 + 2) = √5, as required. M1 for h(3) = 3 found first, A1 for g(3) = √5 shown. This is a "show that": both steps must be written.
(c) h(1) = 1 − 6 = −5, which is not in the domain of g (x ≥ −2), since √(−3) is not real. R1 for identifying that h(1) = −5 lies outside the domain of g.
Q4. (a) Swap: x = (y − 2)² + 3, so (y − 2)² = x − 3 and y = 2 ± √(x − 3). The range of f⁻¹ is the domain of f, y ≥ 2, so take the positive root: f⁻¹(x) = 2 + √(x − 3). The range of f is f(x) ≥ 3, so the domain of f⁻¹ is x ≥ 3. M1 for interchanging x and y, A1 for 2 ± √(x − 3) or equivalent, R1 for rejecting the negative root with a reason, A1 for the domain x ≥ 3.
(b) f is increasing on x ≥ 2, so any intersection of f and f⁻¹ lies on y = x, where f(x) = x. Then (x − 2)² + 3 = x gives x² − 5x + 7 = 0. The discriminant is 25 − 28 = −3 < 0, so there are no real solutions, and the graphs do not meet. M1 for setting f(x) = x (or f(x) = f⁻¹(x)), A1 for the quadratic x² − 5x + 7 = 0, R1 for the negative discriminant with the conclusion.
Q5. (a) (K ∘ C)(F) = (F − 32) ÷ 1.8 + 273.15. It converts a temperature in degrees Fahrenheit directly to kelvin. A1 for the expression, A1 for the interpretation.
(b) (F − 32) ÷ 1.8 + 273.15 = 300, so (F − 32) ÷ 1.8 = 26.85, F − 32 = 48.33, and F = 80.3 °F (3 s.f.). M1 for setting the composite equal to 300, A1 for 80.3.
(c) Swap and rearrange: x = (y − 32) ÷ 1.8 + 273.15, so y − 32 = 1.8(x − 273.15), and (K ∘ C)⁻¹(x) = 1.8(x − 273.15) + 32. It converts kelvin back to degrees Fahrenheit. M1 for an attempt to rearrange with x and y swapped, A1 for the answer or an equivalent form, such as 1.8x − 459.67.
Educerie · written from the published IB Diploma Programme Mathematics: analysis and approaches guide, first assessment 2021, section 2.5 Composite and inverse functions. Original text, examples and questions. Diagrams drawn by Educerie. Last reviewed 25 September 2026.