In mathematics, a function is a relation between sets that associates to every element of a first set exactly one element of the second set. Typical examples are functions from integers to integers or from the real numbers to real numbers.A composite function g(f(x)) can be visualized as the combination of two 'machines'.A simple example of a function compositionAnother composition. In this example, (g ∘ f )(c) = #. In mathematics, a function is a relation between sets that associates to every element of a first set exactly one element of the second set. Typical examples are functions from integers to integers or from the real numbers to real numbers. Functions were originally the idealization of how a varying quantity depends on another quantity. For example, the position of a planet is a function of time. Historically, the concept was elaborated with the infinitesimal calculus at the end of the 17th century, and, until the 19th century, the functions that were considered were differentiable (that is, they had a high degree of regularity). The concept of function was formalized at the end of the 19th century in terms of set theory, and this greatly enlarged the domains of application of the concept. A function is a process or a relation that associates each element x of a set X, the domain of the function, to a single element y of another set Y (possibly the same set), the codomain of the function. If the function is called f, this relation is denoted y = f (x) (read f of x), the element x is the argument or input of the function, and y is the value of the function, the output, or the image of x by f. The symbol that is used for representing the input is the variable of the function (one often says that f is a function of the variable x). A function is uniquely represented by the set of all pairs (x, f (x)), called the graph of the function. When the domain and the codomain are sets of numbers, each such pair may be considered as the Cartesian coordinates of a point in the plane. In general, these points form a curve, which is also called the graph of the function. This is a useful representation of the function, which is commonly used everywhere. Functions are widely used in science, and in most fields of mathematics. Their role is so important that it has been said that they are 'the central objects of investigation' in most fields of mathematics. Intuitively, a function is a process that associates to each element of a set X a single element of a set Y. Formally, a function f from a set X to a set Y is defined by a set G of ordered pairs (x, y) such that x ∈ X, y ∈ Y, and every element of X is the first component of exactly one ordered pair in G. In other words, for every x in X, there is exactly one element y such that the ordered pair (x, y) belongs to the set of pairs defining the function f. The set G is called the graph of the function. Formally speaking, it may be identified with the function, but this hides the usual interpretation of a function as a process. Therefore, in common usage, the function is generally distinguished from its graph. Functions are also called maps or mappings, though some authors make some distinction between 'maps' and 'functions' (see section #Map). In the definition of function, X and Y are respectively called the domain and the codomain of the function f. If (x, y) belongs to the set defining f, then y is the image of x under f, or the value of f applied to the argument x. Especially in the context of numbers, one says also that y is the value of f for the value x of its variable, or, still shorter, y is the value of f of x, denoted as y = f(x). Two functions f and g are equal if their domain and codomain sets are the same and their output values agree on the whole domain. Formally, f = g if f(x) = g(x) for all x ∈ X, where f:X → Y and g:X → Y.