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))(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)=x2f(x) = x^2, g(x)=x+1g(x) = x + 1.
(f∘g)(x)=f(g(x))=(x+1)2=x2+2x+1(f \circ g)(x) = f(g(x)) = (x + 1)^2 = x^2 + 2x + 1.

Notation

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

What This Formula Means

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

Chain two machines togetherβ€”output of the first goes into the second.

Formal View

(f∘g) ⁣:Xβ†’Z(f \circ g)\colon X \to Z defined by (f∘g)(x)=f(g(x))β€…β€Šβˆ€x∈X(f \circ g)(x) = f(g(x))\;\forall x \in X, where g ⁣:Xβ†’Yg\colon X \to Y and f ⁣:Yβ†’Zf\colon Y \to Z

Worked Examples

Example 1

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

Answer

1919

First step

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

Full solution

  1. 2
    Compute g(3)=32=9g(3) = 3^2 = 9.
  2. 3
    Substitute that result into ff: f(9)=2(9)+1=19f(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+3f(x) = x + 3 and g(x)=2x2βˆ’1g(x) = 2x^2 - 1, find the formula for (g∘f)(x)(g \circ f)(x).

Example 3

easy
Given f(x)=x2f(x)=x^2 and g(x)=xβˆ’3g(x)=x-3, compute both (f∘g)(5)(f\circ g)(5) and (g∘f)(5)(g\circ f)(5) and notice the order matters.

Common Mistakes

  • Applying ff before gg in (f∘g)(x)(f\circ g)(x) - the inner function gg always goes first.
  • Multiplying outputs instead of substituting - composition plugs g(x)g(x) in for the variable in ff, it does not multiply.
  • Assuming f∘gf\circ g equals g∘fg\circ 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∘ff^{-1}\circ f returns xx). 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))(f \circ g)(x) = f(g(x)), meaning evaluate gg first, then apply ff 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)(f \circ g)(x) denotes ff composed with gg: apply gg first, then ff 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∘ff^{-1}\circ f returns xx). 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 ff before gg in (f∘g)(x)(f\circ 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 β†’