# Composition of functions and inverse functions

> IB Mathematics: Applications and Interpretation HL · IB AI HL
> Source: https://www.owlsprep.com/study/ib-math-ai-hl-u2-composition-of-functions-and-inverse/

This module explains how to combine functions via composition, identify when a function has an inverse, find inverses algebraically and graphically, and solve problems involving these core function concepts for IB AI HL exams.

**Prerequisites:** [Function notation, domain and range](https://www.owlsprep.com/study/ib-math-ai-hl-u1-function-basics/); [One-to-one function properties](https://www.owlsprep.com/study/ib-math-ai-hl-u2-properties-of-functions/)

## Learning objectives

- Compose two or more functions and determine the domain of the resulting composite function
- Identify one-to-one functions and find the inverse of a one-to-one function algebraically
- Verify inverse pairs and describe the graphical relationship between a function and its inverse
- Apply composition and inverses to solve real-world context problems

## Composition of Functions

**Composite function** — A function formed by applying the output of inner function $g$ as the input to outer function $f$, read as "f of g of x".

*Notation:* $(f \circ g)(x) = f(g(x))$

*Example:* If $f(x)=x^2$ and $g(x)=x+1$, then $(f \circ g)(x)=(x+1)^2$

Order matters for composition: $f \circ g$ is almost never equal to $g \circ f$. The domain of $f \circ g$ is all $x$ in the domain of $g$ where $g(x)$ is also in the domain of $f$.

**Worked example:** Let $f(x) = \sqrt{x-2}$ and $g(x) = x^2 - 5$. Find $(f \circ g)(x)$ and state its domain.

1. 1. Substitute $g(x)$ into $f$ to get the composite expression:
2. $$(f \circ g)(x) = f(g(x)) = f(x^2 - 5) = \sqrt{(x^2 - 5) - 2} = \sqrt{x^2 - 7}$$
3. 2. Find domain restrictions: $g(x)$ is defined for all real $x$, so we only require the expression under the square root to be non-negative:
4. $$x^2 - 7 \geq 0 \implies x^2 \geq 7 \implies x \leq -\sqrt{7} \text{ or } x \geq \sqrt{7}$$
5. 3. Final domain in interval notation: $(-\infty, -\sqrt{7}] \cup [\sqrt{7}, \infty)$

> **Exam tip:** Always check domain restrictions from both the inner and outer functions when calculating composite domains.

## One-to-One Functions and Inverse Functions

**Inverse function** — A function that reverses the mapping of a one-to-one function $f$, satisfying $f^{-1}(f(x))=x$ for all $x$ in the domain of $f$, and $f(f^{-1}(x))=x$ for all $x$ in the domain of $f^{-1}$. Only one-to-one functions have inverse functions.

*Notation:* $f^{-1}(x)$

*Example:* If $f(x)=2x+4$, then $f^{-1}(x)=\frac{x-4}{2}$

A function is one-to-one if it passes the horizontal line test: no horizontal line intersects its graph more than once. If a function is not one-to-one over its natural domain, you can restrict the domain to create a one-to-one function that has an inverse.

**Worked example:** Find the inverse of $f(x) = 3x - 6$ and verify it is correct.

1. 1. Replace $f(x)$ with $y$:
2. $$y = 3x - 6$$
3. 2. Swap $x$ and $y$, a required step for finding inverses:
4. $$x = 3y - 6$$
5. 3. Solve for $y$:
6. $$x + 6 = 3y \implies y = \frac{x + 6}{3} = \frac{1}{3}x + 2$$
7. 4. Replace $y$ with $f^{-1}(x)$:
8. $$f^{-1}(x) = \frac{1}{3}x + 2$$
9. 5. Verify by checking $f(f^{-1}(x))=x$:
10. $$f\left(\frac{1}{3}x + 2\right) = 3\left(\frac{1}{3}x + 2\right) - 6 = x + 6 - 6 = x$$
11. The inverse is confirmed correct.

## Graphical Properties of Inverses

The most important graphical property of inverse functions is the reflection rule: the graph of $y=f^{-1}(x)$ is the reflection of the graph of $y=f(x)$ across the line $y=x$. This comes directly from swapping $x$ and $y$ when finding the inverse.

This reflection rule also gives a useful domain/range relationship: the domain of the original function is the range of its inverse, and the range of the original function is the domain of its inverse.

**Worked example:** The function $f(x) = (x-2)^2$ is restricted to the domain $x \geq 2$, range $y \geq 0$. What is the domain and range of $f^{-1}(x)$?

1. 1. Use the domain/range swap rule for inverses:
2. Domain of $f^{-1}(x)$ = Range of $f(x)$ = $[0, \infty)$
3. Range of $f^{-1}(x)$ = Domain of $f(x)$ = $[2, \infty)$
4. Graphically, the inverse is a reflection of the restricted parabola across $y=x$, which matches this result.

## Composition and Inverses in Context

In IB AI HL exams, you will often encounter these concepts in real-world contexts. Composition combines two sequential relationships, while inverses reverse a relationship to find an input from a given output.

**Worked example:** The temperature in Celsius is converted to Fahrenheit with $F(C) = \frac{9}{5}C + 32$. Find the inverse function to convert Fahrenheit back to Celsius, then find the Celsius equivalent of 77°F.

1. 1. Write the original function, swap $F$ and $C$:
2. $$F = \frac{9}{5}C + 32 \implies C = \frac{9}{5}F^{-1}(C) + 32$$
3. 2. Solve for the inverse function $F^{-1}(C)$:
4. $$C - 32 = \frac{9}{5}F^{-1}(C) \implies F^{-1}(C) = \frac{5}{9}(C - 32)$$
5. 3. Substitute 77°F into the inverse:
6. $$F^{-1}(77) = \frac{5}{9}(77 - 32) = \frac{5}{9}(45) = 25^\circ C$$

## Common pitfalls

- **Wrong:** Confusing $(f \circ g)(x)$ with $f(x) \times g(x)$
  - Why it fails: The open circle notation for composition is not a multiplication symbol
  - Correct: Remember $(f \circ g)(x)$ means substitute $g(x)$ into $f(x)$ as input, i.e. $f(g(x))$
- **Wrong:** Treating $f^{-1}(x)$ as the reciprocal $\frac{1}{f(x)}$
  - Why it fails: The negative exponent notation for inverses does not follow the usual reciprocal rule
  - Correct: $f^{-1}(x)$ always refers to the inverse function that reverses the mapping of $f(x)$, never the reciprocal
- **Wrong:** Only checking domain restrictions from the outer function for composite functions
  - Why it fails: The inner function may already exclude inputs that are valid for the outer function
  - Correct: First find the domain of the inner function, then apply any additional restrictions from the outer function
- **Wrong:** Finding an inverse for a many-to-one function without restricting the domain
  - Why it fails: A many-to-one function fails the horizontal line test, so it does not have a valid inverse function over its full domain
  - Correct: Restrict the domain of the original function to an interval where it is one-to-one before finding the inverse

## Cheatsheet

| Concept | Key Rule | Notation |
| --- | --- | --- |
| Composition $f$ after $g$ | Substitute $g(x)$ into $f(x)$ | $(f \circ g)(x) = f(g(x))$ |
| Domain of $f \circ g$ | x in domain(g), g(x) in domain(f) | - |
| Inverse function | Reverses mapping of one-to-one $f$ | $f^{-1}(x) \neq \frac{1}{f(x)}$ |
| Inverse verification | $f(f^{-1}(x)) = x$ and $f^{-1}(f(x)) = x$ | - |
| Graph of inverse | Reflection over $y=x$ from $y=f(x)$ | - |
| Domain/range swap | Domain($f$) = Range($f^{-1}$) | - |

## What's next

Composition and inverse functions are foundational for almost all remaining function topics in IB AI HL. Transformations of functions can be described as compositions of the original function with linear shifting and scaling functions. Exponential and logarithmic functions are inverses of each other, so understanding their inverse relationship is key to solving equations with these functions. In statistics, inverse functions are used to calculate critical values and inverse normal probabilities, which are a core exam topic.

- [Transformations of graphs](https://www.owlsprep.com/study/ib-math-ai-hl-u2-transformations-of-graphs/)
- [Quadratic functions: roots, vertices, inequalities](https://www.owlsprep.com/study/ib-math-ai-hl-u2-quadratic-functions-roots-vertices-inequalities/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ib-math-ai-hl-u2-composition-of-functions-and-inverse/
