H2 Maths Formulas, Techniques & Graphs >> Functions and Graphs >> Functions >>
Conditions for Composite Function to Exist
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,
\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}
More on Functions:
Functions
Inverse function
Composite functions
Other concepts (on Functions)