Section9.3Gist of Composition and Inverses of Functions¶ permalink
Subsection9.3.1Summary of Composition
The composition of functions is all about using the output of one function as the input for another.
The notation we will use for composing two functions is \begin{equation*}f(g(x))\end{equation*} which we read as "\(f\) of \(g\) of \(x\)".
Working from the inside-out, this means that the function \(g\) is used first to get an output, and then that output is used as the input for the function \(f\text{.}\)
If we use function composition with a numerical input, we will get a numerical output. However, if we just use \(x\) as the input and compose functions, the result will be an expression involving \(x\text{,}\) which is a brand new function representing the composition. This new function is called a composite function.
Exercise9.3.2
Notice something important about the composite formula you found for \(g(f(x))\) in Exercise 9.3.2: Using \(x\) as the input, you found that \(g(f(x)) = 9x^2 + 27x + 20\text{.}\) Evaluating this new formula at the input \(x = 5\) gives:\begin{align*} 9(5)^2 + 27(5) + 20 \amp= 9\cdot25 + 27\cdot5 + 20\\ \amp= 225 + 135 + 20\\ \amp= 380 \end{align*}
This is exactly the same result you got when you evaluated \(g(f(5))\) in Exercise 9.3.1.
The formula \(g(f(x)) = 9x^2 + 27x + 20\) is really a new, single function that represents the composition \(f(g(x))\text{.}\) Once you've found this formula, you could quickly evaluate many numerical compositions, such as \(g(f(7))\) or \(g(f(-3.6))\text{,}\) without having to think about \(g\) and \(f\) separately.
Turning two or more functions into one function by composition is really a common idea — think about any complex machine, such as an automobile. Many internal processes depend on each other, and you may think of the following simplifications:
Applying pressure to the accelerator pedal allows air into sthe fuel system.
The air in the system is monitored, and fuel is added to the system accordingly.
Spark plugs ignite the fuel mixture.
Etc.
Now, few people would look at a car and see it as a composition of its dozens of connected systems and processes. We just simplify this by assigning a single word to refer to this complex composite function: “car”.
If everything is working properly, from the driver's perspective, there is just one input — depressing the accelerator — that sets everything else in motion.
This is true for any composition of functions in mathematics. Even if we have something complicated like \begin{equation*}f(g(h(x)))\end{equation*} there is just one input value, \(x\text{,}\) that is needed in order to evaluate.
The next example uses function composition in the context of a patient taking blood pressure medicine.
Example9.3.3
Let \(C\) represent the concentration, measured in mg⁄kg, of a blood pressure regulating drug in a patient's bloodstream as a function of time \(t\text{,}\) measured in hours. As time goes on, the concentration of the drug in the bloodstream decreases as the body metabolizes and/or excretes it.
At the same time, the drug is meant to help lower the patient's blood pressure \(P\text{,}\) measured in mm Hg. So, as the drug leaves the patient's bloodstream, the blood pressure increases.
Therefore, \(P\) depends on \(C\text{,}\) and \(C\) depends on \(t\text{.}\)
There is a function which represents how \(C\) depends on \(t\text{.}\) We will call this function \(f\text{,}\) and write: \begin{equation*}C = f(t)\end{equation*}
There is another function which represents how \(P\) depends on \(C\text{.}\) We will call this function \(g\text{,}\) and write: \begin{equation*}P = g(C)\end{equation*}
So, we would first use \(f(t)\) to find the concentration \(C\) of the drug in the bloodstream, and then use that concentration as the input for the function \(g(C)\) in order to find the patient's blood pressure \(P\text{.}\)
In function notation, this would look like:\begin{align*} P \amp= g(C)\\ \amp=g(f(t)) \end{align*}
That last expression, \(g(f(t))\text{,}\) is a composite function, and it shows that the blood pressure is really a function of \(t\text{.}\)
Continue Example 9.3.3 in the next exercise, evaluating the composition with a numerical input.
Exercise9.3.4
Finally, we conclude Example 9.3.3 by finding the formula for a composite function.
Exercise9.3.5
Even outside of a context, knowing how to write a formula for a composite function is an important skill.
In the next problem, practice writing formulas for \(f(g(x))\) and \(g(f(x))\text{.}\)
Exercise9.3.6
Subsection9.3.2Summary of Inverses
Two functions are called inverses if they undo each other. If one function has a certain process, then the other function will have the reverse process.
This means that if \(f\) and \(g\) are inverses, then both of the following will be true:\begin{align*} f(g(x)) \amp= x\\ g(f(x)) \amp= x \end{align*}
This is because whatever the inside function did with the input \(x\text{,}\) the outside function undid that action.
If a function \(f\) has an inverse function \(f^{-1}\text{,}\) then we say that the function \(f\) is invertible.
Example9.3.7
The functions \(f(x) = 2^x + 1\) and \(g(x) = \log_{2}(x - 1)\) are inverses.
In order to show this, we would use function composition to show that both of the conditions above are true.\begin{align*} f(g(x)) \amp= f(\log_{2}(x - 1))\\ \amp= 2^{\log_{2}(x - 1)} + 1\\ \amp= (x - 1) + 1\\ \amp= x \end{align*}
This shows that \(f(g(x)) = x\text{.}\) Similarly, we have:\begin{align*} g(f(x)) \amp= g(2^x+1)\\ \amp= \log_{2}\left((2^x+1)-1\right)\\ \amp= \log_{2}\left(2^x\right)\\ \amp= x \end{align*}
This shows that \(g(f(x)) = x\text{.}\)
Notation
If \(h(x)\) is a function, then its inverse is called \(h^{-1}\text{.}\) This notation does not mean that \(h\) is being raised to a negative exponent — rather, it is just special notation for an inverse function.
We use this special notation either when we want to talk about the inverse of some function, or when we want to find the formula for the inverse.
Interpreting the notation
If \(f\) takes an input \(a\) and gives an output \(b\text{,}\) then its inverse \(f^{-1}\) would take \(b\) as the input and give the output \(a\text{.}\)
Since a function and its inverse represent reverse processes, the input and output are similarly reversed.
In the next two exercises, practice interpreting the meaning of an inverse function.
Exercise9.3.8
Exercise9.3.9
Graphing the Inverse
We can describe the inverse of a function \(f\) in different ways, depending on what information we need.
For instance, we can certainly take a table of values from \(f(x)\text{,}\) switch the inputs and outputs, and we will have a table of values for \(f^{-1}(x)\text{:}\)
\(x\) | \(f(x)\) |
\(1\) | \(12\) |
\(3\) | \(10\) |
\(4\) | \(8\) |
\(6\) | \(1\) |
\(10\) | \(-4\) |
\(x\) | \(f^{-1}(x)\) |
\(12\) | \(1\) |
\(10\) | \(3\) |
\(8\) | \(4\) |
\(1\) | \(6\) |
\(-4\) | \(10\) |
From a graphical standpoint, taking a set of points from the table of \(y = f(x)\text{,}\) and switching the \(x\)- and \(y\)-coordinates, will give us points on the graph of \(y = f^{-1}(x)\text{.}\)
Exercise9.3.10
If you have the graph of a function \(y = f(x)\text{,}\) you can sketch a graph of its inverse \(y = f^{-1}(x)\) by selecting points on \(y = f(x)\) and reflecting them over the line \(y = x\text{.}\) This is actually the effect of switching the \(x\)- and \(y\)-coordinates of a point: it reflects the point over the line \(y = x\text{.}\)
The Inverse Formula
If we have the formula for a function \(f(x)\text{,}\) we may want to use the formula for the inverse \(f^{-1}(x)\text{.}\)
But how can we find the formula?
Example9.3.11
If you deposit \(\$500\) into a savings account that earns \(3\%\) interest per year, and you make no additional deposits or withdrawals, then your account balance can be found by the function \begin{equation*}B(t) = 500(1.03)^t\end{equation*} where \(t\) represents the number of years after making the original deposit of \(\$500\text{,}\) and \(B(t)\) represents the balance in the account after \(t\) years.
For this function, the input is years and the output is dollars. You would use a number of years, say \(12\text{,}\) and \(B(12)\) would calculate how many dollars are in the account.
The inverse function \(B^{-1}\) would switch these, using dollars for the input and years for the output. Here, you would use an amount of money, say \(\$925\text{,}\) and \(B^{-1}(925)\) would calculate how many years it would take to have that much in the account.
In order to find the value of \(B^{-1}(925)\text{,}\) we could solve for \(t\) in the equation: \begin{equation*}500\cdot1.03^t = 925\end{equation*}
Solve this equation to find the value of \(B^{-1}(925)\text{.}\)
Example9.3.12
If you had to repeatedly answer questions like those in Example 9.3.11, you would find yourself solving the same equation each time.
Instead, you could just find the formula for the inverse function \(B^{-1}\) and use it to directly calculate the number of years required.
To do this, use the fact that \(B\) and \(B^{-1}\) undo each other. In particular: \begin{equation*}B\mathopen{}\left(B^{-1}(x)\right)\mathclose{} = x\end{equation*}
Here, we treat \(B^{-1}(x)\) as the unknown, and solve for it, using the same algebraic steps as we used in Example 9.3.11:\begin{align*} B\mathopen{}\left(B^{-1}(x)\right)\mathclose{} \amp= x\\ 500(1.03)^{B^{-1}(x)} \amp= x\\ 1.03^{B^{-1}(x)} \amp= \frac{x}{500}\\ \ln\mathopen{}\left(1.03^{B^{-1}(x)}\right)\mathclose{} \amp= \ln\mathopen{}\left(\frac{x}{500}\right)\mathclose{}\\ B^{-1}(x)\cdot \ln (1.03) \amp= \ln\mathopen{}\left(\frac{x}{500}\right)\mathclose{}\\ B^{-1}(x) \amp= \frac{\ln\mathopen{}\left(\frac{x}{500}\right)\mathclose{}}{\ln (1.03)} \end{align*}
Now, use this inverse function to determine how long it would take for there to be \(\$1200\) in the account.
Exercise9.3.13
For the function \(g(x) = \frac{3}{5x+2}\text{,}\) use the technique from the last example to find the formula for the inverse \(g^{-1}(x)\text{.}\)
Hint SolutionWhat makes a function invertible
Remember the defining characteristic of a function:
For each input, there is only one output.
Thinking about the graph, this means that there can be only one point with any given \(x\)-coordinate. That is, no two points on the graph of a function can be directly above or below each other.
Now, if an inverse \(f^{-1}\) is really a function, then it must also obey this rule. No two points on the graph of \(y = f^{-1}(x)\) can sit directly above or below each other.
So if \(f^{-1}\) is a function, this has an implication for the original function \(f\text{.}\)
To see this, remember that the graphs of a function and its inverse are reflections of each other over the line \(y = x\text{.}\) If no two points on the graph of an inverse function can sit above or below each other, then reflecting these points over \(y = x\) means that no two points on the graph of \(f(x)\) can sit directly left or right of each other.
Explore this in the following exercise.
Exercise9.3.14
Graphically, we have these two rules:
- Vertical Line Test
A vertical line may only intersect the graph of a function at most once. If some vertical line could intersect the graph more than once, then the graph is not a function.
- Horizontal Line Test
If a function is invertible, then its graph may only intersect a horizontal line at most once. If a horizontal line could intersect the graph more than once, then the graph is not invertible.
Example9.3.15
As an example of using the Horizontal Line Test, the function \(f(x) = x^2\) does not have an inverse function, since the horizontal line \(y = 4\) intersects the graph of \(f(x)\) twice, at the points \((2, 4)\) and \((-2, 4)\text{.}\) See Figure 9.3.16.
Conversely, the function \(g(x) = x^3\) does have an inverse function, since no horizontal line can intersect the graph more than once. See Figure 9.3.17.
Restricting the Domain
You may object to the notion that \(f(x) = x^2\) is non-invertible, because surely the function \(g(x) = \sqrt{x}\) performs the opposite action.
However, this is only true because we define \(\sqrt{x}\) so that it never gives negative outputs. [Check this on your calculator!]
For example, we have two inputs which give the same output for the function \(f(x)=x^2\text{:}\)\begin{gather*} f(5) = 5^2 = 25\\ f(-5) = (-5)^2 = 25 \end{gather*}
Since an inverse function would reverse the input and the output, it would need to somehow use \(25\) as the input, and then output both \(5\) and \(-5\text{.}\)
But because \(g(x) = \sqrt{x}\) is a function, it can only give the single output \(5\text{.}\)
Therefore, when we use \(g(x)=\sqrt{x}\) as the inverse for \(f(x)=x^2\text{,}\) we have decided to use only part of the domain of \(f\) so that its inverse, \(g\text{,}\) is really a function. This is called restricting the domain.
Exercise9.3.18
We restrict the domain of a function in order to make it invertible. We choose an interval for the input, so that the output never has repeated values — this ensures that the inverse will pass the vertical line test.