Lesson Objectives
• Demonstrate an understanding of function notation

## Composition of Functions

When we work with functions, we will come across the topic of function composition. Function composition involves plugging one function in as the input for another function. Let's suppose we have a function f:
f(x) = 2x - 1
At this point, we should know how to evaluate the function for a given value of x. If we wanted to know the function's value when x is 3, we could notate this as:
f(x) = 2x - 1
f(3) = 2(3) - 1
f(3) = 6 - 1 = 5
In other words, the function's value when x is 3 is written as f(3) "f of 3". Since the result is 5, we can write our answer as:
f(3) = 5
If we wanted to try a different value for the variable, we can just change out the number inside of the parentheses. Let's suppose we wanted to know the function's value when x is -1.
f(-1) = 2(-1) - 1
f(-1) = -2 - 1 = -3
f(-1) = -3
When we look at function composition, we are plugging in a function for the variable instead of just a number. Let's suppose we had two functions, f, and g.
f(x) = 3x - 5
g(x) = 7x + 1
What do we do if we are asked for:
f(g(x)) = ?
All we need to do is plug g(x) in for x in f(x).
f(x) = 3x - 5
f(g(x)) = 3(7x + 1) - 5
f(g(x)) = 21x + 3 - 5 = 21x - 2
f(g(x)) = 21x - 2
If f and g are two functions, then:
(f ○ g)(x) = f[g(x)] » f composed of g
For this scenario, we plug g(x) in for x in f(x) and simplify.
(g ○ f)(x) = g[f(x)] » g composed of f
For this scenario, we plug f(x) in for x in g(x) and simplify.
Let's look at a few examples.
Example 1: Find each value or expression
f(x) = 2x2 - 5x - 1
g(x) = 2x - 1
Find: f(g(x))
For this problem, we will plug g(x) in for x in our function f(x):
f(x) = 2x2 - 5x - 1
f(g(x)) = 2(2x - 1)2 - 5(2x - 1) - 1
f(g(x)) = 2(4x2 - 4x + 1) - 5(2x - 1) - 1
f(g(x)) = 8x2 - 8x + 2 - 10x + 5 - 1
f(g(x)) = 8x2 - 18x + 6
Example 2: Find each value or expression
f(x) = 3x3 - 1
g(x) = x - 5
Find: f(g(x))
For this problem, we will plug g(x) in for x in our function f(x):
f(x) = 3x3 - 1
f(g(x)) = 3(x - 5)3 - 1
f(g(x)) = 3(x3 - 15x2 + 75x - 125) - 1
f(g(x)) = 3x3 - 45x2 + 225x - 375 - 1
f(g(x)) = 3x3 - 45x2 + 225x - 376
In addition to what we have already seen, we will have a variation of this problem type. Let's work through an example.
Example 3: Find each value or expression
f(x) = x2 - 7
g(x) = 2x2 + 18
Find: f(g(3))
There are two ways to solve this type of problem. First, we could find f(g(x)) and then plug a 3 in for x.
f(x) = x2 - 7
f(g(x)) = (2x2 + 18)2 - 7
f(g(x)) = 4x4 + 72x2 + 324 - 7
f(g(x)) = 4x4 + 72x2 + 317
Now we can plug in a 3 for x:
f(g(3)) = 4(3)4 + 72(3)2 + 317
f(g(3)) = 4(81) + 72(9) + 317
f(g(3)) = 324 + 648 + 317
f(g(3)) = 1289
Alternatively, we can plug in a 3 for x in g(x) first. Once this is done, we can plug the result in for x in f(x).
g(x) = 2x2 + 18
g(3) = 2(3)2 + 18
g(3) = 2(9) + 18 = 18 + 18 = 36
Since g(3) is 36, we can plug this in for x in f(x).
f(x) = x2 - 7
f(36) = (36)2 - 7
f(36) = 1296 - 7 = 1289
f(g(3)) = 1289
As you can see, we obtain the same answer either way.

#### Skills Check:

Example #1

Perform the indicated operation. $$g(x)=x^2 + 2x$$ $$f(x)=x + 4$$ $$\text{Find}: g(f(7))$$

A
$$3$$
B
$$0$$
C
$$-11$$
D
$$143$$
E
$$67$$

Example #2

Perform the indicated operation. $$f(x)=2x - 4$$ $$g(x)=x^3 + 4$$ $$\text{Find}: f(g(-2))$$

A
$$-2$$
B
$$2$$
C
$$4$$
D
$$-12$$
E
$$-6$$

Example #3

Perform the indicated operation. $$g(x)=4x - 2$$ $$h(x)=x^2 - 3x$$ $$\text{Find}: g(h(1))$$

A
$$20$$
B
$$-50$$
C
$$-21$$
D
$$-10$$
E
$$5$$         