01 / 21

Composition of
Functions

Learn how to combine two functions into one by feeding the output of one function as the input of another: the powerful idea behind \( (f \circ g)(x) \).

AP Precalculus

What Is Function Composition?

Function composition is the process of applying one function to the result of another. If you have two functions \( f \) and \( g \), the composition \( (f \circ g)(x) \) means: first evaluate \( g(x) \), then plug that result into \( f \).

Think of it like a pipeline: the input \( x \) flows through \( g \) first, and its output flows into \( f \). The final output is the composition.

The Function Machine Model

x g g(x) f f(g(x))
\( (f \circ g)(x) \)

Why Does Composition Matter?

Simplify Complex Models
Real-world scenarios chain processes: cost depends on quantity, which depends on time. Composition captures this chain in one formula.
Foundation for Calculus
The Chain Rule in calculus is built directly on composition. Mastering composition now is essential for AP Calculus.
Inverse Functions
Verifying that two functions are inverses requires showing \( (f \circ g)(x) = x \) and \( (g \circ f)(x) = x \).

The Formal Definition

1
Start with the inner function \( g \). Evaluate \( g(x) \) first.
2
Feed the result into \( f \). Replace every \( x \) in \( f(x) \) with \( g(x) \).
3
Simplify. Combine like terms, expand, and reduce where possible.

Domain of \( f \circ g \)

Domain of g Domain of f Range of f g f x g(x) f(g(x)) g(x) must be in the domain of f

Composition vs Multiplication

Composition \( (f \circ g)(x) \) Multiplication \( (f \cdot g)(x) \)
Meaning \( f\!\bigl(g(x)\bigr) \) \( f(x) \cdot g(x) \)
Operation Substitute \( g(x) \) into \( f \) Multiply the two outputs
Commutative? No: \( f \circ g \neq g \circ f \) in general Yes: \( f \cdot g = g \cdot f \)
Example \( f(x)=x^2,\; g(x)=x+1 \): result is \( (x+1)^2 \) Result is \( x^2(x+1) \)

Order Matters

Composition is not commutative. Let's see why with \( f(x) = x^2 \) and \( g(x) = x + 3 \):

\( (f \circ g)(x) \)
\( f(g(x)) = f(x+3) = (x+3)^2 \)
= \( x^2 + 6x + 9 \)
\( (g \circ f)(x) \)
\( g(f(x)) = g(x^2) = x^2 + 3 \)

How to Evaluate a Composition

1
Identify inner and outer. In \( (f \circ g)(x) \), the inner function is \( g \) and the outer function is \( f \).
2
Write the outer function's rule. Write \( f(\,\square\,) \), leaving a blank for the input.
3
Replace \( \square \) with \( g(x) \). Substitute the entire expression for \( g(x) \) wherever \( x \) appears in \( f \).
4
Simplify. Expand, combine like terms, and factor if needed.
5
Check the domain. Ensure the input is valid for both \( g \) and \( f \).

Example 1: Linear + Quadratic

Let \( f(x) = 2x + 1 \) and \( g(x) = x^2 - 4 \). Find \( (f \circ g)(x) \).

1
Inner function: \( g(x) = x^2 - 4 \)
2
Substitute into \( f \): \( f\!\bigl(g(x)\bigr) = 2\bigl(x^2 - 4\bigr) + 1 \)
3
Simplify: \( = 2x^2 - 8 + 1 = 2x^2 - 7 \)

Example 2: Evaluating at a Point

Using \( f(x) = 3x - 5 \) and \( g(x) = x^2 + 2 \), evaluate \( (f \circ g)(3) \).

1
Evaluate the inner function: \( g(3) = 3^2 + 2 = 9 + 2 = \) \( 11 \)
2
Feed into the outer function: \( f(11) = 3(11) - 5 = 33 - 5 = \) \( 28 \)

Example 3: Domain Restriction

Let \( f(x) = \sqrt{x} \) and \( g(x) = 5 - x \). Find \( (f \circ g)(x) \) and its domain.

1
Compose: \( f\!\bigl(g(x)\bigr) = \sqrt{5 - x} \)
2
Domain of \( g \): all real numbers (linear function).
3
Constraint from \( f \): need \( g(x) \geq 0 \), so \( 5 - x \geq 0 \), giving \( x \leq 5 \).

Example 4: Composition from a Table

\( x \) \( f(x) \) \( g(x) \)
132
254
311
423

Find \( (f \circ g)(2) \): Step 1: \( g(2) = 4 \). Step 2: \( f(4) = 2 \). So \( (f \circ g)(2) = \) 2.

Decomposing a Composite Function

Sometimes you need to work backwards: given a complex function \( h(x) \), find simpler \( f \) and \( g \) so that \( h = f \circ g \). This is called decomposition.

Example
\( h(x) = (3x + 1)^5 \)
Inner \( g(x) \)
\( g(x) = 3x + 1 \)
(the "inside" expression)
Outer \( f(u) \)
\( f(u) = u^5 \)
(the operation applied to it)

Common Mistakes to Avoid

✕ Wrong Order
Writing \( (f \circ g)(x) \) as \( g(f(x)) \) instead of \( f(g(x)) \). Remember: the function closest to \( x \) is applied first.
✕ Multiplying Instead
Confusing \( (f \circ g)(x) = f(g(x)) \) with \( f(x) \cdot g(x) \). The \( \circ \) symbol means compose, not multiply.
✕ Forgetting Domain
Ignoring that \( g(x) \) must land in the domain of \( f \). Always check domain restrictions after composing.

Summary of Key Ideas

Concept Details
Notation \( (f \circ g)(x) = f(g(x)) \)
Read as "\( f \) of \( g \) of \( x \)"
Inner function \( g \): evaluated first
Outer function \( f \): applied to \( g(x) \)
Commutative? No: \( f \circ g \neq g \circ f \) in general
Domain rule \( x \in \text{dom}(g) \) and \( g(x) \in \text{dom}(f) \)
Decomposition Break \( h(x) \) into outer \( f \) and inner \( g \)

Question 1 of 5

If \( f(x) = 2x + 3 \) and \( g(x) = x^2 \), what is \( (f \circ g)(4) \)?

Question 2 of 5

If \( f(x) = x - 1 \) and \( g(x) = 3x + 2 \), what is \( (f \circ g)(x) \)?

Question 3 of 5

What is the domain of \( (f \circ g)(x) \) if \( f(x) = \sqrt{x} \) and \( g(x) = x - 7 \)?

Question 4 of 5

If \( h(x) = (2x - 5)^3 \), which decomposition gives \( h = f \circ g \)?

Question 5 of 5

Given the table below, what is \( (g \circ f)(2) \)?

\( x \) \( f(x) \) \( g(x) \)
143
215
321
452
534