Skip to content

Mathematics and Statistics · Ch 2 — Functions

Composite Functions

6

Composite Functions

Given two functions f:A→Bf : A \to B and g:B→Cg : B \to C, the composite function g∘f:A→Cg \circ f : A \to C (read "gg composed with ff", or "gg of ff") is defined by first applying ff and then applying gg to the result:

(g∘f)(x)=g(f(x)).(g \circ f)(x) = g\big(f(x)\big).

For this composition to make sense, the codomain of ff must match (or be contained in) the domain of gg — the output of the first function must be a valid input to the second.

The single most important rule of composition is that it is generally not commutative: f∘gf \circ g and g∘fg \circ f are, in general, two entirely different functions, even when both are defined. They must always be worked out separately, never assumed equal. For example, with f(x)=x+1f(x)=x+1 and g(x)=x2g(x)=x^2,

(g∘f)(x)=g(x+1)=(x+1)2=x2+2x+1,(f∘g)(x)=f(x2)=x2+1,(g\circ f)(x)=g(x+1)=(x+1)^2=x^2+2x+1, \qquad (f\circ g)(x)=f(x^2)=x^2+1,

which are clearly different.

Composition is, however, associative: (h∘g)∘f=h∘(g∘f)(h\circ g)\circ f = h\circ(g\circ f), so a chain of three or more functions may be grouped in any way. Composing any function ff with the identity function I(x)=xI(x)=x leaves it unchanged: f∘I=I∘f=ff\circ I = I\circ f = f. …

Definition 1Composite Function

For f:A→Bf : A \to B and g:B→Cg : B \to C, the composite (g∘f)(x)=g(f(x))(g\circ f)(x)=g(f(x)) applies ff first, then gg. It requires the range of ff to lie …

Definition 2Non-commutativity of Composition

In general f∘g≠g∘ff\circ g \neq g\circ f; the two composites must be computed separately. Composition is, however, associative, and the identity function is neu …