Composite functions
Form composite functions f(g(x)) and g(f(x)), evaluate them, and find the domain and range of a composite.
Many functions are built by doing one thing and then another: add $3$, then square. Writing them as a composite of two simpler functions makes them easier to graph now and to differentiate later, since the chain rule in calculus is all about composites.
One function after another
Let $g(x) = x + 3$ and $f(x) = x^2$. Put $2$ into $g$ to get $5$, then put $5$ into $f$ to get $25$. We write this as $f(g(2)) = 25$: the inside function acts first.
$f(x) = x^2$ and $g(x) = x + 3$. Find $f(g(x))$ and $g(f(x))$.
f squares, and g(x) = x + s adds s. It starts on Example 1, with s = 3.
- Describe each graph as a transformation of $y = x^2$. Which composite shifts the parabola sideways, and which shifts it up?
- Is there a value of $s$ that makes the two composites the same?
This is the link with 5A: adding inside the function, $f(x + 3)$, is a horizontal shift, while adding outside, $f(x) + 3$, is a vertical shift. Multiplying inside or outside gives the dilations of 5D.
$f(x) = 2^x$ and $g(x) = 3x - 1$. Find $f(g(x))$, $g(f(x))$ and $f(g(1))$.
Domain and range of a composite
An $x$ is allowed in $f(g(x))$ only if $x$ is in the domain of $g$ and $g(x)$ is in the domain of $f$.
$f(x) = \sqrt x$ and $g(x) = 4 - x^2$. Find the domain and range of $f(g(x))$ and of $g(f(x))$.
Your turn
$f(x) = 2x - 1$ and $g(x) = x^2$. Solve $f(g(x)) = g(f(x))$.
Show the working
$f(g(x)) = 2x^2 - 1$ and $g(f(x)) = (2x - 1)^2 = 4x^2 - 4x + 1$. Setting them equal: $0 = 2x^2 - 4x + 2 = 2(x - 1)^2$, so $x = 1$. Check: $f(g(1)) = f(1) = 1$ and $g(f(1)) = g(1) = 1$.
$f(x) = 2x + 1$ and $g(x) = x^2$. Find $f(g(3))$.
$g(3) = 9$, then $f(9) = 19$.
$f(x) = 2x + 1$ and $g(x) = x^2$. Find $g(f(3))$.
$f(3) = 7$, then $g(7) = 49$.
$f(x) = x^2$ and $g(x) = x + 3$. Then $f(g(x)) =$
$g$ acts first, giving $x + 3$, which is then squared.
$f(x) = x^2$ and $g(x) = x + 3$. Then $g(f(x)) =$
$f$ acts first, giving $x^2$, and then $g$ adds $3$.
$f(x) = 2^x$ and $g(x) = 3x - 1$. Find $f(g(1))$.
$g(1) = 2$, then $f(2) = 2^2 = 4$.
$f(x) = 3x - 5$. Find $f(f(2))$.
$f(2) = 1$, then $f(1) = 3 - 5 = -2$.
$f(x) = \sqrt x$ and $g(x) = 4 - x^2$. The domain of $f(g(x))$ is:
$f(g(x)) = \sqrt{4 - x^2}$ needs $4 - x^2 \ge 0$, so $-2 \le x \le 2$.
$f(x) = x - 4$. Then $f(f(x)) = x - k$. Find $k$.
$f(f(x)) = (x - 4) - 4 = x - 8$. Doing a shift of $4$ twice is a shift of $8$.
Exam style: $f(x) = x^2 - 1$ and $g(x) = x + 2$. Solve $f(g(x)) = g(f(x))$.
$(x + 2)^2 - 1 = x^2 + 4x + 3$ and $x^2 - 1 + 2 = x^2 + 1$. So $4x + 3 = 1$ and $x = -0.5$.
Exam style: $f(x) = \dfrac{1}{x - 1}$. Apart from $x = 1$, which value of $x$ must be excluded from the domain of $f(f(x))$?
The outer $f$ needs its input $f(x) \ne 1$. Solving $\dfrac{1}{x - 1} = 1$ gives $x - 1 = 1$, so $x = 2$ must be excluded.
Coaching Centre