# Composite Functions

> IB Mathematics Analysis and Approaches SL · Unit 2: Functions
> Source: https://www.owlsprep.com/study/ib-math-ai-sl-u2-composite-functions/

This module teaches you to work with composite functions, including evaluation, finding algebraic expressions, calculating valid domains, and decomposing functions. You will learn to avoid common exam mistakes with this frequently tested topic.

**Prerequisites:** [Basic function notation, domain and range](https://www.owlsprep.com/study/ib-math-ai-sl-u2-function-basics/)

## Learning objectives

- Define composite functions and interpret notation correctly
- Evaluate composite functions at given input values
- Find algebraic expressions for composite functions
- Determine the domain of a composite function
- Decompose complex functions into simpler composite functions

## What is a Composite Function?

**Composite Function** — A function formed by using the output of one function $g$ as the input to a second function $f$, so $(f \circ g)(x) = f(g(x))$.

*Notation:* $f \circ g$, read as "f after g"

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

A core property of composition is that **order matters**: $(f \circ g)(x)$ is almost never equal to $(g \circ f)(x)$.

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

1. First evaluate the innermost function $g$ at $x=2$:

   $$g(2) = (2)^2 - 1 = 4 - 1 = 3$$
2. Substitute this result into the outer function $f$:

   $$f(g(2)) = f(3) = 2(3) + 3 = 9$$

> **Exam tip:** Always work from the inside out: evaluate the function closest to $x$ first, then work outward to the outermost function.

## Finding Algebraic Expressions

To find the general algebraic form of $(f \circ g)(x)$, replace every occurrence of $x$ in the outer function $f$ with the full expression of the inner function $g(x)$, then simplify if required.

> **warning**
>
> The notation $f \circ g$ means $f(g(x))$, not $g(f(x))$. The function written closer to $x$ is always applied first.

**Worked example:** Given $f(x) = \sqrt{x + 4}$ and $g(x) = 3x - 2$, find $(f \circ g)(x)$ in simplest form

1. Replace $x$ in $f(x)$ with the full expression for $g(x)$:

   $$f(g(x)) = f(3x - 2) = \sqrt{(3x - 2) + 4}$$
2. Simplify the expression inside the square root:

   $$\sqrt{3x - 2 + 4} = \sqrt{3x + 2}$$

## Domain of a Composite Function

The domain of $(f \circ g)(x)$ follows a simple two-part rule:

1. All $x$ must be in the domain of the inner function $g(x)$
2. The output $g(x)$ must be in the domain of the outer function $f(x)$

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

1. Find the domain of the inner function $g(x)$: $g(x)$ is linear, so its domain is all real numbers:

   $$\text{dom}(g) = \mathbb{R}$$
2. Find the domain of the outer function $f(x)$: the input to the square root must be non-negative:

   $$x + 4 \geq 0 \implies \text{dom}(f) = [-4, \infty)$$
3. Require $g(x) \in \text{dom}(f)$ and solve for $x$:

   $$3x - 2 \geq -4 \implies 3x \geq -2 \implies x \geq -\frac{2}{3}$$

> **Exam tip:** Never just use the domain of the simplified composite expression: always check restrictions from the original inner function first.

## Decomposing Functions

Exam questions often ask you to reverse the composition process: write a given complex function as a composite of two simpler non-trivial functions. This is an important skill for later topics like the chain rule.

**Worked example:** Write $h(x) = (2x + 5)^3$ as $h(x) = (f \circ g)(x)$

1. Identify the inner function: the expression that is being substituted into a basic outer function. Here $2x + 5$ is the inner function:

   $$g(x) = 2x + 5$$
2. Identify the outer function that acts on the inner expression:

   $$f(x) = x^3$$
3. Check that the composition matches the original function:

   $$f(g(x)) = f(2x + 5) = (2x + 5)^3 = h(x)$$

> **note**
>
> There may be multiple valid decompositions, but exam questions always expect the simplest non-trivial decomposition. Trivial decompositions like $f(x)=x, g(x)=h(x)$ will not receive marks.

## Common pitfalls

- **Wrong:** Swapping order of composition, calculating $g(f(x))$ when asked for $f(g(x))$
  - Why it fails: Many students misread $f \circ g$ as "f first then g", instead of "f after g"
  - Correct: Remember: $f \circ g = f(g(x))$, the function closest to $x$ is always applied first
- **Wrong:** Taking the domain of the simplified composite expression instead of applying the two-step rule
  - Why it fails: Simplification can remove restrictions that originated from the inner function
  - Correct: Always check that $x$ is in the domain of $g$, and $g(x)$ is in the domain of $f$
- **Wrong:** Confusing composition with multiplication, calculating $f(a) \times g(a)$ for $f(g(a))$
  - Why it fails: Similar notation leads to this common error, especially in exam pressure
  - Correct: Recall $f(g(x))$ is function composition, not multiplication: substitute inner output into outer function
- **Wrong:** Giving a trivial decomposition $f(x)=x, g(x)=h(x)$ for a decomposition question
  - Why it fails: While technically correct, this does not answer what the question asks for
  - Correct: Decompose into two non-trivial simpler functions, with the inner function as the substituted expression and outer as the basic function acting on it

## Cheatsheet

| Concept | Notation | Key Rule |
| --- | --- | --- |
| Composite (f after g) | $f \circ g$ | $(f \circ g)(x) = f(g(x))$ |
| Evaluate at $x=a$ | $f(g(a))$ | Calculate $g(a)$ first, substitute into $f$ |
| Domain of $f \circ g$ | $\text{dom}(f \circ g)$ | $x \in \text{dom}(g)$, $g(x) \in \text{dom}(f)$ |
| Decompose $h(x)$ | $h = f \circ g$ | Inner = substituted expression, Outer = basic function |

## What's next

Composite functions are a foundational building block for almost all advanced function topics in IB AI SL. You will use composition to describe transformations of functions, and later apply it to differentiation (via the chain rule) and integration (via $u$-substitution). Errors in composition order or domain calculation are common sources of lost marks in these higher-weight topics, so mastering this sub-topic pays off across the whole syllabus. Practice the skills here to build a solid base for what comes next.

- [Inverse Functions](https://www.owlsprep.com/study/ib-math-ai-sl-u2-inverse-functions/)
- [Linear functions and their graphs](https://www.owlsprep.com/study/ib-math-ai-sl-u2-linear-functions-and-their-graphs/)
- [Quadratic functions, roots, and vertices](https://www.owlsprep.com/study/ib-math-ai-sl-u2-quadratic-functions-roots-and-vertices/)

---

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-sl-u2-composite-functions/
