4.9: Function Composition
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) = x^2 − 2\) and \(g(x) =\sqrt{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:
\(\begin{aligned} f(g(x)) &&\text{ Function composition, }f \text{ of }g\text{ of }x \\ f(\sqrt{x}) &&\text{ Replace } g(x)\text{ with }\sqrt{x} \\ ( \sqrt{x})^2 − 2 && \text{ In the function } f(x)\text{, every }x \text{ is replaced with } g(x) =\sqrt{x} \\ x − 2 && f(g(x))\text{, answer simplified.} \end{aligned}\)
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) = \sqrt{x}\) is that \(x\) must be nonnegative, or in interval notation \([0, \infty )\)
The domain of the composite function, \(x − 2\) is all real numbers, \((−\infty , \infty )\)
Therefore, the domain of \(f(g(x))\) is \([0, \infty )\).
- The composition of functions, \(g(f(x))\) is:
\(\begin{aligned} g(f(x)) &&\text{ Function composition, }g \text{ of } f \text{ of } x \\ g(x^2 − 2)&& \text{ Replace }f(x)\text{ with } x^2 − 2 \\ \sqrt{x^2 − 2} &&\text{ In the function } g(x)\text{, every }x \text{ is replaced with } f(x) = x^2−2 \\ x^2 − 2 && g(f(x))\text{, answer simplified. }\end{aligned}\)
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) = x^2 − 2\) is all real numbers, or in interval notation \((−\infty , \infty )\)
The domain of the composite function, \(\sqrt{x^2} − 2\) is that the quantity \(x^2 −2\) must be nonnegative, or \(x^2 −2 \geq 0\).
Solving \(x^2 − 2 \geq 0\) for \(x\), \(x \geq 2\) and \(x \leq −2\). In interval notation, \((−\infty , −2] \cup [2, \infty )\)
Therefore, the domain of the composite function, g(f(x)) is the more restrictive domain, \((−\infty , −2] \cup [2, \infty )\).
If \(f(x) = \dfrac{1 }{x − 4}\) and \(g(x) = \dfrac{5 }{x} + 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:
\(\begin{aligned} f(g(x)) \text{ Function composition, } f\text{ of }g \text{ of }x\\ f\left( \dfrac{5}{ x} + 4\right) && \text{ Replace }g(x)\text{ with }\dfrac{5 }{x} + 4 \\ \dfrac{1 }{\left(5 x + 4\right)− 4} && \text{ In the function } f(x)\text{, every x is replaced with } g(x) = \dfrac{5}{ x} + 4 \\ \dfrac{1 }{\dfrac{5 }{x}}&&\text{ Simplify} \\ \dfrac{x }{5} && f(g(x))\text{, answer simplified. }\end{aligned}\)
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) = 5 x + 4\) is all values of \(x\) such that \(x\) must not be 0, or in interval notation \((−\infty , 0) \cup (0, \infty )\)
The domain of the composite function, \(\dfrac{x }{5}\) is all real numbers, \((−\infty , \infty )\) Therefore, the domain of \(f(g(x))\) is \((−\infty , 0) \cup (0, \infty )\)
- The composition of functions, \(g(f(x))\) is
\(\begin{aligned} g(f(x))&&\text{Function composition, } g \text{ of } f\text{ of }x \\ g\left( \dfrac{1 }{x −4}\right) &&\text{Replace } f(x) \text{ with }\dfrac{1}{ x − 4}\\ \dfrac{5 }{\dfrac{1 }{x − 4}} + 4 &&\text{In the function } g(x)\text{, every x is replaced with } f(x) = \dfrac{1 }{x − 4}\\ 5(x − 4) + 4 && \text{ Simplify the fraction} \\ 5x − 20 + 4 &&\text{ Simplify more}\\ 5x − 16 && g(f(x))\text{, answer simplified.} \end{aligned}\)
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) = \dfrac{1}{ x − 4 }\) is that \(x\neq 4\), or in interval notation \((−\infty , 4) \cup (4, \infty )\)
The domain of the composite function, \(5x − 16\) is all real numbers, \((−\infty , \infty )\).
Therefore, the domain of the composite function, \(g(f(x))\) is the more restrictive domain, \((−\infty , 4) \cup (4, \infty)\).
For the given functions, find both \(f(g(x))\) and \(g(f(x))\), and find the domain of the composite function.
- \(f(x) = 3x^ 2 + x − 10\), \(g(x) = 1 − 20x\)
- \(f(x) = 3x − 2\), \(g(x) = \dfrac{1}{ 3} x + \dfrac{2 }{3}\)
- \(f(x) = 4x − 1\), \(g(x) = \sqrt{6 + 7x}\)
- \(f(x) = 5x + 2\), \(g(x) = x^2 − 14x\)
- \(f(x) = x^ 2 − 2x + 1\), \(g(x) = 8 − 3x ^2\)
- \(f(x) = x ^2 + 3\), \(g(x) = \sqrt{5 + x^2} \)