Changing the Order and Grouping of Functions
Function composition applies functions in sequence. The examples below show how changing the order can change the result, while changing only the grouping does not:
Their domains are:
Composition Is Not Commutative
In a composition, each function receives the output of the function to its right. Reversing the order therefore usually produces a different composite function.
In general, is not equal to .
Example:
Compare and .
-
Calculating :
-
Calculating :
The two polynomial expressions have different coefficients, so they are not the same function. A single input also gives a direct counterexample:
The counterexample proves that as functions. Other pairs must be checked in the same way. Composition is not commutative in general.
Associative Property
If three functions have compatible domains and codomains, changing only the grouping does not change the result. The order of the functions must remain the same, and both sides are compared on inputs for which the compositions are defined.
Mathematically, for functions , , and , the following holds:
We may first form and then compose that function with , or first form and then compose with the result. On any input for which both sides are defined, both expressions apply , then , then .
Example:
Check if .
-
Calculating :
We already know .
-
Calculating :
First, find :
Now, compose with this result:
Since both results are the same () for , the associative property holds on their common domain: .
This associative property also applies to other combinations of function order, such as and .
Identity Element
An identity function maps every element of a set to itself. For , let be the identity on and the identity on .
Composing with the identity for the matching set leaves unchanged:
Example:
With and :
Both result in the function again.