Composite functions
In a nutshell
Composite functions consist of two or more functions combined. The output of one function is used as the input of another function. The order of the functions matters. fg(x) means to apply g first, then f.
f(g(x))=fg(x)=gf(x)
Composite functions
A composite function takes an input x and applies two functions to the input, one after another. In this way, two or more functions can be chained to create more complex ones. The output result of the composite function depends on the order of the composition.
When given two functions like f(x)=2x and g(x)=x2, there are two possible compositions:
- f(g(x))=f(x2)=2x2
- g(f(x))=g(2x)=(2x)2=4x2
Examples
Given f(x)=x2+1 and g(x)=2x+2, find:
a) fg(x)
b) gf(x)
c) ff(x)
a) Find fg(x) by substituting g into f:
fg(x)=f(2x+2)=(2x+2)2+1=4x2+4x+4+1=4x2+4x+5
b) Substitute f into g:
gf(x)=g(x2+1)=2(x2+1)+2=2x2+2+2=2x2+4
c) Substitute f into f:
ff(x)=f(x2+1)=(x2+1)2+1=x4+2x2+1+1=x4+2x2+2