Composite functions
A composite function is one obtained by applying one function, such as \(f\left(x\right)\), to the output of another, such as \(g\left(x\right)\). Composite functions are an essential concept in mathematics, particularly in the study of functions and their behaviour. It plays a significant role in understanding how functions interact and how their properties, such as domain and range, are affected when combined. To ensure a composite function exists, it is crucial to check that the range of the inner function lies within the domain of the outer function.
Use this page to revise the following concepts within composite functions:
Definition of composite functions and notation
The process of combining functions so that the output of one function becomes the input of another is known as a composition of functions. The resulting function is known as a composite function.
To indicate function \(f\) composed with function \(g, f \circ g\) is written and read as ‘\(f\) composed with \(g\)’. This composition is defined by the rule:
\[(f \circ g)(x) = f(g(x))\]
To indicate function g composed with function \(f, g \circ f\) could be written and read as ‘\(g\) composed with \(f\)’. This composition is defined by the rule:
\[(g \circ f)(x) = g(f(x))\]
Since \(f \circ g\) and \(g \circ f\) are different functions, in many cases, \(f(g(x)) \neq g(f(x))\).
Worked Example
Given \(f(x) = x + 4\) and \(g(x) = x^{2} - 2x\), find \((f \circ g)(x)\) and \((g \circ f)(x)\)
Solution:
\[(f \circ g)(x) = f(g(x))\]
We first apply \(g\) to \(x\):
Then we substitute this into \(f\); that is, whenever we see \(x\) in \(f\left(x\right) = x + 4\), we replace it with \(g\left(x\right) = x^2 - 2x\)
\[(f \circ g)(x) = f(g(x)) = g(x) + 4 = x^2 - 2x + 4\]
\[(g \circ f)(x) = g(f(x))\]
Similarly, we begin by computing \(f(x)\), and then replacing all cases of \(x\) in \(g\left(x\right) = x^2 - 2x\) with \(f(x)\).
\[(g \circ f)(x) = g(f(x)) = (x + 4)^2 - 2(x +4) = x^2 + 6x +8\]
The existence of a composite function
Given two functions, \(f(x)\) and \(g(x)\), to ensure \(\left(f \circ g\right)\left(x\right)\) is defined, the range of the inner function \(g(x)\) should lie within the domain of the outer function \(f(x)\). If \(\left(g \circ f\right)\left(x\right)\) exists, then the range of the inner function \(f(x)\) should lie within the domain of the outer function \(g(x)\).
To determine the existence of a composite function, it is useful to form a table of domains and ranges of \(f(x)\) and \(g(x)\) to see if the range of the inner function lies within the domain of the outer function.
In addition, the domain of the composite function \(f\left(g\left(x\right)\right)\) is the domain of the inner function \(g(x)\). The domain of the composite function \(g\left(f\left(x\right)\right)\) is the domain of the inner function \(f(x)\).
\[\begin{align}&dom \left(f \circ g\right)\left(x\right) = dom\ g \\ &dom \left(g \circ f\right)\left(x\right) = dom\ f\end{align}\]
The range of the composite function is dependent on the range of the outer function, and it is a bit harder to identify as it may also be affected by the domain of the inner function.
Worked Example
For the functions
\[\begin{align}f(x) = \sqrt{x}, x \geq 0 \\ g(x) = 2x - 1, x \in \mathbb{R}\end{align}\]
determine whether \(f \circ g\) and \(g \circ f\) are defined or not, stating the domain and range of the defined composite function.
Solution:
| Functions | Domain | Range |
|---|---|---|
| \(f(x)\) | \([0,\infty)\) | \([0,\infty)\) |
| \(g(x)\) | \(\mathbb{R}\) | \(\mathbb{R}\) |
For \(f \circ g\), tha range of \(g(x)\) is \(\mathbb{R}\). This does not lie within the domain of \(f(x)\) which is \([0,\infty)\). Therefore, \(f(g\left(x)\right)\) is not defined.
For \(g \circ f\) the range of \(f(x)\) is \([0,\infty)\) which lies within (also known as a subset denoted by \(\subseteq\)) the domain of \(g(x)\), which is \(\mathbb{R}\). Therefore, \(g(f(x))\) is defined.
The domain of composite function \(g(f(x))\) is the domain of \(f(x)\) which is \([0,\infty)\). The range of \(g(f\left(x\right))\) is \([-1,\infty)\) since the smallest value of \(x\) is 0, making the smallest value of \(g(x) = 1\). Therefore, the range includes all values greater than or equal to -1.
Given that \(f \circ g\) is undefined in the previous worked example, restricting the inner function \(g(x)\) could ensure \(f \circ g\) existed. If \(g \circ f\) is undefined, then restrict the inner function \(f(x)\) to make \(g \circ f\) existed.
Worked Example
For the functions
\[\begin{align}&f(x) = x^2 - 1, x \in \mathbb{R} \\ &g(x) = \sqrt{x}, x \geq 0\end{align}\]
state why \(g \circ f\) is undefined, and define a restriction \(f^\ast\) of \(f\) such that \(g \circ f^\ast\) will be defined and find the rule of \(g \circ f^\ast\).
Solution
State the domain and range of \(f(x)\) and \(g(x)\) in a table.
| Functions | Domain | Range |
|---|---|---|
| \(f(x)\) | \(\mathbb{R}\) | \([-1, \infty)\) |
| \(g(x)\) | \([0, \infty)\) | \([0, \infty)\) |
Since the range of \(f [-1, \infty)\) is not a subset of the domain of \(g(x) [0 ,\infty),\ g \circ f\) is undefined. For the range of \(f^{\ast}\) to be a subset of \([0, \infty)\), the domain of \(f\) must be restricted to be all real values less than or equal to -1 or greater than or equal to 1.
\(x^{2} - 1 = 0\)
\(x = -1\) or \(1\)
Thus, the restriction \(f^{\ast}\) is \(f^{\ast}: (-\infty,-1] \rightarrow \mathbb{R}, f^{\ast} = x^{2} - 1\)
The composite function \((g \circ f^{\ast})(x) = \sqrt{x^{2} - 1}, x \in (-\infty,-1] \cup [1,\infty)\)