Chapter 2 — Functions
2.6 — Algebra and Composition of Functions
Adding two functions combines their values; composing them combines their processes.
Section 2.5 obtained new functions by deforming a single function. This section explores another route: combining two functions. There are two ways of doing it, and it is worth distinguishing them from the start. The first, with addition, subtraction, multiplication and division, operates on the output values, and extends the algebra of from §1.1. The second, composition, operates on the process: it uses the output of one function as the input of the other, and it has, as we will see, a different nature.
§1. Arithmetic operations between functions
Section titled “§1. Arithmetic operations between functions”Given two functions and , each operation of extends pointwise: at each where both are defined, one operates with the numbers and .
Each of these definitions requires and to exist at the same time: it makes no sense to add two values if one of them is not defined. That is why the domain of each operation is not declared separately, but deduced from that requirement:
where is the intersection of §1.1, the set of common elements. The quotient also requires, as in §2.2, that the denominator not vanish:
Example. Let , with domain by §2.4, and , with domain by §2.2. Then
The value is excluded not because some numerator vanishes, but because is not defined there; the intersection of domains rules it out before the sum is formed.
The domain of a combination is decided by the domains of the parts, not by the simplified formula of the result. If and , the sum equals at each point, but its domain is , not : it is the zero function restricted to , in the sense of §2.2, and not the zero function on .
§2. Composition of functions
Section titled “§2. Composition of functions”There is a way of combining two functions that is not arithmetic: using the output value of one as the input value of the other. This operation, the most important of the section and one of those Calculus uses most, is called composition.
Definition. Let and be two functions. The composition of with , written and read ” composed with ”, is the function defined by
for every such that and, moreover, .
Let us note the order of the notation: in , , the function on the right, is applied first, and then . The second condition is the one that demands the most care. It is not enough for to be in the domain of : in addition, the value that produces at that point, and not itself, must be admissible for . The domain of the composition is therefore
By the form of this definition, : the composition never has a larger domain than that of , and it may have a smaller one.
Figure 2.4 — An element of whose image under falls outside is excluded from , even though it belongs to .
Example. Let , with domain , and , with domain . Then , and its domain is not , that of , but
It is the same result the analysis of §2.2 gives when applied to the formula , obtained here from the structure of the composition. That the two routes agree is no accident: it is what authorizes us to treat as the composition of two simpler pieces.
§3. Associativity and lack of commutativity
Section titled “§3. Associativity and lack of commutativity”Addition and multiplication of functions inherit from the commutativity of §1.1, because at each point. Composition does not have this property: in general, , and the two compositions may differ in their values, in their domains, or one of them may not even be defined.
Example. With the functions of §2, and , we already saw that , with domain . On the other hand, , with domain , that of , because imposes no restrictions. The two compositions have different formulas and different domains. The first is never negative, whereas the second is: for example, .
The asymmetry is not surprising if one thinks of composition as what it is: a chain process, where the order of the stages matters. Subtracting and then taking the square root is not the same as taking the root and then subtracting , just as putting on socks and then shoes is not the same as doing it the other way around.
Composition does have another property of the operations of : it is associative.
Proposition. If , and are functions, then .
Proof. Let us look at the domains first. A number is in the domain of if and , that is, if , and . On the other hand, is in the domain of if and , that is, if , and . They are the same three conditions, and the domains coincide. At each of those points, both functions equal .
Thanks to associativity we can write without parentheses: either way of grouping it gives the same function, which applies , then and finally .
§4. Decomposition into elementary functions
Section titled “§4. Decomposition into elementary functions”The relation between and its two pieces, and , suggests an operation inverse to composition: given a function built from several chained operations, identifying the pieces. This decomposition follows no single algorithm, but it does follow a principle of order: the outermost piece, which is the last operation one would apply when computing a value by hand, is the one written first, on the left, in the composition.
Example. Let . To compute by hand, the order of the operations is: add , square, and finally take the reciprocal. If , and , the last two from the catalog of §2.4, then
The order of computation goes from the inside out, and the notation records it from the outside in. The domains also agree: is always in the domain of , and is in the domain of if and only if it is nonzero, that is, if , which is precisely the implicit domain of .
The decomposition is not unique. The square and the reciprocal could also be gathered into a single function, , giving with only two pieces. That lack of uniqueness is not a defect: different decompositions serve different purposes, and how finely to decompose depends on what one wants to do with .
The operations of this section complete, in a sense, a toolkit for building functions: §2.5 showed how to deform one, and this section how to combine several. But the two ideas are closer than they seem. The transformations of §2.5 are particular compositions: is the composition of with two functions of the form , one applied before, , and another after, . Deforming a graph is composing with linear functions, and that is why it preserves the shape of the prototype. Composing with arbitrary functions, on the other hand, can produce an object whose behavior is no longer recognizable in any of its pieces: it is the construction of a new complexity from simple blocks, with no need for any symbol that did not already exist in them.
Among all the functions that can be built by composition, there is one case that deserves attention of its own: the one in which the composition can be undone, recovering the input from the output. That reversibility, and the inverse function that makes it possible, is the topic of the next section.
Copyright © 2026 Carlos Dagorret — Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)