Composition of Functions

Meaning of composition of functions, how one function is applied after another, with clear steps and examples.

1. What Composition of Functions Means

The composition of functions is a way of joining two functions so that the output of one becomes the input of the other. It is like running a value through two machines in a row: first through one function, then through the next.

This creates a new function that captures both steps together.

2. Formal Definition

If we have two functions:

f : A \to B

g : B \to C

then the composition of g after f is written as:

2.1. Definition

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

First apply f to x, then apply g to the result.

3. How to Read the Notation

The symbol \( g \circ f \) means “g after f”. Even though g appears first, the input goes into f first.

So:

  • Start with x
  • Compute f(x)
  • Take that result and compute g(f(x))

4. Example: Simple Numerical Composition

Let:

f(x) = 2x

g(x) = x + 3

4.1. Compute g ∘ f

(g \circ f)(x) = g(f(x)) = g(2x) = 2x + 3

4.2. Compute f ∘ g

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

Note that the results are different.

5. Composition Using Ordered Pairs

Composition can also be done using sets of ordered pairs.

5.1. Example

Let:

f = \{(1,4),(2,5),(3,6)\}

g = \{(4,7),(5,8),(6,9)\}

To build g ∘ f, follow the outputs of f into g:

  • 1 → 4 → 7
  • 2 → 5 → 8
  • 3 → 6 → 9

So:

g \circ f = \{(1,7),(2,8),(3,9)\}

6. When Composition Is Possible

For g ∘ f to be defined, the output set of f must sit inside the input set of g. This ensures that every f(x) can be given to g.

6.1. Condition

f : A \to B, \quad g : B \to C

The codomain of f must match the domain of g.

7. Is Composition Commutative?

No. In general:

g \circ f \ne f \circ g

Functions usually behave differently based on the order of steps.

8. Why Composition Matters

Composition lets you combine operations, build complicated transformations from simple ones, and understand how functions interact. It also plays a key role in studying inverse functions, symmetries, and many deeper ideas in algebra.