Lesson Objectives
• Demonstrate an understanding of function notation

Composition of Functions

We previously learned about operations on function, which allowed us to combine two functions through addition, subtraction, multiplication, and division to create a new function. Here, we will look at another way of combining two functions to create a new function, known as function composition.

Function Composition

Given two functions f and g, the composite function f ∘ g, which is also known as the composition of f and g, is defined by: $$(f ∘ g)(x) = f(g(x))$$ Either side can be read as "f composed with g of x" or "f of g of x".
Note: The symbol "∘" is not a multiplication symbol. It is used for function composition. In general, the composite function f ∘ g is not the same as the product fg.
Example #1: Find f ∘ g. $$f(x) = \sqrt{x}$$ $$g(x) = x^2 + 5$$ To find f ∘ g, we want to plug g(x) in for x in f(x). $$(f ∘ g)(x) = f(g(x)) = \sqrt{x^2 + 5}$$

Domain of the Composite Function f ∘ g

To find the domain for f ∘ g, we state that we have the set of all x such that:
1. x is in the domain of g and
• If x is not in the domain of g, then it can't be in the domain of f ∘ g
2. g(x) is in the domain of f
• Any x-value for which g(x) is not in the domain of f can't be in the domain of f ∘ g
f(g(x)) is defined whenever g(x) and f(g(x)) are both defined. In other words, the domain of f(g(x)) will need to exclude any values for x where g(x) is undefined and also where f(g(x)) is undefined.
Example #2: Find the function f ∘ g and the domain. $$f(x) = 2x^2$$ $$g(x) = x + 7$$ To find f ∘ g, we plug g(x) in for x in f(x): $$(f ∘ g)(x) = f(g(x))$$ $$= f(x + 7)$$ $$= 2(x + 7)^2$$ $$= 2(x^2 + 14x + 49)$$ $$= 2x^2 + 28x + 98$$ What is the domain for f ∘ g?
1) Start with the domain for g: $$g(x) = x + 7$$ $$\text{Domain:} \hspace{.1em} \{x | x ∈ \mathbb{R}\}$$ 2) Continue to the domain for f ∘ g: $$f(g(x)) = 2x^2 + 28x + 98$$ $$\text{Domain:} \hspace{.1em} \{x | x ∈ \mathbb{R}\}$$ Example #3: Find the function f ∘ g and the domain. $$f(x) = \frac{1}{x - 2}$$ $$g(x) = \frac{4}{x}$$ To find f ∘ g, we plug g(x) in for x in f(x): $$(f ∘ g)(x) = f(g(x))$$ $$= f\left(\frac{4}{x}\right)$$ $$=\frac{1}{\frac{4}{x} - 2}$$ $$=\frac{1}{\frac{4}{x} - 2} \cdot \frac{x}{x}$$ $$=\frac{x}{4 - 2x}$$ What is the domain for f ∘ g?
1) Start with the domain for g: $$g(x) = \frac{4}{x}$$ Here x can't be zero since division by zero is undefined. $$\text{Domain:} \hspace{.1em} \{x | x ≠ 0\}$$ 2) Continue to the domain for f ∘ g: $$f(g(x)) = \frac{x}{4 - 2x}$$ Here the denominator (4 - 2x) can't be zero since division by zero is undefined. $$4 - 2x = 0$$ $$x = 2$$ We must also exclude 2 from the domain. $$\text{Domain:} \hspace{.1em} \{x | x ≠ 0, 2\}$$ Example #4: Find the function f ∘ g and the domain. $$f(x) = x^2 - 3$$ $$g(x) = \sqrt{3 - x^2}$$ To find f ∘ g, we plug g(x) in for x in f(x): $$(f ∘ g)(x) = f(g(x))$$ $$= f\left(\sqrt{3 - x^2}\right)$$ $$=(\sqrt{3 - x^2})^2 - 3$$ $$=3 - x^2 - 3$$ $$=-x^2$$ What is the domain for f ∘ g?
1) Start with the domain for g: $$g(x) = \sqrt{3 - x^2}$$ The radicand (3 - x2) must be non-negative. $$3 - x^2 ≥ 0$$ $${-}\sqrt{3} ≤ x ≤ \sqrt{3}$$ $$\text{Domain:} \hspace{.1em} \{x |{-}\sqrt{3} ≤ x ≤ \sqrt{3}\}$$ 2) Continue to the domain for f ∘ g: $$f(g(x)) = -x^2$$ Here, we have no additional restrictions. $$\text{Domain:} \hspace{.1em} \{x |{-}\sqrt{3} ≤ x ≤ \sqrt{3}\}$$

Evaluating Composite Functions

Evaluating a composite function is the process of calculating the specific output of that composite function for a given input. Let's look at an example.
Example #5: Find (f ∘ g)(2). $$f(x) = \frac{2}{x - 1}$$ $$g(x) = x^2$$ We want to find f(g(2)).
Find g(2) first: $$g(2) = 2^2 = 4$$ Now find f(4): $$f(4) = \frac{2}{4 - 1} = \frac{2}{3}$$ $$f(g(2)) = \frac{2}{3}$$ An alternative approach would be to find f(g(x)) first and then plug in a 2 for x. The result is the same. $$f(g(x)) = \frac{2}{x^2 - 1}$$ $$f(g(2)) = \frac{2}{4 - 1} = \frac{2}{3}$$

Decomposing Functions

So far, we have seen that when forming a composite function, we "compose" two functions to form a new function. In some cases, we will want to reverse this process. This involves "decomposing" a function, breaking it down into simpler functions expressed as a composition of two functions. We will see this process used often when studying Calculus. Let's look at an example.
Example #6: Write the function given by f ∘ g as a composition of two functions. $$f(g(x)) = 9x^2 - 12x + 4$$ While various methods can be employed for this task, a commonly intuitive approach often comes to mind initially. Let's factor: $$f(g(x)) = (3x - 2)^2$$ So one way to answer would be: $$f(x) = x^2$$ $$g(x) = 3x - 2$$ Although there are other answers that would be acceptable. For example, we could write our f(g(x)) in a different way. $$f(g(x)) = (3x - 2)^2$$ $$=\left[3\left(x - \frac{2}{3}\right)\right]^2$$ $$=3^2\left(x - \frac{2}{3}\right)^2$$ $$=9\left(x - \frac{2}{3}\right)^2$$ So another way to answer would be: $$f(x) = 9x^2$$ $$g(x) = x - \frac{2}{3}$$

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$$