Notes
A composition of functions occurs when the output of one function is used as the input of another function. For example, suppose a function g is applied to an input x to create an output g(x). Then another function f is applied to g(x) to create an output f(g(x)). Thinking of this as a single process, we have a new function h applied to an input x to create an output h(x), where the function h is “f composed with g,” which we write [latex]f\circ g[/latex].
If the order the functions are composed is reversed, we obtain a different composition of functions, [latex]g\circ f[/latex]. Here the function g is applied to the output of function f.
Example 1
- [latex]f(x)=x+2[/latex] and [latex]g(x)=\sqrt{x}[/latex].
- [latex](f\circ g)(x)=f(g(x))=f(\sqrt{x})=\sqrt{x}+2[/latex].
- [latex](g\circ f)(x)=g(f(x))=g(x+2)=\sqrt{x+2}[/latex]. Note that [latex](f\circ g)(x)\neq (g\circ f)(x)[/latex].
Example 2
- [latex]f(x)=x^2[/latex] and [latex]g(x)=\frac{1}{x}[/latex].
- [latex](f\circ g)(x)=f(g(x))=f\left(\frac{1}{x}\right)=\left(\frac{1}{x}\right)^2=\frac{1}{x^2}[/latex].
- [latex](g\circ f)(x)=g(f(x))=g(x^2)=\frac{1}{x^2}[/latex]. In this case, [latex](f\circ g)(x)=(g\circ f)(x)[/latex].
Example 3
- [latex]f(x)=\frac{2}{x}-3[/latex] and [latex]g(x)=\frac{4}{x+1}[/latex].
- [latex](f\circ g)(x)=f(g(x))=f\left(\frac{4}{x+1}\right)=\frac{2}{4/(x+1)}-3=\frac{x-5}{2}[/latex].
- [latex](g\circ f)(x)=g(f(x))=g\left(\frac{2}{x}-3\right)=\frac{4}{(2/x)-3+1}=\frac{2x}{1-x}[/latex].
Decomposing a function
It is sometimes possible to decompose a function into the composition of two functions.
Example 4
- [latex]h(x)=\sqrt{x^2-1}+1[/latex].
- Let [latex]f(x)=\sqrt{x}+1[/latex] and [latex]g(x)=x^2-1[/latex].
- Then [latex](f\circ g)(x)=f(g(x))=f(x^2-1)=\sqrt{x^2-1}+1[/latex], as required.
- Alternatively, [latex]f(x)=\sqrt{x-1}+1[/latex] and [latex]g(x)=x^2[/latex] would work too.
Video Tips
Practice Exercises
Drag and drop the functions into the correct places. Note that some functions don’t belong anywhere.