Function composition

In mathematics, function composition is the construction of a function out of two others by taking the value or output of one function and using it as the argument or input to another function.

If f and g are functions, then we may evaluate the function g on an input x to produce an output y, written $$y = g(x)$$: we then take y as the input to f to produce a further output z, written $$z = f(y)$$. The composite function that takes the initial input x to the final output z is the composite function, written $$z = f(g(x))$$.

For function composition to make sense, the set of possible outputs of g must be a subset of the set of permissible inputs of f.

The chain rule in calculus describes the derivative of the composite of differentiable functions.