01 / 21

Composition of
Functions

Learn how to combine two functions into one by feeding the output of one into the input of another, and master the domain of composition.

College Algebra

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 \), you can create a new function \( (f \circ g)(x) \) that first evaluates \( g(x) \), then feeds that output into \( f \).

The Input-Output Pipeline

\(x\)
\(g(x)\)
inner function output
\(f(\cdot)\)
outer function
\(f(g(x))\)

Think of it as a two-stage machine: the input \( x \) enters \( g \) first, and whatever comes out feeds directly into \( f \).

Why Does Composition Matter?

Modeling
Complex real-world processes are often built by chaining simpler functions together.
Calculus
The Chain Rule for derivatives is entirely based on composition of functions.
Inverses
Verifying that two functions are inverses requires showing \( (f \circ g)(x) = x \) and \( (g \circ f)(x) = x \).

The Formal Definition

The order matters. The function closest to \( x \) in the notation is evaluated first. In \( f \circ g \), the function \( g \) acts first, then \( f \) acts on the result.

Domain of \( f \circ g \)

\(\text{dom}(g)\)
\(x\)
\(g\)
\(\text{dom}(f)\)
\(g(x)\)
\(f\)

Two conditions must hold simultaneously: \( x \) must be valid input for \( g \), and \( g(x) \) must be valid input for \( f \).

\( f \circ g \) vs \( g \circ f \)

Let \( f(x) = x^2 \) and \( g(x) = x + 3 \). Compare:

\( f \circ g \) \( g \circ f \)
Formula \( f(g(x)) = (x+3)^2 \) \( g(f(x)) = x^2 + 3 \)
At \( x = 1 \) \( (1+3)^2 = 16 \) \( 1^2 + 3 = 4 \)
At \( x = -2 \) \( (-2+3)^2 = 1 \) \( (-2)^2 + 3 = 7 \)

How to Evaluate a Composition

1
Identify inner and outer. In \( (f \circ g)(x) \), the inner function is \( g \) and the outer is \( f \).
2
Substitute \( g(x) \) into \( f \). Replace every \( x \) in the formula for \( f \) with the entire expression \( g(x) \).
3
Simplify. Expand, combine like terms, and write the result as a single expression.
4
Find the domain. Start with the domain of \( g \), then exclude any \( x \) where \( g(x) \) falls outside the domain of \( f \).

Finding the Domain Step by Step

1
Write the domain of \( g \). Determine where \( g(x) \) is defined on its own.
2
Write the domain of \( f \). What inputs does \( f \) accept?
3
Set \( g(x) \in \text{dom}(f) \). Solve the inequality or equation that keeps \( g(x) \) inside the domain of \( f \).
4
Intersect. The domain of \( f \circ g \) is the set of \( x \) satisfying both conditions from steps 1 and 3.

Example 1: Polynomial Composition

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

Example 2: Square Root Composition

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

Example 3: Rational Inside Radical

Let \( f(x) = \sqrt{x} \) and \( g(x) = \dfrac{1}{x - 4} \). Find the domain of \( (f \circ g)(x) \).

Visualizing Composition on a Graph

x y 1 2 3 4 5 2 4 6 8 10
\(g(x)=x+1\)
\(f(x)=x^2\)
\((f \circ g)(x)=(x+1)^2\)

The composition curve is built by reading the output of \( g \) and feeding it into \( f \) at each \( x \)-value.

Domain Restrictions in Action

Consider \( f(x) = \dfrac{1}{x} \) and \( g(x) = x - 5 \). Find the domain of \( (f \circ g)(x) = \dfrac{1}{x-5} \).

0 5 10
\(x \neq 5\)

Common Mistakes to Avoid

✕ Wrong Order
Confusing \( f \circ g \) with \( g \circ f \). Always evaluate the inner function first.
✕ Multiplying Instead
Writing \( f \cdot g \) when asked for \( f \circ g \). Composition is substitution, not multiplication.
✕ Ignoring Domain
Only checking \( g \)'s domain and forgetting that \( g(x) \) must also lie in \( f \)'s domain.

Summary Table

Concept Details
Notation \( (f \circ g)(x) = f(g(x)) \)
Evaluation Order Inner function \( g \) first, then outer \( f \)
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) \)
Key Tip Find the domain using the original functions, not the simplified final expression

Question 1 of 5

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

Question 2 of 5

If \( f(x) = \sqrt{x} \) and \( g(x) = 2x - 10 \), what is the domain of \( f \circ g \)?

Question 3 of 5

Which expression equals \( (g \circ f)(x) \) when \( f(x) = x - 4 \) and \( g(x) = x^2 + 2x \)?

Question 4 of 5

Let \( f(x) = \dfrac{1}{x+2} \) and \( g(x) = \dfrac{1}{x} \). What is the domain of \( f \circ g \)?

Question 5 of 5

True or false: Function composition is commutative, meaning \( f \circ g = g \circ f \) for all functions \( f \) and \( g \).