impera Open Impera

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))$.

Worked example

Composing two functions

  1. $f(x) = 2x + 1$ and $g(x) = x^2$.
  2. $f(g(x)) = f(x^2) = 2x^2 + 1$.
  3. $g(f(x)) = g(2x + 1) = (2x + 1)^2 = 4x^2 + 4x + 1$.
  4. $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))?

  • 2(x + 3)

  • x + 5

  • 2x + 3

  • 2x + 6

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.
Worked example

Finding an inverse

  1. Find the inverse of $f(x) = \dfrac{2x + 1}{3}$.
  2. Write $y = \dfrac{2x + 1}{3}$. Swap: $x = \dfrac{2y + 1}{3}$.
  3. $3x = 2y + 1$, so $y = \dfrac{3x - 1}{2}$.
  4. $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?

  • f⁻¹(x) = x − 5

  • f⁻¹(x) = 1/(x + 5)

  • f⁻¹(x) = x + 5

  • f⁻¹(x) = 5x

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?

  • y = x

  • y = −x

  • The y-axis

  • The x-axis

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$.

Worked example

$f(x) = \sqrt{x}$, $g(x) = x - 4$

  1. $(f \circ g)(x) = \sqrt{x - 4}$.
  2. Need $x - 4 \ge 0$, so the domain is $x \ge 4$.
  3. $(g \circ f)(x) = \sqrt{x} - 4$, with domain $x \ge 0$.
  4. 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)$?

  • 9

  • 3

  • $\sqrt{13} - 4$

  • 13

Show the answer

3

$\sqrt{13 - 4}$.

5Self-checking an inverse

You can check an inverse by composing: $f(f^{-1}(x)) = x$.

Worked example

$f(x) = \frac{2x + 1}{x - 3}$, $x \ne 3$

  1. Write $y = \frac{2x + 1}{x - 3}$ and swap: $x = \frac{2y + 1}{y - 3}$.
  2. $x(y - 3) = 2y + 1$, so $xy - 3x = 2y + 1$.
  3. $xy - 2y = 3x + 1$, so $y(x - 2) = 3x + 1$.
  4. $f^{-1}(x) = \frac{3x + 1}{x - 2}$, $x \ne 2$.
  5. 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)$?

  • $\frac{1}{2x + 6}$

  • $\frac{x - 6}{2}$

  • $\frac{x}{2} + 6$

  • $2x - 6$

Show the answer

$\frac{x - 6}{2}$

Undo in reverse order.

6Going deeper: full worked problems on composites, inverses and self-inverse functions

Worked example

$f(x) = 2x + 3$ and $g(x) = x^2 - 1$.

  1. $(f \circ g)(x) = f(g(x)) = 2(x^2 - 1) + 3 = 2x^2 + 1$.
  2. $(g \circ f)(x) = g(f(x)) = (2x + 3)^2 - 1 = 4x^2 + 12x + 8$.
  3. The two are different: the order matters. The function nearest $x$ acts first.
  4. Solve $(f \circ g)(x) = 19$: $2x^2 + 1 = 19$, so $x^2 = 9$ and $x = \pm 3$.
Worked example

find the inverse of $f(x) = \frac{3x - 1}{x + 2}$, $x \ne -2$.

  1. Write $y = \frac{3x - 1}{x + 2}$ and multiply out: $xy + 2y = 3x - 1$.
  2. Collect the terms in $x$: $xy - 3x = -1 - 2y$.
  3. Factorise: $x(y - 3) = -(2y + 1)$, so $x = \frac{2y + 1}{3 - y}$.
  4. $f^{-1}(x) = \frac{2x + 1}{3 - x}$, $x \ne 3$.
  5. Check with a number: $f(1) = \frac{2}{3}$, and $f^{-1}\left(\frac{2}{3}\right) = \frac{7/3}{7/3} = 1$.
Worked example

$f(x) = (x - 2)^2 + 1$ for $x \ge 2$. Find $f^{-1}$.

  1. Without the restriction, $f$ is many-to-one and has no inverse.
  2. $y - 1 = (x - 2)^2$, so $x - 2 = \pm\sqrt{y - 1}$.
  3. Since $x \ge 2$, take the positive root: $f^{-1}(x) = 2 + \sqrt{x - 1}$.
  4. 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)?

  • −3

  • 3 or −3

  • 123

  • 3

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