In mathematics, function composition is the application of one function to the results of another. For instance, the functions f: X → Y and g: Y → Z can be composed by computing the output of g when it has an argument of f(x) instead of x. Intuitively, if z is a function g of y and y is a function f of x, then z is a function of x. Thus one obtains a composite function g ∘ f: X → Z defined by (g ∘ f )(x) = g(f) for all x in X.