You can do things in a row.
You can do things in a row.
In math, a function is a rule. It takes an input and gives an output. Sometimes, you can link two rules together. This is called function composition.
Think of it like a chain of steps. You use the first rule to get an answer. Then, you use that answer as the input for the second rule. For example, a plane's height changes with time. Air pressure also changes with height. You can link these rules. This tells you the air pressure at a specific time.
Order is very important. Doing the steps in a different order can change the result. This is why composition is not always commutative. Commutative means the order does not matter. But for most functions, it does.
You can even use the same rule many times in a row. This is called iteration. If you use a rule twice, it is like a functional square. Mathematicians use these chains to study complex patterns. They help us understand how things change over time.
In mathematics, a function is a rule that turns an input into an output. Sometimes, we can link two different rules together to form a single chain. This process is called function composition.
Think about how rules work in the real world. Imagine an airplane flying through the sky. We can have one rule that tells us the plane's altitude at a certain time. We can have another rule that tells us the air pressure at a specific altitude. By composing these two rules, we find the air pressure around the plane at a specific time.
Mathematicians have studied these patterns for a long time. People like Hans Heinrich Bürmann and John Frederick William Herschel helped describe how to use the same rule many times in a row. This is called function iteration.
There are many special rules that apply to these chains. One important rule is called associativity. This means that if you have three functions, it does not matter how you group them.
Function composition is used in many different fields. Computer scientists use it when writing code in many programming languages.
Function composition is a mathematical operation that combines two separate functions to create a new, single function. In this process, the output of one function becomes the input for the next. This creates a chain of operations where each step depends on the result of the previous one. If we have two functions, $f$ and $g$, the composite function is often written as $f \circ g$. When we evaluate this at an input $x$, we first apply $g$ to $x$ and then apply $f$ to that result. This creates a sequence where the functions act one after another.
To understand how this mechanism works, imagine a sequence of transformations. The first function takes an initial value and produces a new value. This new value must belong to the domain of the second function for the composition to be valid. In a strict mathematical sense, the codomain of the first function should be the same as the domain of the second. However, it is also acceptable if the first codomain is a subset of the second. Mathematicians sometimes restrict the domain of the first function to ensure every result fits into the second function's required input range.
Function composition follows several important mathematical rules and properties. One primary property is associativity. This means that if you are composing three functions, $f$, $g$, and $h$, the grouping does not change the final result. Specifically, $(f \circ g) \circ h$ is equal to $f \circ (g \circ h)$. Because of this, mathematicians often omit parentheses entirely. Another key concept is commutativity, which refers to whether the order of the functions matters. Unlike addition or multiplication, function composition is not generally commutative. This means that $f \circ g$ is often not the same as $g \circ f$.
Specific types of functions behave in predictable ways when they are composed. For example, the composition of two one-to-one functions, also known as injective functions, is always one-to-one. Similarly, the composition of two onto functions, or surjective functions, will always be onto. If both functions are bijections—meaning they are both one-to-one and onto—their composition is also a bijection. This property is vital in the study of permutations and group theory. In these fields, mathematicians look at how sets of functions can be combined to form complex structures.
History and notation have evolved alongside these ideas. The concept of using a function repeatedly is called function iteration. This is sometimes written as $f^n$, representing the $n$-th functional power. The notation for these functional powers was introduced by mathematicians Hans Heinrich Bürmann and John Frederick William Herschel. Iteration is a fundamental part of studying dynamical systems and fractals. In more advanced calculus, the derivatives of composed functions are calculated using the chain rule. For even more complex, higher-order derivatives, mathematicians use Faà di Bruno's formula.
In higher mathematics, composition is used to build algebraic structures called monoids and groups. If you have a set of transformations that share the same domain and codomain, you can form chains of these transformations. These chains form a transformation monoid. If the transformations are all bijective, they form a transformation group, which is also called a permutation group. A famous result known as Cayley's theorem states that any group is actually a subgroup of a symmetric group. This connects the abstract idea of a group to the concrete idea of composing permutations.
Function composition also extends into the realm of multivariate functions. A multivariate function is a rule that takes multiple inputs at once. In partial composition, one of the arguments of a function is replaced by another function. This is a more general version of the standard composition used with single-variable functions. This concept is important in computer engineering and in the study of primitive recursive functions. It allows for the creation of highly complex logical and mathematical systems by layering simple rules upon one another.
🖼️ Images & Media (3)
More to explore
✨ What else?
Related topics you might enjoy
🔬 Go deeper
More advanced topics to explore
🪜 Step back
Simpler topics to build understanding
What is Nepedia?
A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.