# Function Composition

## Key Questions

Yes

#### Explanation:

Given composable functions $f$, $g$ and $h$

$\left(f \circ \left(g \circ h\right)\right) \left(x\right)$

$= f \left(\left(g \circ h\right) \left(x\right)\right) = f \left(g \left(h \left(x\right)\right)\right) = \left(f \circ g\right) \left(h \left(x\right)\right)$

$= \left(\left(f \circ g\right) \circ h\right) \left(x\right)$

So $f \circ \left(g \circ h\right) = \left(f \circ g\right) \circ h$

If $g : A \to B$ and $f : B \to C$, then the domain of $f \circ g$ is

${\overline{g}}^{- 1} \circ {\overline{f}}^{- 1} \left(C\right)$

using the notation described below...

#### Explanation:

If $g$ is a function that maps some elements of a set $A$ to elements of a set $B$, then the domain of $g$ is the subset of $A$ for which $g \left(a\right)$ is defined.

More formally:

$g \subseteq A \times B :$

$\forall a \in A \forall {b}_{1} , {b}_{2} \in B$

$\left(\left(a , {b}_{1}\right) \in g \wedge \left(a , {b}_{2}\right) \in g\right) \implies {b}_{1} = {b}_{2}$

Use the notation ${2}^{A}$ to represent the set of subsets of $A$ and ${2}^{B}$ the set of subsets of $B$.

Then we can define the pre-image function:

${\overline{g}}^{- 1} : {2}^{B} \to {2}^{A}$ by ${\overline{g}}^{- 1} \left({B}_{1}\right) = \left\{a \in A : g \left(a\right) \in {B}_{1}\right\}$

Then the domain of $g$ is simply ${\overline{g}}^{- 1} \left(B\right)$

If $f$ is a function that maps some elements of set $B$ to elements of a set $C$, then:

${\overline{f}}^{- 1} : {2}^{C} \to {2}^{B}$ is defined by ${\overline{f}}^{- 1} \left({C}_{1}\right) = \left\{b \in B : f \left(b\right) \in {C}_{1}\right\}$

Using this notation, the domain of $f \circ g$ is simply

${\overline{g}}^{- 1} \left({\overline{f}}^{- 1} \left(C\right)\right) = \left({\overline{g}}^{- 1} \circ {\overline{f}}^{- 1}\right) \left(C\right)$

• To compose a function is to input one function into the other to form a different function. Here's a few examples.

Example 1: If $f \left(x\right) = 2 x + 5$ and $g \left(x\right) = 4 x - 1$, determine $f \left(g \left(x\right)\right)$

This would mean inputting $g \left(x\right)$ for $x$ inside $f \left(x\right)$.

$f \left(g \left(x\right)\right) = 2 \left(4 x - 1\right) + 5 = 8 x - 2 + 5 = 8 x + 3$

Example 2: If $f \left(x\right) = 3 {x}^{2} + 12 + 12 x$ and $g \left(x\right) = \sqrt{3 x}$, determine $g \left(f \left(x\right)\right)$ and state the domain

Put $f \left(x\right)$ into $g \left(x\right)$.

$g \left(f \left(x\right)\right) = \sqrt{3 \left(3 {x}^{2} + 12 x + 12\right)}$

$g \left(f \left(x\right)\right) = \sqrt{9 {x}^{2} + 36 x + 36}$

$g \left(f \left(x\right)\right) = \sqrt{{\left(3 x + 6\right)}^{2}}$

$g \left(f \left(x\right)\right) = | 3 x + 6 |$

The domain of $f \left(x\right)$ is $x \in \mathbb{R}$. The domain of $g \left(x\right)$ is $x > 0$. Hence, the domain of $g \left(f \left(x\right)\right)$ is $x > 0$.

Example 3: if $h \left(x\right) = {\log}_{2} \left(3 {x}^{2} + 5\right)$ and $m \left(x\right) = \sqrt{x + 1}$, find the value of $h \left(m \left(0\right)\right)$?

Find the composition, and then evaluate at the given point.

$h \left(m \left(x\right)\right) = {\log}_{2} \left(3 {\left(\sqrt{x + 1}\right)}^{2} + 5\right)$

$h \left(m \left(x\right)\right) = {\log}_{2} \left(3 \left(x + 1\right) + 5\right)$

$h \left(m \left(x\right)\right) = {\log}_{2} \left(3 x + 3 + 5\right)$

$h \left(m \left(x\right)\right) = {\log}_{2} \left(3 x + 8\right)$

$h \left(m \left(2\right)\right) = {\log}_{2} \left(3 \left(0\right) + 8\right)$

$h \left(m \left(2\right)\right) = {\log}_{2} 8$

$h \left(m \left(2\right)\right) = 3$

Practice exercises

For the following exercises: $f \left(x\right) = 2 x + 7 , g \left(x\right) = {2}^{x - 7} \mathmr{and} h \left(x\right) = 2 {x}^{3} - 4$

a) Determine $f \left(g \left(x\right)\right)$

b) Determine $h \left(f \left(x\right)\right)$

c) Determine $g \left(h \left(2\right)\right)$

Hopefully this helps, and good luck!