Function Composition

TipLearning Objectives

By the end of this lesson, you’ll be able to:

  • Compute function compositions such as \(f(g(x))\) and \(g(f(x))\).
  • Substitute entire expressions—not just numbers—into other functions.
  • Interpret compositions in algebraic and real-world contexts.

Key Ideas

Function composition means feeding the output of one function directly into another.

The notation: \[ (f \circ g)(x) = f(g(x)) \]

This means:
1. Evaluate \(g\) first,
2. Then plug that entire result into \(f\).

➡️ Order matters\(f(g(x))\) is generally different from \(g(f(x))\).

Common Problem Types

1. Algebraic Substitution

Replace the input of one function with the full expression of another.

2. Composition With Linear or Quadratic Functions

Often produces quadratics or higher-degree expressions.

3. Multiple Compositions

Examples like \(h(h(x))\) or \(f(g(f(x)))\).

4. Word Problems

A composition may represent a process applied in sequence.

Strategies

  • Rewrite the inner function in parentheses before substituting.
  • Replace every \(x\) in the outer function with the inner expression.
  • Keep parentheses to prevent distribution or sign errors.
  • Read carefully: determine which function acts first.
  • For context problems, think: “What happens first? What happens next?”

Worked Examples

Example 1 — Compute \(f(g(x))\)

Given: \[ f(x) = 2x + 1, \qquad g(x) = x^2 \]

Compute: \[ f(g(x)) = f(x^2) = 2x^2 + 1 \]


Example 2 — Compute \(g(f(x))\)

Using the same functions: \[ g(f(x)) = g(2x + 1) = (2x + 1)^2 \] Expand if desired: \[ 4x^2 + 4x + 1 \]


WarningCommon Mistakes
  • Plugging in \(x\) instead of the full expression (loses structure).
  • Reversing the order: \(f(g(x)) \ne g(f(x))\) in most cases.
  • Forgetting parentheses when substituting expressions.

Practice Problems

  1. \(f(x) = x + 2\), \(g(x) = 3x\). Find \(f(g(x))\).
  2. Find \(g(f(x))\) for the same functions.
  3. \(f(x) = x^2\), \(g(x) = x - 1\). Compute \(f(g(x))\).
  4. Compute \(g(f(x))\).
  5. If \(h(x) = 2x\), find \(h(h(x))\).

1.
\(f(g(x)) = f(3x) = 3x + 2\)


2.
\(g(f(x)) = g(x + 2) = 3(x + 2) = 3x + 6\)


3.
\(f(g(x)) = f(x - 1) = (x - 1)^2\)


4.
\(g(f(x)) = g(x^2) = x^2 - 1\)


5.
\(h(h(x)) = h(2x) = 2(2x) = 4x\)

Summary

  • Composition means applying one function inside another: \(f(g(x)) = f(\text{output of } g)\).
  • Order matters: \(f(g(x))\) usually differs from \(g(f(x))\).
  • Always substitute the entire inner expression into the outer function.
  • Parentheses help prevent common sign and distribution errors.
  • Compositions show up often in multi-step processes and applied problems.
  • Treat \(g(x)\) as a single “blob” and drop it into \(f(x)\).
  • Rewrite the outer function with parentheses: \(f(\,\_\_)\) and fill in the blank.
  • Check your order: inner function first, outer function second.
  • Look for simplification opportunities after substituting.