3.9: Function Composition
( \newcommand{\kernel}{\mathrm{null}\,}\)
The following graphic is once again from the OER textbook Business Calculus by Calaway, Hoffman and Lippman, 2013 and is used with permission (Creative Commons Attribution 3.0 United States License).

The notation f(g(x)) and g(f(x)) may be easier to understand than using the composition operator. For f(g(x)), think of wrapping a package. The gift is put into the box (the gift is g(x), the box is f(x)) and the wrapped present, f(x), contains the gift g(x).
If f(x)=x2−2 and g(x)=√x, find:
- f(g(x)) and the domain of the composite function
- g(f(x)) and the domain of the composite function
Solution
- The composition of functions, f(g(x)) is:
f(g(x)) Function composition, f of g of xf(√x) Replace g(x) with √x(√x)2−2 In the function f(x), every x is replaced with g(x)=√xx−2f(g(x)), answer simplified.
The domain of the composite function contains the restrictions of the domain of the inner function, as well as the restrictions of the composite function.
The domain of the inner function, g(x)=√x is that x must be nonnegative, or in interval notation [0,∞)
The domain of the composite function, x−2 is all real numbers, (−∞,∞)
Therefore, the domain of f(g(x)) is [0,∞).
- The composition of functions, g(f(x)) is:
g(f(x)) Function composition, g of f of xg(x2−2) Replace f(x) with x2−2√x2−2 In the function g(x), every x is replaced with f(x)=x2−2x2−2g(f(x)), answer simplified.
The domain of the composite function contains the restrictions of the domain of the inner function, as well as the composite function.
The domain of the inner function, f(x)=x2−2 is all real numbers, or in interval notation (−∞,∞)
The domain of the composite function, √x2−2 is that the quantity x2−2 must be nonnegative, or x2−2≥0.
Solving x2−2≥0 for x, x≥2 and x≤−2. In interval notation, (−∞,−2]∪[2,∞)
Therefore, the domain of the composite function, g(f(x)) is the more restrictive domain, (−∞,−2]∪[2,∞).
If f(x)=1x−4 and g(x)=5x+4, find:
- f(g(x)) and the domain of the composite function
- g(f(x)) and the domain of the composite function
Solution
- The composition of functions, f(g(x)) is:
f(g(x)) Function composition, f of g of xf(5x+4) Replace g(x) with 5x+41(5x+4)−4 In the function f(x), every x is replaced with g(x)=5x+415x Simplifyx5f(g(x)), answer simplified.
The domain of the composite function contains the restrictions of the domain of the inner function, as well as the restrictions of the composite function.
The domain of the inner function, g(x)=5x+4 is all values of x such that x must not be 0, or in interval notation (−∞,0)∪(0,∞)
The domain of the composite function, x5 is all real numbers, (−∞,∞) Therefore, the domain of f(g(x)) is (−∞,0)∪(0,∞)
- The composition of functions, g(f(x)) is
g(f(x))Function composition, g of f of xg(1x−4)Replace f(x) with 1x−451x−4+4In the function g(x), every x is replaced with f(x)=1x−45(x−4)+4 Simplify the fraction5x−20+4 Simplify more5x−16g(f(x)), answer simplified.
The domain of the composite function contains the restrictions of the domain of the inner function, as well as the composite function.
The domain of the inner function, f(x)=1x−4 is that x≠4, or in interval notation (−∞,4)∪(4,∞)
The domain of the composite function, 5x−16 is all real numbers, (−∞,∞).
Therefore, the domain of the composite function, g(f(x)) is the more restrictive domain, (−∞,4)∪(4,∞).
For the given functions, find both f(g(x)) and g(f(x)), and find the domain of the composite function.
- f(x)=3x2+x−10, g(x)=1−20x
- f(x)=3x−2, g(x)=13x+23
- f(x)=4x−1, g(x)=√6+7x
- f(x)=5x+2, g(x)=x2−14x
- f(x)=x2−2x+1, g(x)=8−3x2
- f(x)=x2+3, g(x)=√5+x2