In mathematics, a variable (from Latin ) is a symbol, typically a letter, that refers to an unspecified mathematical object. One says colloquially that the variable represents or denotes the object, and that any valid candidate for the object is the value of the variable. The values a variable can take are usually of the same kind, often numbers. More specifically, the values involved may form a set, such as the set of real numbers.

The object may not always exist, or it might be uncertain whether any valid candidate exists or not. For example, one could represent two integers by the variables and and require that the value of the square of is twice the square of , which in algebraic notation can be written . A definitive proof that this relationship is impossible to satisfy when and are restricted to nonzero integers isn't obvious, but it has been known since ancient times and has had a big influence on mathematics ever since.

Originally, the term variable was used primarily for the argument of a function, in which case its value could be thought of as varying within the domain of the function. This is the motivation for the choice of the term. Also, variables are used for denoting values of functions, such as the symbol in the equation , where is the argument and denotes the function itself.

A variable may represent an unspecified number that remains fixed during the resolution of a problem; in which case, it is often called a parameter. A variable may denote an unknown number that has to be determined; in which case, it is called an unknown; for example, in the quadratic equation , the variables , , are parameters, and is the unknown.

Sometimes the same symbol can be used to denote both a variable and a constant, that is a well defined mathematical object. For example, the Greek letter generally represents the number , but has also been used to denote a projection. Similarly, the letter often denotes Euler's number, but has been used to denote an unassigned coefficient for quartic function and higher degree polynomials. Even the symbol has been used to denote an identity element of an arbitrary field. These two notions are used almost identically, therefore one usually must be told whether a given symbol denotes a variable or a constant.

Variables are often used for representing matrices, functions, their arguments, sets and their elements, vectors, spaces, etc.Stover & Weisstein.

In mathematical logic, a variable is a symbol that either represents an unspecified constant of the theory, or is being quantified over.

History

Early history

The earliest uses of an "unknown quantity" date back to at least the Ancient Egyptians with the Moscow Mathematical Papyrus (c. 1500 BC) which described problems with unknowns rhetorically, called the "Aha problems". The "Aha problems" involve finding unknown quantities (referred to as aha, "stack") if the sum of the quantity and part(s) of it are given (The Rhind Mathematical Papyrus also contains four of these types of problems). For example, problem 19 asks one to calculate a quantity taken times and added to 4 to make 10.Clagett, Marshall. 1999. Ancient Egyptian Science: A Source Book. Volume 3: Ancient Egyptian Mathematics. Memoirs of the American Philosophical Society 232. Philadelphia: American Philosophical Society. In modern mathematical notation: . Around the same time in Mesopotamia, mathematics of the Old Babylonian period (c. 2000 BC – 1500 BC) was more advanced, also studying quadratic and cubic equations.

In works of ancient Greece such as Euclid's Elements (c. 300 BC), mathematics was described geometrically. For example, The Elements, proposition 1 of Book II, Euclid includes the proposition:

"If there be two straight lines, and one of them be cut into any number of segments whatever, the rectangle contained by the two straight lines is equal to the rectangles contained by the uncut straight line and each of the segments."

This corresponds to the algebraic identity (distributivity), but is described entirely geometrically. Euclid, and other greek geometers, also used single letters refer to geometric points and shapes. This kind of algebra is now sometimes called Greek geometric algebra.

Diophantus of Alexandria,Diophantine Equations. Submitted by: Aaron Zerhusen, Chris Rakes, & Shasta Meece. MA 330-002. Dr. Carl Eberhart. 16 February 1999. pioneered a form of syncopated algebra in his Arithmetica (c. 200 AD), which introduced symbolic manipulation of expressions with unknowns and powers, but without modern symbols for relations (such as equality or inequality) or exponents.Boyer (1991). "Revival and Decline of Greek Mathematics". p. 178. "The chief difference between Diophantine syncopation and the modern algebraic notation is the lack of special symbols for operations and relations, as well as of the exponential notation." An unknown number was called .A History of Greek Mathematics: From Aristarchus to Diophantus. By Sir Thomas Little Heath. Pg 456 The square of was ; the cube was ; the fourth power was ; and the fifth power was .A History of Greek Mathematics: From Aristarchus to Diophantus. By Sir Thomas Little Heath. Pg 458 So for example, what would be written in modern notation as:

would be written in Diophantus's syncopated notation as:

In the 7th century BC, Brahmagupta used different colours to represent the unknowns in algebraic equations in the Brāhmasphuṭasiddhānta. One section of this book is called "Equations of Several Colours".. Greek and other ancient mathematical advances, were often trapped in long periods of stagnation, and so there were few revolutions in notation, but this began to change by the early modern period.

Early modern period At the end of the 16th century, François Viète introduced the idea of representing known and unknown numbers by letters, nowadays called variables, and the idea of computing with them as if they were numbers—in order to obtain the result by a simple replacement. Viète's convention was to use consonants for known values, and vowels for unknowns..

In 1637, René Descartes "invented the convention of representing unknowns in equations by , , and , and knowns by , , and ".. Contrarily to Viète's convention, Descartes' is still commonly in use. The history of the letter x in math was discussed in an 1887 Scientific American article.

Starting in the 1660s, Isaac Newton and Gottfried Wilhelm Leibniz independently developed the infinitesimal calculus, which essentially consists of studying how an infinitesimal variation of a time-varying quantity, called a Fluent, induces a corresponding variation of another quantity which is a function of the first variable. Almost a century later, Leonhard Euler fixed the terminology of infinitesimal calculus, and introduced the notation for a function , its variable and its value . Until the end of the 19th century, the word variable referred almost exclusively to the arguments and the values of functions.

In the second half of the 19th century, it appeared that the foundation of infinitesimal calculus was not formalized enough to deal with apparent paradoxes such as a nowhere differentiable continuous function. To solve this problem, Karl Weierstrass introduced a new formalism consisting of replacing the intuitive notion of limit by a formal definition. The older notion of limit was "when the variable varies and tends toward , then tends toward ", without any accurate definition of "tends". Weierstrass replaced this sentence by the formula

in which none of the five variables is considered as varying.

This static formulation led to the modern notion of variable, which is simply a symbol representing a mathematical object that either is unknown, or may be replaced by any element of a given set (e.g., the set of real numbers).

Notation Variables are generally denoted by a single letter, most often from the Latin alphabet and less often from the Greek, which may be lowercase or capitalized. The letter may be followed by a subscript: a number (as in ), another variable (), a word or abbreviation of a word as a label () or a mathematical expression (). Under the influence of computer science, some variable names in pure mathematics consist of several letters and digits. Following René Descartes (1596–1650), letters at the beginning of the alphabet such as , , are commonly used for known values and parameters, and letters at the end of the alphabet such as , , are commonly used for unknowns and variables of functions. "It has become conventional to make use of the letters a, b, c, ..., α, β, γ, ..., from the beginning of the alphabet to denote constants; and to retain later letters, such as u, v, w, x, y, z and the Greek letters ξ, η, ζ for variables."Frank Morley & Frank Vigor Morley (1933) ‘’Inversive Geometry’’, page 12, via HathiTrust In printed mathematics, the norm is to set variables and constants in an italic typeface.

For example, a general quadratic function is conventionally written as , where , and are parameters (also called constants, because they are constant functions), while is the variable of the function. A more explicit way to denote this function is , which clarifies the function-argument status of and the constant status of , and . Since occurs in a term that is a constant function of , it is called the constant term..

Specific branches and applications of mathematics have specific naming conventions for variables. Variables with similar roles or meanings are often assigned consecutive letters or the same letter with different subscripts. For example, the three axes in 3D coordinate space are conventionally called , , and . In physics, the names of variables are largely determined by the physical quantity they describe, but various naming conventions exist. A convention often followed in probability and statistics is to use , , for the names of random variables, keeping , , for variables representing corresponding better-defined values.

Conventional variable names

, , , (sometimes extended to , ) for parameters or coefficients , , , ... for situations where distinct letters are inconvenient or for the th term of a sequence or the th coefficient of a series , , for functions (as in ) , , (sometimes or ) for varying integers or indices in an indexed family, or unit vectors and for the length and width of a figure also for a line, or in number theory for a prime number not equal to (with as a second choice) for a fixed integer, such as a count of objects or the degree of a polynomial for a prime number or a probability for a prime power or a quotient for a radius, a remainder or a correlation coefficient for time , , for the three Cartesian coordinates of a point in Euclidean geometry or the corresponding axes for a complex number, or in statistics a normal random variable , , , , for angle measures (with as a second choice) for an arbitrarily small positive number for an eigenvalue (uppercase sigma) for a sum, or (lowercase sigma) in statistics for the standard deviation for a mean

Specific kinds of variables It is common for variables to play different roles in the same mathematical formula, and names or qualifiers have been introduced to distinguish them. For example, the general cubic equation

is interpreted as having five variables: four, , which are taken to be given numbers and the fifth variable, is understood to be an unknown number. To distinguish them, the variable is called an unknown, and the other variables are called parameters or coefficients, or sometimes constants, although this last terminology is incorrect for an equation, and should be reserved for the function defined by the left-hand side of this equation.