## Section 7.3 Gist of Composition and Inverses of Functions

¶### Subsection 7.3.1 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

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{.}\)

###### Checkpoint 7.3.1.

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.

###### Note 7.3.2.

Often, the composite function \(f(g(x))\) is written as

to indicate that \((f \circ g)\) is a new function.

Similarly, the composite functions \(g(f(x))\) and \(f(f(x))\) would be written as \((g \circ f)(x)\) and \((f \circ f)(x)\text{.}\)

###### Checkpoint 7.3.3.

Notice something important about the composite formula you found for \(g(f(x))\) in Exercise 7.3.3: 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:

This is *exactly* the same result you got when you evaluated \(g(f(5))\) in Exercise 7.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:

There is just one input value, \(x\text{,}\) that is needed in order to evaluate the composite function.

The next example uses function composition in the context of a patient taking blood pressure medicine.

###### Example 7.3.4.

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:

There is another function which represents how \(P\) depends on \(C\text{.}\) We will call this function \(g\text{,}\) and write:

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:

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 7.3.4 in the next exercise, evaluating the composition with a numerical input.

###### Checkpoint 7.3.5.

Finally, we conclude Example 7.3.4 by finding the formula for a composite function.

###### Checkpoint 7.3.6.

Even outside of a context, knowing how to write a formula for a composite function is an important skill.

###### Example 7.3.7.

Let \(f(x) = 3x^2 + 5x\) and \(g(x) = 8x - 1\text{.}\)

Find and simplify formulas for each composite function.

\(f(g(x))\)

\(g(f(x))\)

\(g(g(x))\)

\(f(f(x))\)

- \begin{align*} f(g(x)) \amp= f(8x - 1)\\ \amp= 3(8x - 1)^2 + 5(8x - 1)\\ \amp= 3(8x - 1)(8x - 1) + 40x - 5\\ \amp= 3(64x^2 - 16x + 1) + 40x - 5\\ \amp= 192x^2 - 8x - 2 \end{align*}
- \begin{align*} g(f(x)) \amp= g(3x^2 + 5x)\\ \amp= 8(3x^2 + 5x) - 1\\ \amp= 24x^2 + 40x - 1 \end{align*}
- \begin{align*} g(g(x)) \amp= g(8x - 1)\\ \amp= 8(8x - 1) - 1\\ \amp= 64x - 8 - 1\\ \amp= 64x - 9 \end{align*}
- \begin{align*} f(f(x)) \amp= f(3x^2 + 5x)\\ \amp= 3(3x^2 + 5x)^2 + 5(3x^2 + 5x)\\ \amp= 3(3x^2 + 5x)(3x^2 + 5x) + 15x^2 + 25x\\ \amp= 3(9x^4 + 30x^3 + 25x^2) + 15x^2 + 25x\\ \amp= 27x^4 + 90x^3 + 75x^2 + 15x^2 + 25x\\ \amp= 27x^4 + 90x^3 + 90x^2 + 25x \end{align*}

##### Transformations are Compositions.

In chapter 5, you studied transformations of a function. There, you took a function \(f(x)\) and shifted its graph left or right by adding a number to the input of the function. For instance, \(f(x – 3)\) represented shifting the graph \(y = f(x)\) to the right by \(3\) units.

However, this may also be thought of as the composition of two functions: \(f(x)\) and \(g(x) = x - 3\)

As a composition, this transformation occurs by substituting the function \(g(x) = x - 3\) into the function \(f(x)\text{:}\)

So, we have already been using function composition, though we have waited until now to give it that name.

### Subsection 7.3.2 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.

Using function notation, this means the following:

If \(f\) and \(g\) are inverses, then both of the following will be true:

- \(\displaystyle f(g(x)) = x\)
- \(\displaystyle g(f(x)) = x\)

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 (also called one-to-one).

###### Example 7.3.8.

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.

This shows that \(f(g(x)) = x\text{.}\) Similarly, we have:

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 exercise, practice interpreting the meaning of an inverse function.

###### Checkpoint 7.3.9.

###### Example 7.3.10.

The function \(V(r)\) represents the volume of a sphere with a radius of \(r\) centimeters.

It is true that \(V(3.5) \approx 179.59\text{.}\) In context, this means that if the radius is \(3.5\) cm, then the volume is approximately \(179.59\) cm\(^{3}\text{.}\)

What does the equation

mean in context?

It means that if the volume is \(0.56\) cm\(^{3}\text{,}\) then the radius is approximately \(0.51\) cm.

##### 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{.}\)

###### Checkpoint 7.3.11.

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{.}\)

##### Domain and Range Connection.

A function and its inverse trade inputs and outputs. Recall Exercise 1.1.1, where the function used degrees Fahrenheit as the input, and gave degrees Celsius as the output. The inverse for this function would use degrees Celsius as the input and give degrees Fahrenheit as the output.

You probably own a trimmed-down version of this function, as seen below:

This is clearly an invertible function, changing degrees Fahrenheit into degrees Celsius. We choose an input value (degrees Fahrenheit) on one side of the thermometer, and read the corresponding output (degrees Celsius) on the other side.

If we gave this function the name \(C = g(F)\text{,}\) then the domain is

and the range is

Of course, we could also read the thermometer in reverse, using degrees Celsius as the input and degrees Fahrenheit as the output. This would be the inverse function, written as:

Notice that the domain and range have been switched for the inverse function. Now \(F = g^{-1}(C)\) has domain

and range:

This observation will be true for all invertible functions:

If \(f\) is an invertible function, then:

The domain of \(f\) is the same as the range of \(f^{-1}\text{,}\) and

The range of \(f\) is the same as the domain of \(f^{-1}\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?

###### Example 7.3.13.

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

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:

Solve this equation to find the value of \(B^{-1}(925)\text{.}\)

Solving for \(t\text{:}\)

It would take about \(20.81\) years for the account to grow to \(\$925\text{.}\)

###### Example 7.3.14.

If you had to repeatedly answer questions like those in Example 7.3.13, 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:

Here, we treat \(B^{-1}(x)\) as the unknown, and solve for it, using the same algebraic steps as we used in Example 7.3.13:

Now, use this inverse function to determine how long it would take for there to be \(\$1200\) in the account.

The input for the inverse function is *dollars*, so we just evaluate:

It would take about \(29.62\) years for the account to grow to \(\$1200\text{.}\)

###### Checkpoint 7.3.15.

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{.}\)

Use the fact that

to solve for \(g^{-1}(x)\text{.}\) Expanding this is the first step:

Now, solve this equation for \(g^{-1}(x)\text{.}\)

##### What 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 at most *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.

###### Checkpoint 7.3.16.

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.

###### Example 7.3.17.

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 7.3.18.

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 7.3.19.

##### 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{:}\)

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.

###### Checkpoint 7.3.20.

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.

### Subsection 7.3.3 Conclusion

Test your understanding of this chapter with the following exercises.

Student Learning Outcome: *Define composite functions and combinations of functions and apply and interpret these in appropriate situations.*

###### Checkpoint 7.3.21.

###### Checkpoint 7.3.22.

Student Learning Outcome: *Evaluate, apply, and interpret function notation, including the notation for inverse functions and composition of functions.*

###### Checkpoint 7.3.23.

###### Checkpoint 7.3.24.

###### Checkpoint 7.3.25.

Student Learning Outcome: *Demonstrate the inverse relationship between an exponential function and a logarithmic function (with the same base).*

###### Checkpoint 7.3.26.

###### Checkpoint 7.3.27.

###### Checkpoint 7.3.28.

### Exercises 7.3.4 Exercises

###### 1.

Evaluating Composite Functions

###### 2.

###### 3.

###### 4.

###### 5.

###### 6.

###### 7.

Formula of a Composite Function

###### 8.

###### 9.

###### 10.

###### 11.

###### 12.

###### 13.

Graph of a Composite Function

###### 14.

###### 15.

Evaluating Inverse Functions

###### 16.

###### 17.

###### 18.

###### 19.

Formula of an Inverse Function

###### 20.

###### 21.

###### 22.

###### 23.

###### 24.

###### 25.

###### 26.

###### 27.

###### 28.

Graph of an Inverse Function

###### 29.

###### 30.

###### 31.

###### 32.

###### 33.

###### 34.

Restricting the Domain

###### 35.

Additional Problems

###### 36.

###### 37.

###### 38.

###### 39.

###### 40.

###### 41.

Written Homework

###### 42.

At a company, the human resources department keeps information about their employees in table form. If an office specialist enters the name of an employee, a function \(f\) will output that employee's ID Number. If they enter an employee's ID Number, then various functions can be used:

Function \(W\) will output that employee's current hourly wage (in dollars).

Function \(D\) will output that employee's date of hire.

Function \(N\) will output that employee's name.

Write a composition to find employee Nallely Garcia's date of hire.

Write a composition to find employee David Smith's hourly wage.

What is \(f(N(1435))\text{?}\) Explain how you know.

Which of the functions (\(f\text{,}\) \(W\text{,}\) \(D\) and \(N\)) are

*invertible*? Explain your choices, using examples if possible.