# Function (mathematics)

"f(x)" redirects here. Function (mathematics)_sentence_0

For the girl group, see f(x) (group). Function (mathematics)_sentence_1

For other uses, see Function. Function (mathematics)_sentence_2

In mathematics, a function is a binary relation between two sets that associates every element of the first set to exactly one element of the second set. Function (mathematics)_sentence_3

Typical examples are functions from integers to integers, or from the real numbers to real numbers. Function (mathematics)_sentence_4

Functions were originally the idealization of how a varying quantity depends on another quantity. Function (mathematics)_sentence_5

For example, the position of a planet is a function of time. Function (mathematics)_sentence_6

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). Function (mathematics)_sentence_7

The concept of a 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. Function (mathematics)_sentence_8

If the function is called f, this relation is denoted by y = f (x) (which reads "f of x"), where 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 (e.g., f is a function of the variable x). Function (mathematics)_sentence_9

A function is uniquely represented by the set of all pairs (x, f (x)), called the graph of the function. Function (mathematics)_sentence_10

When the domain and the codomain are sets of real numbers, each such pair may be thought of as the Cartesian coordinates of a point in the plane. Function (mathematics)_sentence_11

The set of these points is called the graph of the function; it is a popular means of illustrating the function. Function (mathematics)_sentence_12

Functions are widely used in science, and in most fields of mathematics. Function (mathematics)_sentence_13

It has been said that functions are "the central objects of investigation" in most fields of mathematics. Function (mathematics)_sentence_14

## Definition Function (mathematics)_section_0

Intuitively, a function is a process that associates each element of a set X, to a single element of a set Y. Function (mathematics)_sentence_15

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. Function (mathematics)_sentence_16

Formally speaking, it may be identified with the function, but this hides the usual interpretation of a function as a process. Function (mathematics)_sentence_17

Therefore, in common usage, the function is generally distinguished from its graph. Function (mathematics)_sentence_18

Functions are also called maps or mappings, though some authors make some distinction between "maps" and "functions" (see section #Map). Function (mathematics)_sentence_19

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. Function (mathematics)_sentence_20

In the context of numbers in particular, one also says that y is the value of f for the value x of its variable, or, more concisely, that y is the value of f of x, denoted as y = f(x). Function (mathematics)_sentence_21

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. Function (mathematics)_sentence_22

More formally, f = g if f(x) = g(x) for all x ∈ X, where f:X → Y and g:X → Y. Function (mathematics)_sentence_23

The range of a function is the set of the images of all elements in the domain. Function (mathematics)_sentence_24

However, range is sometimes used as a synonym of codomain, generally in old textbooks. Function (mathematics)_sentence_25

### Relational approach Function (mathematics)_section_1

A binary relation is functional (also called right-unique) if Function (mathematics)_sentence_26

A binary relation is serial (also called left-total) if Function (mathematics)_sentence_27

A partial function is a binary relation that is functional. Function (mathematics)_sentence_28

A function is a binary relation that is functional and serial. Function (mathematics)_sentence_29

### As an element of a Cartesian product over a domain Function (mathematics)_section_2

Infinite Cartesian products are often simply "defined" as sets of functions. Function (mathematics)_sentence_30

## Notation Function (mathematics)_section_3

This distinction in language and notation can become important, in cases where functions themselves serve as inputs for other functions. Function (mathematics)_sentence_31

(A function taking another function as an input is termed a functional.) Function (mathematics)_sentence_32

Other approaches of notating functions, detailed below, avoid this problem but are less commonly used. Function (mathematics)_sentence_33

### Functional notation Function (mathematics)_section_4

As first used by Leonhard Euler in 1734, functions are denoted by a symbol consisting generally of a single letter in italic font, most often the lower-case letters f, g, h. Some widely-used functions are represented by a symbol consisting of several letters (usually two or three, generally an abbreviation of their name). Function (mathematics)_sentence_34

In which case, a roman type is customarily used instead, such as "sin" for the sine function, in contrast to italic font for single-letter symbols. Function (mathematics)_sentence_35

The notation (read: "y equals f of x") Function (mathematics)_sentence_36

means that the pair (x, y) belongs to the set of pairs defining the function f. If X is the domain of f, the set of pairs defining the function is thus, using set-builder notation, Function (mathematics)_sentence_37

Often, a definition of the function is given by what f does to the explicit argument x. Function (mathematics)_sentence_38

For example, a function f can be defined by the equation Function (mathematics)_sentence_39

### Arrow notation Function (mathematics)_section_5

For explicitly expressing domain X and the codomain Y of a function f, the arrow notation is often used (read: "the function f from X to Y" or "the function f mapping elements of X to elements of Y"): Function (mathematics)_sentence_40

or Function (mathematics)_sentence_41

This is often used in relation with the arrow notation for elements (read: "f maps x to f (x)"), often stacked immediately below the arrow notation giving the function symbol, domain, and codomain: Function (mathematics)_sentence_42

the latter line being more commonly written Function (mathematics)_sentence_43

### Specialized notations Function (mathematics)_section_8

There are other, specialized notations for functions in sub-disciplines of mathematics. Function (mathematics)_sentence_44

For example, in linear algebra and functional analysis, linear forms and the vectors they act upon are denoted using a dual pair to show the underlying duality. Function (mathematics)_sentence_45

This is similar to the use of bra–ket notation in quantum mechanics. Function (mathematics)_sentence_46

In logic and the theory of computation, the function notation of lambda calculus is used to explicitly express the basic notions of function abstraction and application. Function (mathematics)_sentence_47

In category theory and homological algebra, networks of functions are described in terms of how they and their compositions commute with each other using commutative diagrams that extend and generalize the arrow notation for functions described above. Function (mathematics)_sentence_48

## Other terms Function (mathematics)_section_9

Function (mathematics)_table_general_0

Map/MappingFunction (mathematics)_cell_0_1_0 None; the terms are synonymous.Function (mathematics)_cell_0_1_1
A map can have any set as its codomain, while, in some contexts, typically in older books, the codomain of a function is specifically the set of real or complex numbers.Function (mathematics)_cell_0_2_0
Alternatively, a map is associated with a special structure (e.g. by explicitly specifying a structured codomain in its definition). For example, a linear map.Function (mathematics)_cell_0_3_0
HomomorphismFunction (mathematics)_cell_0_4_0 A function between two structures of the same type that preserves the operations of the structure (e.g. a group homomorphism).Function (mathematics)_cell_0_4_1
MorphismFunction (mathematics)_cell_0_5_0 A generalisation of homomorphisms to any category, even when the objects of the category are not sets (for example, a group defines a category with only one object, which has the elements of the group as morphisms; see Category (mathematics) § Examples for this example and other similar ones).Function (mathematics)_cell_0_5_1

### Map Function (mathematics)_section_10

A function is often also called a map or a mapping, but some authors make a distinction between the term "map" and "function". Function (mathematics)_sentence_49

For example, the term "map" is often reserved for a "function" with some sort of special structure (e.g. maps of manifolds). Function (mathematics)_sentence_50

In particular map is often used in place of homomorphism for the sake of succinctness (e.g., linear map or map from G to H instead of group homomorphism from G to H). Function (mathematics)_sentence_51

Some authors reserve the word mapping for the case where the structure of the codomain belongs explicitly to the definition of the function. Function (mathematics)_sentence_52

Some authors, such as Serge Lang, use "function" only to refer to maps for which the codomain is a subset of the real or complex numbers, and use the term mapping for more general functions. Function (mathematics)_sentence_53

In the theory of dynamical systems, a map denotes an evolution function used to create discrete dynamical systems. Function (mathematics)_sentence_54

Whichever definition of map is used, related terms like domain, codomain, injective, continuous have the same meaning as for a function. Function (mathematics)_sentence_56

## Specifying a function Function (mathematics)_section_11

### By a formula Function (mathematics)_section_13

Functions are often classified by the nature of formulas that can that define them: Function (mathematics)_sentence_57

### Inverse and implicit functions Function (mathematics)_section_14

The implicit function theorem provides mild differentiability conditions for existence and uniqueness of an implicit function in the neighborhood of a point. Function (mathematics)_sentence_58

### Using differential calculus Function (mathematics)_section_15

Many functions can be defined as the antiderivative of another function. Function (mathematics)_sentence_59

This is the case of the natural logarithm, which is the antiderivative of 1/x that is 0 for x = 1. Function (mathematics)_sentence_60

Another common example is the error function. Function (mathematics)_sentence_61

More generally, many functions, including most special functions, can be defined as solutions of differential equations. Function (mathematics)_sentence_62

The simplest example is probably the exponential function, which can be defined as the unique function that is equal to its derivative and takes the value 1 for x = 0. Function (mathematics)_sentence_63

### By recurrence Function (mathematics)_section_16

Main article: Recurrence relation Function (mathematics)_sentence_64

Functions whose domain are the nonnegative integers, known as sequences, are often defined by recurrence relations. Function (mathematics)_sentence_65

and the initial condition Function (mathematics)_sentence_66

## Representing a function Function (mathematics)_section_17

A graph is commonly used to give an intuitive picture of a function. Function (mathematics)_sentence_67

As an example of how a graph helps to understand a function, it is easy to see from its graph whether a function is increasing or decreasing. Function (mathematics)_sentence_68

Some functions may also be represented by bar charts. Function (mathematics)_sentence_69

### Graphs and plots Function (mathematics)_section_18

Main article: Graph of a function Function (mathematics)_sentence_70

### Tables Function (mathematics)_section_19

Main article: Mathematical table Function (mathematics)_sentence_71

Function (mathematics)_table_general_1

1Function (mathematics)_header_cell_1_1_0 1Function (mathematics)_cell_1_1_1 2Function (mathematics)_cell_1_1_2 3Function (mathematics)_cell_1_1_3 4Function (mathematics)_cell_1_1_4 5Function (mathematics)_cell_1_1_5
2Function (mathematics)_header_cell_1_2_0 2Function (mathematics)_cell_1_2_1 4Function (mathematics)_cell_1_2_2 6Function (mathematics)_cell_1_2_3 8Function (mathematics)_cell_1_2_4 10Function (mathematics)_cell_1_2_5
3Function (mathematics)_header_cell_1_3_0 3Function (mathematics)_cell_1_3_1 6Function (mathematics)_cell_1_3_2 9Function (mathematics)_cell_1_3_3 12Function (mathematics)_cell_1_3_4 15Function (mathematics)_cell_1_3_5
4Function (mathematics)_header_cell_1_4_0 4Function (mathematics)_cell_1_4_1 8Function (mathematics)_cell_1_4_2 12Function (mathematics)_cell_1_4_3 16Function (mathematics)_cell_1_4_4 20Function (mathematics)_cell_1_4_5
5Function (mathematics)_header_cell_1_5_0 5Function (mathematics)_cell_1_5_1 10Function (mathematics)_cell_1_5_2 15Function (mathematics)_cell_1_5_3 20Function (mathematics)_cell_1_5_4 25Function (mathematics)_cell_1_5_5

On the other hand, if a function's domain is continuous, a table can give the values of the function at specific values of the domain. Function (mathematics)_sentence_72

If an intermediate value is needed, interpolation can be used to estimate the value of the function. Function (mathematics)_sentence_73

For example, a portion of a table for the sine function might be given as follows, with values rounded to 6 decimal places: Function (mathematics)_sentence_74

Function (mathematics)_table_general_2

1.289Function (mathematics)_cell_2_1_0 0.960557Function (mathematics)_cell_2_1_1
1.290Function (mathematics)_cell_2_2_0 0.960835Function (mathematics)_cell_2_2_1
1.291Function (mathematics)_cell_2_3_0 0.961112Function (mathematics)_cell_2_3_1
1.292Function (mathematics)_cell_2_4_0 0.961387Function (mathematics)_cell_2_4_1
1.293Function (mathematics)_cell_2_5_0 0.961662Function (mathematics)_cell_2_5_1

Before the advent of handheld calculators and personal computers, such tables were often compiled and published for functions such as logarithms and trigonometric functions. Function (mathematics)_sentence_75

### Bar chart Function (mathematics)_section_20

Main article: Bar chart Function (mathematics)_sentence_76

Bar charts are often used for representing functions whose domain is a finite set, the natural numbers, or the integers. Function (mathematics)_sentence_77

In this case, an element x of the domain is represented by an interval of the x-axis, and the corresponding value of the function, f(x), is represented by a rectangle whose base is the interval corresponding to x and whose height is f(x) (possibly negative, in which case the bar extends below the x-axis). Function (mathematics)_sentence_78

## General properties Function (mathematics)_section_21

This section describes general properties of functions, that are independent of specific properties of the domain and the codomain. Function (mathematics)_sentence_79

### Standard functions Function (mathematics)_section_22

There are a number of standard functions that occur frequently: Function (mathematics)_sentence_80

### Function composition Function (mathematics)_section_23

Main article: Function composition Function (mathematics)_sentence_81

Function (mathematics)_unordered_list_0

• Function (mathematics)_item_0_0
• Function (mathematics)_item_0_1
• Function (mathematics)_item_0_2

### Image and preimage Function (mathematics)_section_24

Main article: Image (mathematics) Function (mathematics)_sentence_82

The image of f is the image of the whole domain, that is f(X). Function (mathematics)_sentence_83

It is also called the range of f, although the term may also refer to the codomain. Function (mathematics)_sentence_84

For example, the preimage of {4, 9} under the square function is the set {−3,−2,2,3}. Function (mathematics)_sentence_85

The preimage by f of an element y of the codomain is sometimes called, in some contexts, the fiber of y under f. Function (mathematics)_sentence_86

### Restriction and extension Function (mathematics)_section_26

Main article: Restriction (mathematics) Function (mathematics)_sentence_87

An extension of a function f is a function g such that f is a restriction of g. A typical use of this concept is the process of analytic continuation, that allows extending functions whose domain is a small part of the complex plane to functions whose domain is almost the whole complex plane. Function (mathematics)_sentence_88

## Multivariate function Function (mathematics)_section_27

A multivariate function, or function of several variables is a function that depends on several arguments. Function (mathematics)_sentence_89

Such functions are commonly encountered. Function (mathematics)_sentence_90

For example, the position of a car on a road is a function of the time travelled and its average speed. Function (mathematics)_sentence_91

More formally, a function of n variables is a function whose domain is a set of n-tuples. Function (mathematics)_sentence_92

For example, multiplication of integers is a function of two variables, or bivariate function, whose domain is the set of all pairs (2-tuples) of integers, and whose codomain is the set of integers. Function (mathematics)_sentence_93

The same is true for every binary operation. Function (mathematics)_sentence_94

More generally, every mathematical operation is defined as a multivariate function. Function (mathematics)_sentence_95

where the domain U has the form Function (mathematics)_sentence_96

It is common to also consider functions whose codomain is a product of sets. Function (mathematics)_sentence_97

For example, Euclidean division maps every pair (a, b) of integers with b ≠ 0 to a pair of integers called the quotient and the remainder: Function (mathematics)_sentence_98

The codomain may also be a vector space. Function (mathematics)_sentence_99

In this case, one talks of a vector-valued function. Function (mathematics)_sentence_100

If the domain is contained in a Euclidean space, or more generally a manifold, a vector-valued function is often called a vector field. Function (mathematics)_sentence_101

## In calculus Function (mathematics)_section_28

The idea of function, starting in the 17th century, was fundamental to the new infinitesimal calculus (see History of the function concept). Function (mathematics)_sentence_102

At that time, only real-valued functions of a real variable were considered, and all functions were assumed to be smooth. Function (mathematics)_sentence_103

But the definition was soon extended to functions of several variables and to functions of a complex variable. Function (mathematics)_sentence_104

In the second half of the 19th century, the mathematically rigorous definition of a function was introduced, and functions with arbitrary domains and codomains were defined. Function (mathematics)_sentence_105

Functions are now used throughout all areas of mathematics. Function (mathematics)_sentence_106

In introductory calculus, when the word function is used without qualification, it means a real-valued function of a single real variable. Function (mathematics)_sentence_107

The more general definition of a function is usually introduced to second or third year college students with STEM majors, and in their senior year they are introduced to calculus in a larger, more rigorous setting in courses such as real analysis and complex analysis. Function (mathematics)_sentence_108

### Real function Function (mathematics)_section_29

A real function is a real-valued function of a real variable, that is, a function whose codomain is the field of real numbers and whose domain is a set of real numbers that contains an interval. Function (mathematics)_sentence_110

In this section, these functions are simply called functions. Function (mathematics)_sentence_111

The functions that are most commonly considered in mathematics and its applications have some regularity, that is they are continuous, differentiable, and even analytic. Function (mathematics)_sentence_112

This regularity insures that these functions can be visualized by their graphs. Function (mathematics)_sentence_113

In this section, all functions are differentiable in some interval. Function (mathematics)_sentence_114

Functions enjoy pointwise operations, that is, if f and g are functions, their sum, difference and product are functions defined by Function (mathematics)_sentence_115

The domains of the resulting functions are the intersection of the domains of f and g. The quotient of two functions is defined similarly by Function (mathematics)_sentence_116

but the domain of the resulting function is obtained by removing the zeros of g from the intersection of the domains of f and g. Function (mathematics)_sentence_117

Many other real functions are defined either by the implicit function theorem (the inverse function is a particular instance) or as solutions of differential equations. Function (mathematics)_sentence_118

For example, the sine and the cosine functions are the solutions of the linear differential equation Function (mathematics)_sentence_119

such that Function (mathematics)_sentence_120

### Vector-valued function Function (mathematics)_section_30

Main articles: Vector-valued function and Vector field Function (mathematics)_sentence_121

When the elements of the codomain of a function are vectors, the function is said to be a vector-valued function. Function (mathematics)_sentence_122

These functions are particularly useful in applications, for example modeling physical properties. Function (mathematics)_sentence_123

For example, the function that associates to each point of a fluid its velocity vector is a vector-valued function. Function (mathematics)_sentence_124

## Function space Function (mathematics)_section_31

Main articles: Function space and Functional analysis Function (mathematics)_sentence_125

In mathematical analysis, and more specifically in functional analysis, a function space is a set of scalar-valued or vector-valued functions, which share a specific property and form a topological vector space. Function (mathematics)_sentence_126

For example, the real smooth functions with a compact support (that is, they are zero outside some compact set) form a function space that is at the basis of the theory of distributions. Function (mathematics)_sentence_127

Function spaces play a fundamental role in advanced mathematical analysis, by allowing the use of their algebraic and topological properties for studying properties of functions. Function (mathematics)_sentence_128

For example, all theorems of existence and uniqueness of solutions of ordinary or partial differential equations result of the study of function spaces. Function (mathematics)_sentence_129

## Multi-valued functions Function (mathematics)_section_32

Main article: Multi-valued function Function (mathematics)_sentence_130

Usefulness of the concept of multi-valued functions is clearer when considering complex functions, typically analytic functions. Function (mathematics)_sentence_131

The domain to which a complex function may be extended by analytic continuation generally consists of almost the whole complex plane. Function (mathematics)_sentence_132

However, when extending the domain through two different paths, one often gets different values. Function (mathematics)_sentence_133

For example, when extending the domain of the square root function, along a path of complex numbers with positive imaginary parts, one gets i for the square root of –1; while, when extending through complex numbers with negative imaginary parts, one gets –i. Function (mathematics)_sentence_134

There are generally two ways of solving the problem. Function (mathematics)_sentence_135

One may define a function that is not continuous along some curve, called a branch cut. Function (mathematics)_sentence_136

Such a function is called the principal value of the function. Function (mathematics)_sentence_137

The other way is to consider that one has a multi-valued function, which is analytic everywhere except for isolated singularities, but whose value may "jump" if one follows a closed loop around a singularity. Function (mathematics)_sentence_138

This jump is called the monodromy. Function (mathematics)_sentence_139

## In the foundations of mathematics and set theory Function (mathematics)_section_33

The definition of a function that is given in this article requires the concept of set, since the domain and the codomain of a function must be a set. Function (mathematics)_sentence_140

This is not a problem in usual mathematics, as it is generally not difficult to consider only functions whose domain and codomain are sets, which are well defined, even if the domain is not explicitly defined. Function (mathematics)_sentence_141

However, it is sometimes useful to consider more general functions. Function (mathematics)_sentence_142

These generalized functions may be critical in the development of a formalization of the foundations of mathematics. Function (mathematics)_sentence_143

For example, Von Neumann–Bernays–Gödel set theory, is an extension of the set theory in which the collection of all sets is a class. Function (mathematics)_sentence_144

This theory includes the replacement axiom, which may be stated as: If X is a set and F is a function, then F[X] is a set. Function (mathematics)_sentence_145

## In computer science Function (mathematics)_section_34

Main articles: Function (programming) and Lambda calculus Function (mathematics)_sentence_146

In computer programming, a function is, in general, a piece of a computer program, which implements the abstract concept of function. Function (mathematics)_sentence_147

That is, it is a program unit that produces an output for each input. Function (mathematics)_sentence_148

However, in many programming languages every subroutine is called a function, even when there is no output, and when the functionality consists simply of modifying some data in the computer memory. Function (mathematics)_sentence_149

Functional programming is the programming paradigm consisting of building programs by using only subroutines that behave like mathematical functions. Function (mathematics)_sentence_150

For example, if_then_else is a function that takes three functions as arguments, and, depending on the result of the first function (true or false), returns the result of either the second or the third function. Function (mathematics)_sentence_151

An important advantage of functional programming is that it makes easier program proofs, as being based on a well founded theory, the lambda calculus (see below). Function (mathematics)_sentence_152

Except for computer-language terminology, "function" has the usual mathematical meaning in computer science. Function (mathematics)_sentence_153

In this area, a property of major interest is the computability of a function. Function (mathematics)_sentence_154

For giving a precise meaning to this concept, and to the related concept of algorithm, several models of computation have been introduced, the old ones being general recursive functions, lambda calculus and Turing machine. Function (mathematics)_sentence_155

The fundamental theorem of computability theory is that these three models of computation define the same set of computable functions, and that all the other models of computation that have ever been proposed define the same set of computable functions or a smaller one. Function (mathematics)_sentence_156

The Church–Turing thesis is the claim that every philosophically acceptable definition of a computable function defines also the same functions. Function (mathematics)_sentence_157

General recursive functions are partial functions from integers to integers that can be defined from Function (mathematics)_sentence_158

Function (mathematics)_unordered_list_1

via the operators Function (mathematics)_sentence_159

Function (mathematics)_unordered_list_2

Although defined only for functions from integers to integers, they can model any computable function as a consequence of the following properties: Function (mathematics)_sentence_160

Function (mathematics)_unordered_list_3

• a computation is the manipulation of finite sequences of symbols (digits of numbers, formulas, ...),Function (mathematics)_item_3_9
• every sequence of symbols may be coded as a sequence of bits,Function (mathematics)_item_3_10
• a bit sequence can be interpreted as the binary representation of an integer.Function (mathematics)_item_3_11

Lambda calculus is a theory that defines computable functions without using set theory, and is the theoretical background of functional programming. Function (mathematics)_sentence_161

It consists of terms that are either variables, function definitions (λ-terms), or applications of functions to terms. Function (mathematics)_sentence_162

Terms are manipulated through some rules, (the α-equivalence, the β-reduction, and the η-conversion), which are the axioms of the theory and may be interpreted as rules of computation. Function (mathematics)_sentence_163

In its original form, lambda calculus does not include the concepts of domain and codomain of a function. Function (mathematics)_sentence_164

Roughly speaking, they have been introduced in the theory under the name of type in typed lambda calculus. Function (mathematics)_sentence_165

Most kinds of typed lambda calculi can define fewer functions than untyped lambda calculus. Function (mathematics)_sentence_166