Precalculus — Functions

Function Composition

Understand (f ∘ g)(x) = f(g(x)), compose functions step by step, find domains, decompose, and evaluate from tables — with fully worked examples.

What Is Function Composition?

(f ∘ g)(x) = f(g(x))

Read: "f composed with g of x" or "f of g of x"

When you compose two functions, you apply them in sequence. In (f ∘ g)(x), g is applied first — you plug x into g and get g(x). Then you feed that result into f — giving f(g(x)).

The ∘ symbol (a small circle) means composition. It is not multiplication. The notation (f ∘ g) defines a new function whose rule is "do g, then do f."

Input x

↓ apply g

g(x) [intermediate value]

↓ apply f

f(g(x)) [final output]

Key distinction: (f ∘ g)(x) and (g ∘ f)(x) are different operations. Order matters — composition is not commutative in general.

How to Compose Functions — 3 Steps

1

Substitute g(x) wherever x appears in f

Take the formula for f(x) and replace every x with the entire expression g(x). Use parentheses — this is where errors happen.

2

Simplify the result

Expand, combine like terms, and simplify the expression. Don't leave unsimplified products or nested powers.

3

State the domain

Find all x-values for which the composition is defined. x must be in the domain of g, and g(x) must be in the domain of f.

Worked Examples

Example 1: Linear and Quadratic — Showing Non-Commutativity

f(x) = 2x + 1,   g(x) = x²

Find (f ∘ g)(x):

(f ∘ g)(x) = f(g(x)) = f(x²)

= 2(x²) + 1

= 2x² + 1

Find (g ∘ f)(x):

(g ∘ f)(x) = g(f(x)) = g(2x + 1)

= (2x + 1)²

= 4x² + 4x + 1

= 4x² + 4x + 1

Conclusion: (f ∘ g)(x) ≠ (g ∘ f)(x)

2x² + 1 is not the same function as 4x² + 4x + 1. Composition is NOT commutative in general — order always matters.

Example 2: Square Root — Domain Restriction

f(x) = √x,   g(x) = x − 4

Find (f ∘ g)(x):

(f ∘ g)(x) = f(g(x)) = f(x − 4)

= √(x − 4)

= √(x − 4)

Domain:

g(x) = x − 4 has domain: all real numbers

f(x) = √x requires input ≥ 0, so g(x) ≥ 0:

x − 4 ≥ 0 → x ≥ 4

Domain of (f ∘ g): [4, ∞)

Example 3: Rational Function — Excluded Value

f(x) = 1/x,   g(x) = x + 2

Find (f ∘ g)(x):

(f ∘ g)(x) = f(g(x)) = f(x + 2)

= 1/(x + 2)

= 1/(x + 2)

Domain:

g(x) = x + 2: domain all reals

f(x) = 1/x: undefined when denominator = 0

g(x) = 0 when x + 2 = 0 → x = −2

Domain: all real x, x ≠ −2

Example 4: Trig and Quadratic

f(x) = x²,   g(x) = sin(x)

Find (f ∘ g)(x):

(f ∘ g)(x) = f(g(x)) = f(sin x)

= (sin x)²

= sin²(x)

Find (g ∘ f)(x):

(g ∘ f)(x) = g(f(x)) = g(x²)

= sin(x²)

= sin(x²)

sin²(x) ≠ sin(x²)

sin²(x) = (sin x)² — square the output of sine.  |  sin(x²) — square the input first, then take sine. These are fundamentally different functions.

Domain of Composite Functions

The Full Rule

The domain of (f ∘ g)(x) is the set of all x such that:

  1. x is in the domain of g, AND
  2. g(x) is in the domain of f

Both conditions must hold simultaneously. Even if x is a perfectly fine input for g, if g(x) cannot be fed into f, that x is excluded.

3-Step Domain Process — Fully Worked

Find the domain of (f ∘ g)(x) where f(x) = √x and g(x) = x − 4.

1

Find the domain of g

g(x) = x − 4 is a polynomial → domain is all real numbers: (−∞, ∞)

2

Find the domain of f

f(x) = √x requires x ≥ 0 → domain of f is [0, ∞)

3

Require g(x) to be in the domain of f

Need g(x) ≥ 0:

x − 4 ≥ 0

x ≥ 4

Domain of (f ∘ g): [4, ∞)

Decomposing a Function

Decomposition is the reverse: given a composite function h(x), find f and g so that h = f ∘ g. This is an important skill for calculus (chain rule).

Example: h(x) = (2x + 3)⁵

Find f and g such that h(x) = (f ∘ g)(x).

Strategy: identify the "inner" and "outer" operations.

Most common decomposition:

g(x) = 2x + 3     (inner — the expression inside the power)

f(x) = x⁵         (outer — raise to the 5th power)

Check: f(g(x)) = f(2x + 3) = (2x + 3)⁵ = h(x) ✓

Alternative valid decomposition:

g(x) = 2x + 3

f(x) = x⁵         ← same as above (most natural)

Note: there are infinitely many valid decompositions (e.g., g(x) = 2x, f(x) = (x+3)⁵), but exams typically expect the most natural split where the outer function operates on the full inner expression.

Evaluating Composite Functions from a Table

When functions are defined by tables rather than formulas, use the table values directly — no formula needed.

xf(x)g(x)
142
215
361
436
523
654

Find (f ∘ g)(2) = f(g(2)):

Step 1: g(2) = 5   (from table, row x = 2)

Step 2: f(5) = 2   (from table, row x = 5)

(f ∘ g)(2) = 2

Find (g ∘ f)(3) = g(f(3)):

Step 1: f(3) = 6   (from table, row x = 3)

Step 2: g(6) = 4   (from table, row x = 6)

(g ∘ f)(3) = 4

Find (f ∘ f)(1) = f(f(1)):

Step 1: f(1) = 4   (from table, row x = 1)

Step 2: f(4) = 3   (from table, row x = 4)

(f ∘ f)(1) = 3

Chain of Three Functions

Composition extends naturally to three or more functions. Apply from right to left:

(f ∘ g ∘ h)(x) = f(g(h(x)))

Apply h first, then g, then f

Example: f(x) = x + 1,   g(x) = 2x,   h(x) = x²

Find (f ∘ g ∘ h)(x).

Step 1: h(x) = x²

Step 2: g(h(x)) = g(x²) = 2x²

Step 3: f(g(h(x))) = f(2x²) = 2x² + 1

(f ∘ g ∘ h)(x) = 2x² + 1

Verify with a specific value: let x = 3.

h(3) = 9 → g(9) = 18 → f(18) = 19

Formula: 2(3)² + 1 = 18 + 1 = 19 ✓

Exam Tips

Order: Right to Left

In (f ∘ g)(x), g goes first. The symbol closest to x is applied first. Writing it out as f(g(x)) makes the order obvious. When in doubt, expand the notation.

Parentheses Save Points

When substituting g(x) into f, always wrap g(x) in parentheses. f(x) = 2x + 1 and g(x) = x − 3: f(g(x)) = 2(x − 3) + 1, NOT 2x − 3 + 1. Skipping parentheses is the #1 arithmetic error.

Domain Check: Two Conditions

The domain of f ∘ g requires BOTH that x is in domain(g) AND g(x) is in domain(f). On free-response questions, show both conditions — examiners look for the two-step justification.

Frequently Asked Questions

What does (f ∘ g)(x) mean?

(f ∘ g)(x) means f(g(x)) — you apply g first, then apply f to that result. Read it as 'f composed with g of x' or 'f of g of x'. The right-hand function is always applied first.

Is function composition commutative? Does (f ∘ g)(x) = (g ∘ f)(x)?

No. Function composition is generally NOT commutative. In most cases (f ∘ g)(x) ≠ (g ∘ f)(x). For example, with f(x) = 2x + 1 and g(x) = x², (f ∘ g)(x) = 2x² + 1 but (g ∘ f)(x) = (2x+1)² = 4x² + 4x + 1. These are different functions.

How do you find the domain of a composite function?

The domain of (f ∘ g)(x) = f(g(x)) requires two conditions: (1) x must be in the domain of g, and (2) g(x) must be in the domain of f. Start with the domain of g, then exclude any x-values where g(x) falls outside the domain of f. Example: for f(x) = √x and g(x) = x − 4, the domain of g is all reals, but f requires g(x) ≥ 0, so x − 4 ≥ 0, giving domain x ≥ 4.

Related Topics

Practice Function Composition

Interactive problems with step-by-step solutions and private tutoring — work through composition, domains, and decomposition with instant feedback.

Start Practicing Free