1.6.1: Composition of Functions
- Page ID
- 14144
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Composition of Functions
If f(x) = x + 2, and g(x) = 2x + 4, what is f(g(x))?
A function can be conceptualized as a 'black box'. The input, or x value is placed into the box, and the box performs a specific set of operations on it. Once the operations are complete, the output (the "f(x)" or "y" value) is retrieved. Once the output is retrieved, the box is ready to work on the next input.
Using this idea, function composition can be seen as a box inside of a box. The input x value goes into the inner box, and then the output of the inner box is used as the input of the outer box.
Composition of Functions
Functions are often described in terms of “input” and “output.” For example, consider the function f(x) = 2x + 3. When we input an x value, we output a y value, or a function value. We find the output by taking the input x, multiplying by 2, and adding 3. We can do this for any value of x. Now consider a second function g(x) = 5x. For this function too, we can take an x value, input the x into g(x), and obtain an output. What happens if we take the output of g and use it as the input of f?
Examples
Solution
Earlier, you were given a problem about finding a composite function.
If f(x) = x + 2, and g(x) = 2x + 4, what is f(g(x))?
f(g(x)) = f(2x + 4) = (2x + 4) + 2 = 2x + 6
Given the function definition above, g(x) = 5x. Therefore if x = 4, then we have g(4) = 5(4) = 20. What happens if we then take the output of 20 and use it as the input of f?
Solution
Substituting 20 in for x in f(x) = 2x + 3 gives: f(20) = 2(20) + 3 = 43.
The table below shows several examples of this same process:
x | Output from g | Output from f |
---|---|---|
2 | 10 | 23 |
3 | 15 | 33 |
4 | 20 | 43 |
5 | 25 | 53 |
Examining the values in the table, we can see a pattern: all of the final output values from f are 3 more than 10 times the initial input. We have created a new function called h(x) out of f(x) = 2x + 3 in which g(x) = 5x is the input:
h(x) = f(5x) = 2(5x) + 3 = 10x + 3
When we input one function into another, we call this the composition of the two functions. Formally, we write the composed function as f(g(x)) = 10x + 3 or write it as (f o g)x = 10x + 3
Find f(g(x)) and g(f(x)):
- f(x) = 3x + 1 and g(x) = x2
- f(x) = 2x + 4 and g(x) = (1/2) x - 2
Solution
- f(g(x)) = f(x2) = 3(x2) + 1 = 3x2 + 1
g(f(x)) = g(3x + 1) = (3x + 1)2 = 9x2 + 6x + 1
In both cases, the resulting function is quadratic.
- f(g(x)) = 2((1/2)x - 2) + 4 = (2/2)x - 4 + 4 = (2/2)x = x
g(f(x)) = g(2x + 4) = (1/2)(2x + 4) - 2 = x+ 2 - 2 = x.
In this case, the composites were equal to each other, and they both equal x, the original input into the function. This means that there is a special relationship between these two functions. We will examine this relationship in Chapter 3. It is important to note, however, that f(g(x) is not necessarily equal to g(f(x)).
Decompose the function f(x) = (3x - 1)2 - 5 into a quadratic function g(x) and a linear function h(x).
Solution
When we compose functions, we are combining two (or more) functions by inputting the output of one function into another. We can also decompose a function. Consider the function f(x) = (2x + 1)2. We can decompose this function into an “inside” and an “outside” function. For example, we can construct f(x) = (2x+ 1)2 with a linear function and a quadratic function. If g(x) = x2 and h(x) = (2x + 1), then f(x) = g(h(x)). The linear function h(x) = (2x + 1) is the inside function, and the quadratic function g(x) = x2 is the outside function.
Let h(x) = 3x - 1 and g(x) = x2 - 5. Then f(x) = g(h(x)) because g(h(x)) = g(3x - 1) = (3x - 1)2 - 5.
The decomposition of a function is not necessarily unique. For example, there are many ways that we could express a linear function as the composition of other linear functions.
Given:
f(x)=5x+3
g(x)=3x2
Find: f(g(4))
Solution
To find f(g(4)), we need to know what g(4) is, so we know what to substitute into f(x):
Substitute 4 for x for the function g(x), giving: 3⋅42
Simplify: 3⋅16=48
∴ g(4)=48
Substitute 48 for the x in the function f(x) giving: 5(48)+3
Simplify: 240+3=243
∴ f(g(4))=243
Given:
h(n)=7n+1+4(g(n))
g(t)=−t
f(x)=−2x+g(x)
Find: f(h(−5))
Solution
First, let's solve for the value of the inner function, h(−5). Then we'll know what to plug into the outer function.
h(−5)=(7)(−5)+1+4(g(−5))
To solve for the value of h, we need to solve g(−5)
g(−5)=−(−5)
∴ g(−5)=5
Now we have: h(−5)=(7)(−5)+1+(4)(5)
Simplify to get: h(−5)=−14
Now we know that h(−5)=−14. That tells us that f(h(−5)) is f(−14)
Find f(−14)=(−2)(−14)+g(−14)
So to solve for the value of f(−14), we need to solve for the value of g(−14)
g(−14)=−(−14)
∴ g(−14)=14
Now we can finish up!
f(−14)=(−2)(−14)+14
∴ f(−14)=42
Review
For problems 1-4:
f(x)=2x−1 g(x)=3x h(x)=x2+1
- Find: f(g(−3))
- Find: f(h(7))
- Find: h(g(−4))
- Find: f(g(h(2)))
Evaluate each composition below:
- Given: \(\ f(x)=-5 x+2 \text { and } g(x)=\frac{1}{2} x+4 . \text { Find } f(g(12))\).
- Given: \(\ g(x)=-3 x+6 \text { and } h(x)=9 x+3 . \text { Find } g\left(h\left(\frac{1}{3}\right)\right)\).
- Given: \(\ f(x)=-\frac{1}{5} x+4 \text { and } g(x)=4 x^{2} . \text { Find } f(g(10))\).
- Given: \(\ g(x)=3|x-4|+6 \text { and } h(x)=-x^{3} . \text { Find } h(g(4))\).
- Given: \(\ f(x)=\sqrt{x+2} \text { and } g(x)=|2 x| \text { . Find } g(f(-7))\).
- Given: \(\ f(x)=-3 x+2 \text { and given } g(x)=2 x^{2} \text { and given } h(x)=4|7-x|+6 \text { . Find }f(g(h(1)))\).
- Given: \(\ f(x)=(-3) \text { and given } g(x)=\sqrt{2 x} \text { and given } h(x)=|4 x|-12 . \text { Find } f(h(g(18)))\).
- Are compositions commutative? In other words, does \(\ f(g(x))=g(f(x))\)?
- Given: \(\ f(x)=-2^{2}-5 x \text { and } h(x)=3 x+2 . \text { Find } f(h(x))\).
- Two functions are inverses of each other if \(\ f(g(x))=x \text { and } g(f(x))=x \text { If } f(x)=x+3\), find its inverse: \(\ g(x)\)
- A toy manufacturer has a new product to sell. The number of units to be sold, \(\ n\), is a function of the price p such that: \(\ n(p)=30-25 p\). The revenue r earned from the sales is a function of the number of units sold n such that: \(\ r(n)=1000-\frac{1}{4} x^{2}\). Find the function for revenue in terms of price, \(\ p\).
Vocabulary
Term | Definition |
---|---|
composite function | A composite function is a function h(x) formed by using the output of one function g(x) as the input of another function f(x). Composite functions are written in the form h(x)=f(g(x)) or h=f∘g. |
domain | The domain of a function is the set of x-values for which the function is defined. |
Function | A function is a relation where there is only one output for every input. In other words, for every value of x, there is only one value for y. |
Function composition | Function composition involves 'nested functions' or functions within functions. Function composition is the application of one function to the result of another function. |
input | The input of a function is the value on which the function is performed (commonly the x value). |
Output | The output of a function is the result of the operations performed on the independent variable (commonly x). The output values are commonly the values of y or f(x). |
Range | The range of a function is the set of y values for which the function is defined. |