Function Composition Formula

The Formula

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

When to use: Chain two machines together—output of the first goes into the second.

Quick Example

f(x) = x^2, g(x) = x + 1.
(f \circ g)(x) = f(g(x)) = (x + 1)^2 = x^2 + 2x + 1.

Notation

(f \circ g)(x) denotes f composed with g: apply g first, then f to the result.

What This Formula Means

Function composition applies one function to the output of another: (f \circ g)(x) = f(g(x)), meaning evaluate g first, then apply f to the result.

Chain two machines together—output of the first goes into the second.

Formal View

(f \circ g)\colon X \to Z defined by (f \circ g)(x) = f(g(x))\;\forall x \in X, where g\colon X \to Y and f\colon Y \to Z

Worked Examples

Example 1

easy
Given f(x) = 2x + 1 and g(x) = x^2, find (f \circ g)(3).

Solution

  1. 1
    (f \circ g)(3) means f(g(3)), so evaluate the inner function first.
  2. 2
    Compute g(3) = 3^2 = 9.
  3. 3
    Substitute that result into f: f(9) = 2(9) + 1 = 19.

Answer

19
Function composition works from the inside out: evaluate the inner function first, then feed its output into the outer function.

Example 2

medium
Given f(x) = x + 3 and g(x) = 2x^2 - 1, find the formula for (g \circ f)(x).

Common Mistakes

  • Evaluating f(g(x)) by applying f first — in f \circ g, apply g first and then f to the result
  • Assuming f(g(x)) = g(f(x)) — composition is NOT commutative; order matters
  • Multiplying f(x) \cdot g(x) instead of composing — f(g(x)) means substitute g(x) into f, not multiply

Why This Formula Matters

Complex functions are often built from simpler ones composed together.

Frequently Asked Questions

What is the Function Composition formula?

Function composition applies one function to the output of another: (f \circ g)(x) = f(g(x)), meaning evaluate g first, then apply f to the result.

How do you use the Function Composition formula?

Chain two machines together—output of the first goes into the second.

What do the symbols mean in the Function Composition formula?

(f \circ g)(x) denotes f composed with g: apply g first, then f to the result.

Why is the Function Composition formula important in Math?

Complex functions are often built from simpler ones composed together.

What do students get wrong about Function Composition?

f(g(x)) \neq g(f(x)) in general. Composition is not commutative.

What should I learn before the Function Composition formula?

Before studying the Function Composition formula, you should understand: function definition.

Want the Full Guide?

This formula is covered in depth in our complete guide:

Functions and Graphs: Complete Foundations for Algebra and Calculus →