H2 Maths Formulas, Techniques & Graphs >> Functions and Graphs >> Functions >>

Conditions for Composite Function to Exist

g - f (map).png

For the composite function fg to exist,

$$ \boxed{ R_g \subseteq D_f } $$

Example

Given $$ f: x \mapsto e^x, \phantom{000} x \in \mathbb{R}, 0 < x \le 1 $$ $$ g : x \mapsto x^2 - 2x - 2, \phantom{000} x \in \mathbb{R}, 1 \le x \le 4 $$

Graphing both functions,

Function f.png
Function g.png

\begin{align} D_f & = (0, 1] , \phantom{.} R_f = (1, e] \\ \\ D_g & = [1, 4] , \phantom{.} R_g = [-3, 6] \end{align}

Composite function fg

$$ \text{Since } R_g \nsubseteq D_f, \phantom{.} fg \text{ does not exist} $$

Composite function gf

$$ \text{Since } R_f \subseteq D_g, \phantom{.} gf \text{ exists} $$

Defining gf \begin{align} gf(x) & = g (e^x) \\ & = (e^x)^2 - 2(e^x) - 2 \\ & = e^{2x} - 2e^x - 2 \\ \\ gf : x \mapsto & \phantom{.} e^{2x} - 2e^x - 2, \phantom{000} x \in \mathbb{R}, 0 < x \le 1 \end{align}