# Composite and inverse functions

> IB Mathematics: Analysis and Approaches HL · Unit 2: Functions
> Source: https://www.owlsprep.com/study/ib-math-aa-hl-u2-composite-and-inverse-functions/

This subtopic covers combining functions via composition, finding inverse functions, and understanding the algebraic and graphical relationship between a function and its inverse. These concepts are foundational for calculus and advanced function work.

**Prerequisites:** [Domain, range and basic function notation](https://www.owlsprep.com/study/ib-math-aa-hl-u2-basic-functions-and-notation/); [One-to-one and many-to-one functions](https://www.owlsprep.com/study/ib-math-aa-hl-u2-types-of-functions/)

## Learning objectives

- Calculate composite functions and identify their domains/ranges
- Find inverse functions algebraically for one-to-one functions
- Verify if two functions are inverses of each other
- Describe the graphical relationship between a function and its inverse
- Identify common notation and domain traps in exam questions

## Composite Functions

**Composite Function** — A function where the output of the inner function $g(x)$ is used as the input to the outer function $f(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$

**Worked example:** Given $f(x) = 2x + 3$ and $g(x) = e^{x-1}$, find $(f \circ g)(x)$ and $(g \circ f)(x)$

1. For $(f \circ g)(x)$, substitute $g(x)$ into $f(x)$ as the input:
2. $$f(g(x)) = 2\left(g(x)\right) + 3 = 2e^{x-1} + 3$$
3. For $(g \circ f)(x)$, substitute $f(x)$ into $g(x)$ as the input:
4. $$g(f(x)) = e^{f(x) - 1} = e^{(2x + 3) - 1} = e^{2x + 2}$$

> **tip**
>
> $f \circ g$ is almost never equal to $g \circ f$. Always check the order of composition before answering exam questions.

## Domain and Range of Composite Functions

To find the domain of a composite function $f(g(x))$, you must apply two layers of restrictions: first $x$ must be valid for the inner function $g$, and second the output of $g$ must be valid for the outer function $f$.

1. Find the full domain of the inner function $g(x)$
2. Add additional restrictions to ensure all outputs of $g(x)$ are in the domain of $f(x)$
3. The domain of $f(g(x))$ is the intersection of these two sets of $x$-values

**Worked example:** Find the domain of $(f \circ g)(x)$ where $f(x) = \frac{1}{x}$ and $g(x) = \sqrt{x+2}$

1. First find the domain of the inner function $g(x) = \sqrt{x+2}$:
2. $$x + 2 \geq 0 \implies x \geq -2, \quad D(g) = [-2, \infty)$$
3. Next find restrictions from $f(x) = \frac{1}{x}$, which is undefined at $x=0$, so $g(x) \neq 0$:
4. $$\sqrt{x+2} \neq 0 \implies x+2 \neq 0 \implies x \neq -2$$
5. Combine the two restrictions to get the final domain:
6. $$D(f \circ g) = (-2, \infty)$$

## Finding Inverse Functions Algebraically

**Inverse Function** — A function that reverses the mapping of an original one-to-one function, satisfying $f^{-1}(f(x)) = x$ and $f(f^{-1}(x)) = x$ for all valid $x$. Only exists if the original function is one-to-one.

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

1. Start with $y = f(x)$
2. Swap the variables $x$ and $y$
3. Rearrange the equation to solve for $y$ in terms of $x$
4. The resulting $y$ is $f^{-1}(x)$, state its domain (equal to the range of original $f$)

**Worked example:** Find the inverse of $f(x) = 3x + 4$, $x \in \mathbb{R}$

1. Write the original function:
2. $$y = 3x + 4$$
3. Swap $x$ and $y$:
4. $$x = 3y + 4$$
5. Rearrange to solve for $y$:
6. $$x - 4 = 3y \implies y = \frac{x - 4}{3}$$
7. Write as the inverse function:
8. $$f^{-1}(x) = \frac{x - 4}{3}, \quad x \in \mathbb{R}$$

**Check your understanding**

Test your understanding of inverse notation:

1. Which of the following is the inverse of $f(x) = \frac{1}{x+3}$, $x \neq -3$?

   - $\frac{1}{x} - 3$
   - $\frac{1}{x} + 3$
   - $x - 3$
   - $\frac{1}{1-3x}$

   *Answer:* $\frac{1}{x} - 3$

   *Why:* Follow the steps: $y = 1/(x+3) \to x = 1/(y+3) \to y+3 = 1/x \to y = 1/x - 3$

## Graphical Properties of Inverses

Because we swap $x$ and $y$ when finding an inverse, every point $(a,b)$ on the original function $f$ becomes the point $(b,a)$ on the inverse function $f^{-1}$. This corresponds to a reflection of the entire graph of $f$ over the line $y=x$.

> **mnemonic**
>
> Swap x and y, reflect over y = x

**Worked example:** Sketch the graph of $f(x) = e^x$ and its inverse, using reflection rules

1. Original $f(x) = e^x$ has a y-intercept at $(0,1)$, horizontal asymptote at $y=0$, and is increasing for all $x \in \mathbb{R}$
2. Reflect all points over the line $y=x$, so the intercept $(0,1)$ becomes $(1,0)$, and the horizontal asymptote $y=0$ becomes the vertical asymptote $x=0$
3. The reflected graph is the natural logarithm function, which matches the known inverse relationship:
4. $$f^{-1}(x) = \ln x, \quad x > 0$$

## Common pitfalls

- **Wrong:** Calculating $g(f(x))$ instead of $f(g(x))$ for $f \circ g$
  - Why it fails: Notation is read right-to-left for application: the inner function closest to $x$ is applied first
  - Correct: Remember $f \circ g(x) = f(g(x))$, so $g$ is applied first, then $f$
- **Wrong:** Confusing $f^{-1}(x)$ with $\frac{1}{f(x)}$
  - Why it fails: The negative exponent notation for inverse functions is a special convention, not a reciprocal
  - Correct: Always remember $f^{-1}(x)$ means inverse function, not reciprocal: $(f(x))^{-1} = \frac{1}{f(x)} \neq f^{-1}(x)$
- **Wrong:** Finding an inverse for a non-one-to-one function without domain restriction
  - Why it fails: A non-one-to-one function's reflection will not pass the vertical line test, so it is not a valid function
  - Correct: Always check if $f$ is one-to-one first, and restrict its domain to make it one-to-one if required
- **Wrong:** Only taking the domain of the outer function when finding the domain of a composite
  - Why it fails: The input $x$ must first be valid for the inner function, so all restrictions on the inner function apply
  - Correct: Start by finding the domain of the inner function, then add restrictions from the outer function
- **Wrong:** Reflecting over the x-axis instead of $y=x$ for inverse graphs
  - Why it fails: Reflection over x-axis gives $-f(x)$, not the inverse, from misremembering the rule
  - Correct: Always reflect over the diagonal line $y=x$ to get the graph of $f^{-1}(x)$

## Cheatsheet

| Concept | Key Rule | Notation |
| --- | --- | --- |
| Composite $f \circ g$ | Apply $g$ first, then $f$ | $(f \circ g)(x) = f(g(x))$ |
| Domain of $f(g(x))$ | Domain of $g$ + output of $g$ in domain of $f$ | $D(f \circ g) = D(g) \cap \{x: g(x) \in D(f)\}$ |
| Inverse existence | Only exists for one-to-one functions | $f^{-1}(x)$ |
| Find inverse algebraically | 1. $y=f(x)$ 2. swap $x,y$ 3. solve for $y$ | Domain of $f^{-1}$ = range of $f$ |
| Graph of $f^{-1}$ | Reflection of $f$ over $y=x$ | $(a,b) \to (b,a)$ |

## What's next

Composite and inverse functions are foundational to almost all advanced topics in IB AA HL. Composition is the core of the chain rule for differentiation, one of the most heavily tested calculus concepts in the exam. Inverse functions are critical for understanding logarithms (the inverse of exponentials) and for integration, where you will often need to invert functions to solve for antiderivatives. Mastering the domain rules here will prevent simple errors on much higher-mark questions later in the course.

- [Domain and Range of Functions](https://www.owlsprep.com/study/ib-math-aa-hl-u2-domain-and-range/)
- [Transformations of functions](https://www.owlsprep.com/study/ib-math-aa-hl-u2-transformations-of-functions/)
- [Linear and quadratic functions](https://www.owlsprep.com/study/ib-math-aa-hl-u2-linear-and-quadratic-functions/)

---

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-aa-hl-u2-composite-and-inverse-functions/
