Function Composition Formula

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

The Formula

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

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

Quick Example

f(x)=x2, g(x)=x+1.
(f∘g)(x)=f(g(x))=(x+1)2=x2+2x+1.

Notation

(f∘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∘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∘g) ⁣:X→Z defined by (f∘g)(x)=f(g(x))  ∀x∈X, where g ⁣:X→Y and f ⁣:Y→Z

Worked Examples

Example 1

easy
Given f(x)=2x+1 and g(x)=x2, find (f∘g)(3).

Answer

19

First step

1
(f∘g)(3) means f(g(3)), so evaluate the inner function first.

Full solution

  1. 2
    Compute g(3)=32=9.
  2. 3
    Substitute that result into f: f(9)=2(9)+1=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)=2x2−1, find the formula for (g∘f)(x).

Example 3

easy
Given f(x)=x2 and g(x)=x−3, compute both (f∘g)(5) and (g∘f)(5) and notice the order matters.

Common Mistakes

  • Applying f before g in (f∘g)(x) - the inner function g always goes first.
  • Multiplying outputs instead of substituting - composition plugs g(x) in for the variable in f, it does not multiply.
  • Assuming f∘g equals g∘f - order changes the result for most functions.

Why This Formula Matters

Composition is how real multi-step processes and the chain rule of calculus are built; it is also the machinery behind inverses (f−1∘f returns x). Doing it in the wrong order computes a different function entirely. Recognizing it by "Is the output of one function being used as the input of another, in a fixed order?" — rather than by familiar numbers — is what lets a student tell it apart from multiplication of functions and reversed composition and inverse function in a mixed problem set.

Frequently Asked Questions

What is the Function Composition formula?

Function composition applies one function to the output of another: (f∘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∘g)(x) denotes f composed with g: apply g first, then f to the result.

Why is the Function Composition formula important in Math?

Composition is how real multi-step processes and the chain rule of calculus are built; it is also the machinery behind inverses (f−1∘f returns x). Doing it in the wrong order computes a different function entirely. Recognizing it by "Is the output of one function being used as the input of another, in a fixed order?" — rather than by familiar numbers — is what lets a student tell it apart from multiplication of functions and reversed composition and inverse function in a mixed problem set.

What do students get wrong about Function Composition?

The procedure for function composition is the easy part; the trap is applying f before g in (f∘g)(x). Asking "Is the output of one function being used as the input of another, in a fixed order?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

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 →