A square garden is fenced with a known length of fence. The fence length tells you the side, and the side tells you the area. Two small rules run one after the other, and chaining them gives one rule that goes straight from fence length to area. That chaining is composition, and calculus uses it constantly, most of all in the chain rule.
Key terms
Output used as input
Definition Let and be functions and let be in the domain of . The output is a number, and if that number lies in the domain of , then can be evaluated at it, giving the number . If is not in the domain of , the second step is undefined for that .
In plain words The first function produces a number, and the second function treats that number as its own input.
Example Let and . Follow a few inputs through both steps.
Every middle value is visible, so you can see exactly where each final output came from.
Function composition
Definition The composition of with is the function , read ” composed with ” or ” of ”, given by
Its domain is the set of all in the domain of for which is in the domain of . The small circle is not multiplication. In general and are different numbers.
In plain words Apply first, then apply to the result. The function written on the right acts first.
Example With and ,
Here for every real , so is never and the composite is defined for all real numbers. Compare the product , which is a different function with domain .
Inner function
Definition In the composite , the function is the inner function. It is applied first, directly to , and its output is called the intermediate value. Writing a given formula as is called decomposing it. A formula can usually be decomposed in more than one way, and the useful choice is the one whose pieces are simple.
In plain words The inner function is the part that touches first, the expression sitting inside the parentheses, the radical or the exponent.
Example Take . The first thing done to is to compute , so a natural choice is the inner function with outer function . At the intermediate value is , and then .
Outer function
Definition In the composite , the function is the outer function. It is applied last, to the intermediate value . To form the composite formula, replace every occurrence of the input variable in the rule for by the whole expression , written inside parentheses so its grouping is kept.
In plain words The outer rule does not care what its input is called. Whatever you feed it goes into every slot where its variable appeared, wrapped in parentheses.
Example Let and . Each in the rule for becomes .
Dropping the parentheses would give , which is wrong. At the correct composite gives , and indeed .
Composite function
Definition The composite function is a single function in its own right, with one input, one output and its own domain. When a quantity depends on a quantity through , and depends on through , the composite expresses directly in terms of . The units must match along the chain, so the output unit of has to be the input unit that expects.
In plain words Once the two steps are merged you get one formula, yet you can still say what each piece measures.
Example A square has perimeter centimeters, with . All four sides are equal, so the side length in centimeters is
The area of a square with side centimeters is square centimeters. A squared length is an area, so the unit becomes square centimeters. The composite gives area from perimeter.
For the side is centimeters and the area is square centimeters, and the single formula agrees since . If the perimeter were measured in meters and the area rule expected centimeters, you would first have to convert.
Composite domain
Definition The domain of is
Both conditions are required. The domain is decided by the two original rules, not by how the final formula looks after simplifying.
In plain words An input is allowed only if the inner function accepts it and the outer function accepts what comes out.
Example Let and . The inner function needs . The outer function needs its input to differ from , so we need , which rules out . The composite
has domain . A simplified formula can hide a condition. With and the composite simplifies to , yet its domain is still , because is not a real number.
Order of composition
Definition Composition is generally not commutative. For most pairs of functions and have different formulas, and they can also have different domains and different outputs. The order of operations is read from the inside out, so in the function acts first.
In plain words Putting on socks and then shoes is not the same as shoes and then socks. Which function acts first matters.
Example Let and . Then
At the first gives and the second gives . Domains can differ too. With and , the composite has domain , while has domain .
Check yourself
- Let and . Find and , and evaluate both at .
Show the answer
Substituting the whole inner expression each time gives
At the first is and the second is , so the order changes the output.
- Let and . Find the domain of .
Show the answer
The inner function needs . The outer function needs , that is , which holds exactly when . The domain is .
- A circle has circumference centimeters, with . Write its area as a function of by composing the radius rule with the area rule, and find the area when .
Show the answer
The radius is centimeters and the area is square centimeters, so
For the area is square centimeters.