The idea behind composite functions is best explained with an example.
Let's think about the function given by $f\left(x\right)=2x+1$f(x)=2x+1. We understand that the function takes values of $x$x in the domain and maps them to values $y=2x+1$y=2x+1 in the range.
Suppose however that this is only the first part of a two-stage treatment of $x$x. We now take these function values and map them using another function, say $g\left(x\right)=x^2$g(x)=x2. This means that the $y$y values given by $\left(2x+1\right)$(2x+1) become the squared values $\left(2x+1\right)^2$(2x+1)2. The diagram below captures the idea.
The output, or function values, of the function $f\left(x\right)$f(x) have become the input, or $x$x values, of the function $g\left(x\right)$g(x). We can describe the complete two-stage process by the expression $g\left(f\left(x\right)\right)$g(f(x)). This is sometimes written as $(g\circ f)(x)$(g∘f)(x).
Algebraically, we can write $g\left(f\left(x\right)\right)=g\left(2x+1\right)=\left(2x+1\right)^2$g(f(x))=g(2x+1)=(2x+1)2.
Note that if we reversed the order of the two-stage processing, we would, in this instance, develop a different composite function. Here, $f\left(g\left(x\right)\right)=(f\circ g)(x)=f\left(x^2\right)=2\left(x^2\right)+1=2x^2+1$f(g(x))=(f∘g)(x)=f(x2)=2(x2)+1=2x2+1.
Using our understanding of function notation and evaluation, we are able to create and simplify the equations of composite functions as well as evaluate substitutions into them.
Consider the functions $f\left(x\right)=-2x-3$f(x)=−2x−3 and $g\left(x\right)=-2x-6$g(x)=−2x−6.
Find $f\left(7\right)$f(7).
Hence, or otherwise, evaluate $g\left(f\left(7\right)\right)$g(f(7)).
Now find $g\left(7\right)$g(7).
Hence, evaluate $f\left(g\left(7\right)\right)$f(g(7)).
Is it true that $f\left(g\left(x\right)\right)=g\left(f\left(x\right)\right)$f(g(x))=g(f(x)) for all $x$x?
Yes
No
Find the composite function $f\left(g\left(x\right)\right)$f(g(x)) given that $f\left(x\right)=\sqrt{x}$f(x)=√x and $g\left(x\right)=4x-3$g(x)=4x−3.
Consider the functions $f\left(x\right)=4x-6$f(x)=4x−6 and $g\left(x\right)=2x-1$g(x)=2x−1.
The function $r\left(x\right)$r(x) is defined as $r\left(x\right)=f\left(x^2\right)$r(x)=f(x2). Define $r\left(x\right)$r(x).
Using the results of the previous part, define $q\left(x\right)$q(x), which is $g\left(f\left(x^2\right)\right)$g(f(x2)).
If one, or all, of the functions involved in a composite function have restrictions on their input ($x$x) values, it is likely that this will affect the domain of the final function.
For example, think about the two functions $f\left(x\right)=3x-1$f(x)=3x−1 and $g\left(x\right)=\sqrt{x}$g(x)=√x.
$f\left(x\right)$f(x) represents a straight line and its domain covers all real $x$x. But we know that we can only take the square root of numbers greater than or equal to zero, so the domain of $g\left(x\right)$g(x) is restricted to $x\ge0$x≥0.
And so, $g\left(f\left(x\right)\right)$g(f(x)) can only be calculated if $f(x)$f(x) is greater than or equal to zero. Solving $f(x)\ge0$f(x)≥0 we get $x\ge\frac{1}{3}$x≥13 and this is the domain of the composite function $g\left(f\left(x\right)\right)$g(f(x)).
In general, the domain of a composite function is often the same as the domain of the function that lies within the other - that is, the domain of $f\left(x\right)$f(x) in a composite function $g\left(f\left(x\right)\right)$g(f(x)). Otherwise, it might be an even more restricted domain based on that of $f\left(x\right)$f(x).
On the other hand, the range of a composite function will lie within the range of the second function applied - that is, the $g\left(x\right)$g(x) when a composite function is defined as $g\left(f\left(x\right)\right)$g(f(x)).
Using our previous example, we know that $f(x)=3x-1$f(x)=3x−1 has a range of all real $y$y.
$g\left(x\right)=\sqrt{x}$g(x)=√x will only produce $y$y values that are positive, since $\sqrt{x}$√x is defined as the positive square root of $x$x.
So, the range of $g\left(f\left(x\right)\right)=\sqrt{3x-1}$g(f(x))=√3x−1is $y\ge0$y≥0. We can confirm the accuracy of our algebraic answer by looking at the diagram above.
As you would expect, the range of $f\left(g\left(x\right)\right)$f(g(x))will be different to the range of $g\left(f\left(x\right)\right)$g(f(x)). Since the range of the second function applied $f\left(x\right)$f(x) is all real $y$y, we might be expecting a larger range for the composite function. Using our algebraic skills, we can find that $f\left(g\left(x\right)\right)=3\sqrt{x}-1$f(g(x))=3√x−1. Working from the inside out, using our knowledge that the values that $\sqrt{x}$√x can take are greater than or equal to zero, and this would be the same for $3\sqrt{x}$3√x. the final step of subtracting $1$1 from every output value gives us a range of $y\ge-1$y≥−1 for our composite function $f\left(g\left(x\right)\right)$f(g(x)).
Let $f$f and $g$g be functions defined as follows:
$f\left(x\right)=\sqrt{x+3}$f(x)=√x+3, and
$g\left(x\right)=x^2-3$g(x)=x2−3
Find the composite function $(f\ \circ\ g)(x)$(f ∘ g)(x):
What is the domain of $(f\ \circ\ g)(x)$(f ∘ g)(x)?
$\left(-\infty,\infty\right)$(−∞,∞)
$\left(-\infty,\sqrt{3}\right)\cup\left(\sqrt{3},\infty\right)$(−∞,√3)∪(√3,∞)
$\left[-3,\infty\right)$[−3,∞)
$\left[0,\infty\right)$[0,∞)
Find the composite function $(g\ \circ\ f)(x)$(g ∘ f)(x):
What is the domain of $(g\ \circ\ f)(x)$(g ∘ f)(x)?
$\left(-\infty,\sqrt{3}\right)\cup\left(\sqrt{3},\infty\right)$(−∞,√3)∪(√3,∞)
$\left[3,\infty\right)$[3,∞)
$\left[-3,\infty\right)$[−3,∞)
$\left(-\infty,\infty\right)$(−∞,∞)
Consider the function $h\left(x\right)=\frac{1}{\left(x-8\right)^2}$h(x)=1(x−8)2.
Suppose that $g\left(x\right)=x-8$g(x)=x−8. Find $f\left(x\right)$f(x) such that $h(x)=\left(f\ \circ\ g\right)(x)$h(x)=(f ∘ g)(x).
Now suppose that $f\left(x\right)=\frac{1}{x}$f(x)=1x. Find $g\left(x\right)$g(x) such that $h(x)=\left(f\ \circ\ g\right)(x)$h(x)=(f ∘ g)(x).