Composition of Functions

Composing two functions means feeding the output of one as the input of the other. This operation, denoted , is fundamental to calculus (especially the Chain Rule) and to computer science, where it models the chaining of procedures.

Quick Reference

Concept Formula / Rule
Composite function
Domain of
Order matters in general
Associativity

What Is Composition?

If and , we can define a new function by substituting into :

In general, to form the composite , we start with in the domain of , apply to get , and then apply to that result, obtaining . This requires to lie in the domain of .

Machine diagram showing input x through g then f to produce f(g(x)).
(a) Machine diagram: .
Arrow diagram showing the mapping from x to g(x) to f(g(x)).
(b) Arrow diagram for .

Let and be two functions. The composite function is defined by

for all in the domain of for which lies in the domain of .

The domain of is:

Order matters: and are generally different functions.

Examples

Let and . Find and with their domains.

Solution , . : Since for all real , always lies in . So . : is defined only for , and always lies in . So .

If , find and its domain.

Solution The formula simplifies to , but the domain is not all of . We need:
  1. : .
  2. : , i.e., , i.e., (always true).
So the second condition imposes no additional restriction, and .

Decomposing a Function

Any complex function can often be written as a composition of simpler ones. This skill is essential for the Chain Rule in calculus.

Find and such that where .

Solution To compute , we first square , then take the cosine. So: Check: . ✓

Find , , such that where .

Solution To compute : first take the absolute value, then add 3, then take the square root. Check: . ✓

Composing Three or More Functions

Composition is associative: . You can group them in any order when composing more than two functions.

For example, can be written as where , , .

Frequently Asked Questions

Is composition commutative? Generally no. and are usually different functions. For example, with and : but . These are not equal.

How do I find the domain of a composite function? First, find . Then, from those -values, keep only those where falls inside . The intersection of these two restrictions is .

Why is composition important in calculus? The Chain Rule in differential calculus says: if , then . To apply the Chain Rule, you need to recognize a function as a composition and identify its inner and outer parts.

Can a function be composed with itself? Yes. is called the iterate of . For example, if , then . Iterates appear in dynamical systems and the study of fractals.