Skip to content

Mathematics · Ch 1 — Relations and Functions

Composite Functions

5

Composite Functions

5. Composite Functions

Given 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 is defined by

(g∘f)(x)=g(f(x)),for every x∈A(g \circ f)(x) = g(f(x)), \quad \text{for every } x \in A

Reading right to left: first apply ff to xx, landing in BB; then apply gg to that result, landing in CC. The composite is only defined when the codomain of the "inner" function matches (or lies inside) the domain of the "outer" function.

Computing a Composite

Illustration. Let f(x)=2x+1f(x) = 2x + 1 and g(x)=x2−2g(x) = x^2 - 2, both R→R\mathbb{R} \to \mathbb{R}.

(g∘f)(x)=g(f(x))=g(2x+1)=(2x+1)2−2=4x2+4x−1(g \circ f)(x) = g(f(x)) = g(2x+1) = (2x+1)^2 - 2 = 4x^2 + 4x - 1

(f∘g)(x)=f(g(x))=f(x2−2)=2(x2−2)+1=2x2−3(f \circ g)(x) = f(g(x)) = f(x^2 - 2) = 2(x^2-2) + 1 = 2x^2 - 3

Comparing the two results, 4x2+4x−1≠2x2−34x^2+4x-1 \neq 2x^2-3 in general.

Watch out

Composition of functions is not commutative — in general f∘g≠g∘ff \circ g \neq g \circ f, as the illustration above shows. Always compute the two composites separately and never assume they agree; when they do coincide, it is a special situation worth noting.

Domain of a Composite

The domain of g∘fg \circ f is the set of xx in the domain of ff for which f(x)f(x) also lies in the domain of gg; composing can shrink the domain below that of either function alone.

Illustration. Let f(x)=xf(x) = \sqrt{x} (domain x≥0x \geq 0) and g(x)=x+4g(x) = x + 4 (domain all of R\mathbb{R}).

(g∘f)(x)=x+4,domain x≥0 (inherited from f)(g \circ f)(x) = \sqrt{x} + 4, \quad \text{domain } x \geq 0 \text{ (inherited from } f\text{)}

(f∘g)(x)=x+4,domain x≥−4 (need the input to f to be ≥0)(f \circ g)(x) = \sqrt{x+4}, \quad \text{domain } x \geq -4 \text{ (need the input to } f \text{ to be } \geq 0\text{)}

Associativity of Composition …