5F

Composite functions

Form composite functions f(g(x)) and g(f(x)), evaluate them, and find the domain and range of a composite.

One function after another

A feeds the output of one function into another. In $f(g(x))$, apply $g$ first, then apply $f$ to the result. It is also written $f \circ g$.

Example 1●

If $f(x) = x^2$ and $g(x) = x + 3$, find $f(g(2))$ and $g(f(2))$.

$f(g(2)) = f(5) = 25$
Inside first: g(2) = 5.
$g(f(2)) = g(4) = 7$
Now f first: f(2) = 4.
Example 2●●

With the same $f$ and $g$, find $f(g(x))$ and $g(f(x))$ as expressions.

$f(g(x)) = (x + 3)^2 = x^2 + 6x + 9$
Replace the x in f with the whole of g(x).
$g(f(x)) = x^2 + 3$
These are different, so order matters.
Different graphs: one is shifted left 3, the other up 3.
f(g(x)) versus g(f(x))

f squares, g adds a number. Doing g first shifts sideways; doing f first shifts up.

Try this

Is there any value of the added number for which the two graphs are the same?

Domain and range of a composite

For $f(g(x))$ to exist, $x$ must be in the domain of $g$, and $g(x)$ must be in the domain of $f$.

Example 3●●●

Let $f(x) = \sqrt{x}$ and $g(x) = 4 - x^2$. Find the domain and range of $f(g(x))$.

$f(g(x)) = \sqrt{4 - x^2}$
Need $4 - x^2 \ge 0$, so the domain is $-2 \le x \le 2$.
The output of g must be allowed into the square root.
Range $0 \le y \le 2$. It is the upper semicircle of radius $2$.
4 − x² runs from 0 to 4 on that domain, and √ of that runs from 0 to 2.
Flashcards
f(g(x))
Apply $g$ first, then $f$.
Is f(g(x)) = g(f(x))?
Usually not. Order matters.
Domain of f(g(x))
$x$ in the domain of $g$, with $g(x)$ in the domain of $f$.
Practice
  1. If $f(x) = 2x + 1$ and $g(x) = x^2$, find $f(g(\sqrt{5}))$.

  2. With the same functions, find $g(f(3))$.

  3. If $f(x) = x - 4$ and $g(x) = 3x$, then $f(g(x)) =$

  4. And $g(f(x)) =$

  5. $f(x) = \sqrt{x}$ and $g(x) = x - 1$. The domain of $f(g(x))$ is:

  6. $f(x) = \dfrac{1}{x}$ and $g(x) = x + 2$. Where is $f(g(x))$ undefined?

  7. If $f(x) = x^2 + 1$, find $f(f(1))$.

  8. Which pair of functions gives $f(g(x)) = g(f(x))$ for all $x$?

More questions

New numbers every time. Keep going until you get five in a row.

Formula sheet