Skip to main content

Section 4.2 Simplifying a Composition of Functions

Sometimes, we don't want to evaluate a composition of functions at just one value. We might want to create an entirely new function from a composition. Then, we can evaluate it at all of the numbers we want!

If the composition of functions doesn't specify an input value, then we actually want to write an entire new function. We still work from the inside to the outside, but instead of evaluating the inside function, we put its entire formula in.

Example 4.6.

Suppose \(f(x)=2x-9\) and \(g(x)=x^2+1\text{,}\) and we want to find \(f(g(x))\text{.}\) Since we don't have a number to plug into \(g(x)\text{,}\) we're going to take its entire formula and plug it into \(f(x)\text{:}\)

\begin{align*} f(g(x)) \amp = f(x^2+1)\\ \amp = 2(x^2+1)-9\\ \amp = 2x^2-7 \end{align*}

You'll notice that this is very similar to what we did in Section Section 2.1. If you're having trouble keeping track of what goes where, the same tricks might be helpful. For example, you might find it helpful to color-code the inside formula. In that case, the example above would look like this:

\begin{align*} f({\color{red}{g(x)}} ) \amp = f({\color{red}{x^2+1}})\\ \amp = 2({\color{red}{x^2+1}})-9\\ \amp = 2x^2-7 \end{align*}

You might also find it useful to put an extra step in the middle: write a blank where the \(x\)'s are in the formula for \(f(x)\text{,}\) and then fill in the blank with the formula for \(g(x)\text{,}\) like this:

\begin{align*} f(g(x)) \amp = f(x^2+1)\\ \amp = 2(\hspace{0.5in})-9\\ \amp = 2(x^2+1)-9\\ \amp = 2x^2-7 \end{align*}

Checkpoint 4.7.

Suppose \(f(x)=5x+1\) and \(g(x)=x^2+x-3\text{.}\) Find each of the following:

  1. \(\displaystyle f(g(x))\)

  2. \(\displaystyle g(f(x))\)

  3. \(\displaystyle f(f(x))\)

Answer.
  1. \(\displaystyle f(g(x))= 5x^2+5x-14\)

  2. \(\displaystyle g(f(x))= 25x^2 + 15x -1\)

  3. \(\displaystyle f(f(x)) = 25x+6\)

Solution.
  1. To find \(f(g(x))\text{,}\) we take the whole formula for \(g(x)\) and plug it into the formula for \(f(x)\text{:}\)

    \begin{align*} f(g(x)) \amp = f(x^2+x-3)\\ \amp =5(x^2+x-3)+1\\ \amp= 5x^2+5x-14 \end{align*}
  2. To find \(g(f(x))\text{,}\) we take the whole formula for \(f(x)\) and plug it into the formula for \(g(x)\text{:}\)

    \begin{align*} g(f(x)) \amp = g(5x+1)\\ \amp = (5x+1)^2+(5x+1)-3\\ \amp = (25x^2+10x + 1) + (5x+1)-3\\ \amp = 25x^2 + 15x -1 \end{align*}
  3. To find \(f(f(x))\text{,}\) we take the whole formula for \(f(x)\) and plug it back into the formula for \(f(x)\text{:}\)

    \begin{align*} f(f(x)) \amp = f(5x+1)\\ \amp = 5(5x+1)+1\\ \amp = 25x+6 \end{align*}