What Is a Composite Function?
What Is a Composite Function?
A composite function is a function of a function.
A composite function combines two or more functions so that the output of one function becomes the input of another.
Imagine a function f that relates an input x to an output f(x). The output is passed into another function g, which relates it to an output gf(x).
The composite function gf relates the input x straight to the output gf(x).
The composite function is denoted gf(x), (g ∘ f)(x) or g(f(x)).
A Real Example of a Composite Function
It is easier to understand composite functions with an example.
f(x) = 2x and g(x) = x + 1
Consider two functions:
f(x) = 2x
g(x) = x + 1

The function f(x) = 2x takes each input and doubles it.

The function g(x) = x + 1 takes each input and adds 1 to it.
The mapping diagrams below show these functions.
The Composite Function gf(x)
Now let's consider the composite function of f(x) = 2x and g(x) = x + 1.

The function f relates an input x to an output 2x (it doubles the input).

The output 2x is the input of the function g, which relates it to an output 2x + 1 (it adds 1 to the input).
The mapping diagram below shows this.
The composite of f(x) = 2x and g(x) = x + 1 is:
The Order of Composite Functions Matter
In the example above, the output of f(x) became the input of g(x). The composite function was gf(x) = 2x + 1.
Consider what happens if the output of g(x) became the input of f(x).

The function g relates an input x to an output x + 1 (it adds 1 to the input).

The output x + 1 is the input of the function f, which relates it to an output 2(x + 1) (it doubles the input).
The mapping diagram below shows this.
The composite of g(x) = x + 1 and f(x) = 2x is:
fg(x) is not the same as gf(x). The order of the functions matter.
gf(x) ≠ fg(x)