Sub topic 11
Composite Functions \(f(g(x))\)
Assume you know function notation, substitution, algebraic simplification, and domain restrictions. A composite function applies one function to the output of another function. The notation \(f(g(x))\) means “apply \(g\) first, then apply \(f\).”
How composition works
Suppose
\[ f(x)=2x+3 \]
and
\[ g(x)=x^2. \]
To find \(f(g(x))\), replace the input \(x\) in \(f(x)\) with the complete expression \(g(x)\):
\[ f(g(x))=f(x^2)=2x^2+3. \]
The order matters. In general, \(f(g(x))\) and \(g(f(x))\) are different functions.
def f(x):
return 2 * x + 3
def g(x):
return x ** 2
print(f(g(1))) # f(g(1)) = f(1) = 5
print(g(f(1))) # g(f(1)) = g(5) = 25The first calculation follows this path:
\[ 1 \xrightarrow{g} 1 \xrightarrow{f} 5. \]
The second follows:
\[ 1 \xrightarrow{f} 5 \xrightarrow{g} 25. \]
Finding the domain
The domain of a function is the set of allowed inputs. For \(f(g(x))\), two conditions must hold:
- \(x\) must belong to the domain of \(g\).
- The value \(g(x)\) must belong to the domain of \(f\).
For example, let
\[ f(x)=\sqrt{x} \quad\text{and}\quad g(x)=x-4. \]
Then
\[ f(g(x))=\sqrt{x-4}. \]
The square root requires its input to be non-negative:
\[ x-4\geq 0, \]
so the domain is \(x\geq4\).
The range is the set of outputs. Since a square root is never negative, the range of this composite function is \(y\geq0\).
Composition from formulas
For
\[ f(x)=\frac{1}{x-2} \quad\text{and}\quad g(x)=x+1, \]
we get
\[ f(g(x))=\frac{1}{(x+1)-2}=\frac{1}{x-1}. \]
The original function \(g\) accepts every real number, but \(f\) cannot accept the value \(2\). Therefore,
\[ g(x)\ne2, \]
which gives \(x\ne1\). Always check restrictions after substitution.
A reliable CAT method
When a question asks for a composite function:
- Write the outside function.
- Replace its input with the complete inside function.
- Use parentheses around the substitution.
- Simplify.
- Check the domain restrictions.
Exercise
Let f(x) = x + 5 and g(x) = 3x - 2. Find f(g(4)) and g(f(4)).
Show answer
g(4) = 10, so f(g(4)) = f(10) = 15. Also, f(4) = 9, so g(f(4)) = g(9) = 25. The values are different because composition order matters.