Skip to main content

Section 3.1 Evaluating a Composition of Functions

In section Section 2.4, you learned about different ways to combine functions together. In this section, we'll learn a new way: putting functions inside of each other.

Definition 3.1.

A composition of functions is when we put one function inside of another. To compose f(x) and g(x), we could write either (f∘g)(x) or f(g(x)).

When we want to evaluate a composition of functions, we always work from the inside to the outside. This means that the order we write them in matters.

Example 3.2.

Suppose f(x)=2x+1 and g(x)=x2 and we want to find f(g(−2)). Since we work from the inside out, that means we start by finding g(−2). We use the formula for g(x) to get g(−2)=(−2)2=4. Now, we can plug that into f(x): f(g(−2))=f(4)=2(4)+1=9. Therefore, our answer is f(g(−2))=4.

Now, let's find g(f(−2)) instead. This time, we start with f(x), since it's on the inside: f(−2)=2(−2)+1=−3. Now, we can plug that into g(x): g(f(−2))=g(−3)=(−3)2=9. Therefore, our answer is g(f(−2))=9.

Checkpoint 3.3.

Suppose f(x)=x2+2x−3 and g(x)=−x. Evaluate each of the following:

  1. f(g(0))

  2. g(f(−1))

  3. f(f(2))

Answer.

Suppose f(x)=x2+2x−3 and g(x)=−x. Evaluate each of the following:

  1. f(g(0))=−3

  2. g(f(−1))=4

  3. f(f(2))=32

Solution.

Suppose f(x)=x2+2x−3 and g(x)=−x. Evaluate each of the following:

  1. To find f(g(0)), we start on the inside with g(x): g(0)=−(0)=0. Then, we plug that into f(x): f(g(0))=f(0)=(0)2+2(0)−3=−3.

  2. To find g(f(−1)), we start on the inside with f(x): f(−1)=(−1)2+2(−1)−3=1−2−3=−4. Then, we plug that into g(x): g(f(−1))=g(−1)=−(−4)=4.

  3. To find f(f(2)), we're going to plug into f(x) twice! First, we find f(2)=(2)2+2(2)−3=4+4−3=5. Now, we plug that back into f(x) again: f(f(2))=f(5)=(5)2+2(5)−3=25+10−3=32.

You might even have more than two functions that are composed together. We still always work from the inside to the outside.

Example 3.4.

Suppose f(x)=x2−3, and g(x) and h(x) are given in the table below.

Table 3.5.
x g(x) h(x)
1 2 −1
2 −3 4
3 4 0

Let's find f(h(g(1))). We start from the inside, so we begin with g(x). From the table, we can see that g(1)=2. Now, we can plug that into the next function, h(x): h(g(1))=h(2)=4. Finally, we plug that into the most outside function, f(x): f(h(g(1)))=f(h(2))=f(4)=(4)2−3=13.