IB Diploma Mathematics AA · Functions
Composite and inverse functions
1Composite functions
A composite function applies one function and then another to the result.
$$(f \circ g)(x) = f(g(x))$$
Work from the inside out: apply $g$ first, then $f$.
Order matters. In general, $f(g(x))$ is not the same as $g(f(x))$.
Composing two functions
- $f(x) = 2x + 1$ and $g(x) = x^2$.
- $f(g(x)) = f(x^2) = 2x^2 + 1$.
- $g(f(x)) = g(2x + 1) = (2x + 1)^2 = 4x^2 + 4x + 1$.
- $f(g(3)) = 2 \times 9 + 1 = 19$, and $g(f(3)) = 7^2 = 49$.
Check yourself
If f(x) = x + 3 and g(x) = 2x, what is f(g(x))?
Show the answer
2x + 3
Apply g first to get 2x, then add 3.
2Inverse functions
The inverse function, $f^{-1}$, undoes $f$. If $f(a) = b$, then $f^{-1}(b) = a$.
$$f(f^{-1}(x)) = f^{-1}(f(x)) = x$$
To find an inverse:
- write $y = f(x)$;
- swap $x$ and $y$;
- rearrange to make $y$ the subject.
Finding an inverse
- Find the inverse of $f(x) = \dfrac{2x + 1}{3}$.
- Write $y = \dfrac{2x + 1}{3}$. Swap: $x = \dfrac{2y + 1}{3}$.
- $3x = 2y + 1$, so $y = \dfrac{3x - 1}{2}$.
- $f^{-1}(x) = \dfrac{3x - 1}{2}$. Check: $f(4) = 3$, and $f^{-1}(3) = \dfrac{8}{2} = 4$.
Note that $f^{-1}(x)$ does not mean $\dfrac{1}{f(x)}$.
Check yourself
What is the inverse of f(x) = x + 5?
Show the answer
f⁻¹(x) = x − 5
Subtracting 5 undoes adding 5.
3Graphs of inverses
The graph of $f^{-1}$ is the reflection of the graph of $f$ in the line $y = x$.
A function and its inverse are reflections in the line y = x
The domain of $f^{-1}$ is the range of $f$, and the range of $f^{-1}$ is the domain of $f$.
When does an inverse exist? Only when the function is one-to-one: each output comes from exactly one input. On a graph, every horizontal line crosses at most once.
The function $f(x) = x^2$ is not one-to-one, because $f(2) = f(-2) = 4$. If the domain is restricted to $x \geq 0$, it becomes one-to-one, and its inverse is $f^{-1}(x) = \sqrt{x}$.
The identity function is $I(x) = x$. A function that is its own inverse is called self-inverse, such as $f(x) = \dfrac{1}{x}$.
Check yourself
In which line is the graph of an inverse function a reflection of the original?
Show the answer
y = x
Swapping x and y reflects the graph in y = x.
4Domains of composite functions
For $f \circ g$ to exist, the outputs of $g$ must lie in the domain of $f$.
$f(x) = \sqrt{x}$, $g(x) = x - 4$
- $(f \circ g)(x) = \sqrt{x - 4}$.
- Need $x - 4 \ge 0$, so the domain is $x \ge 4$.
- $(g \circ f)(x) = \sqrt{x} - 4$, with domain $x \ge 0$.
- Note: $f \circ g \ne g \circ f$ in general.
Check yourself
If $f(x) = \sqrt{x}$ and $g(x) = x - 4$, what is $(f \circ g)(13)$?
Show the answer
3
$\sqrt{13 - 4}$.
5Self-checking an inverse
You can check an inverse by composing: $f(f^{-1}(x)) = x$.
$f(x) = \frac{2x + 1}{x - 3}$, $x \ne 3$
- Write $y = \frac{2x + 1}{x - 3}$ and swap: $x = \frac{2y + 1}{y - 3}$.
- $x(y - 3) = 2y + 1$, so $xy - 3x = 2y + 1$.
- $xy - 2y = 3x + 1$, so $y(x - 2) = 3x + 1$.
- $f^{-1}(x) = \frac{3x + 1}{x - 2}$, $x \ne 2$.
- Check with $x = 4$: $f(4) = 9$, and $f^{-1}(9) = \frac{28}{7} = 4$. Correct.
Check yourself
If $f(x) = 2x + 6$, what is $f^{-1}(x)$?
Show the answer
$\frac{x - 6}{2}$
Undo in reverse order.
6Going deeper: full worked problems on composites, inverses and self-inverse functions
$f(x) = 2x + 3$ and $g(x) = x^2 - 1$.
- $(f \circ g)(x) = f(g(x)) = 2(x^2 - 1) + 3 = 2x^2 + 1$.
- $(g \circ f)(x) = g(f(x)) = (2x + 3)^2 - 1 = 4x^2 + 12x + 8$.
- The two are different: the order matters. The function nearest $x$ acts first.
- Solve $(f \circ g)(x) = 19$: $2x^2 + 1 = 19$, so $x^2 = 9$ and $x = \pm 3$.
find the inverse of $f(x) = \frac{3x - 1}{x + 2}$, $x \ne -2$.
- Write $y = \frac{3x - 1}{x + 2}$ and multiply out: $xy + 2y = 3x - 1$.
- Collect the terms in $x$: $xy - 3x = -1 - 2y$.
- Factorise: $x(y - 3) = -(2y + 1)$, so $x = \frac{2y + 1}{3 - y}$.
- $f^{-1}(x) = \frac{2x + 1}{3 - x}$, $x \ne 3$.
- Check with a number: $f(1) = \frac{2}{3}$, and $f^{-1}\left(\frac{2}{3}\right) = \frac{7/3}{7/3} = 1$.
$f(x) = (x - 2)^2 + 1$ for $x \ge 2$. Find $f^{-1}$.
- Without the restriction, $f$ is many-to-one and has no inverse.
- $y - 1 = (x - 2)^2$, so $x - 2 = \pm\sqrt{y - 1}$.
- Since $x \ge 2$, take the positive root: $f^{-1}(x) = 2 + \sqrt{x - 1}$.
- Domain of $f^{-1}$ = range of $f$: $x \ge 1$. Range of $f^{-1}$ = domain of $f$: $y \ge 2$.
Self-inverse functions satisfy $f(f(x)) = x$, so $f^{-1} = f$. Example: $f(x) = \frac{x + 1}{x - 1}$.
- $f(f(x)) = \frac{\frac{x+1}{x-1} + 1}{\frac{x+1}{x-1} - 1} = \frac{2x}{2} = x$.
- The graph of a self-inverse function is symmetric in the line $y = x$.
Facts to quote
- $(f \circ f^{-1})(x) = x$ and $(f^{-1} \circ f)(x) = x$.
- The graphs of $f$ and $f^{-1}$ are reflections of each other in $y = x$. They meet on that line, so solving $f(x) = x$ finds those intersections.
- $(f \circ g)^{-1} = g^{-1} \circ f^{-1}$: undo the last step first.
- $f^{-1}(x)$ does not mean $\frac{1}{f(x)}$.
Check yourself
f(x) = x² + 2 for x ≤ 0. What is f⁻¹(11)?
Show the answer
−3
x² + 2 = 11 gives x² = 9; the domain x ≤ 0 selects −3.
Now test yourself
This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.
Practise in Impera