
Inmathematics, anexpression is an arrangement ofsymbols following the context-dependent,syntactic conventions ofmathematical notation. Symbols can denotenumbers,variables,operations, andfunctions.[1] Other symbols includepunctuation marks andbrackets, used forgrouping where there is not a well-definedorder of operations.
Expressions are commonly distinguished fromformulas: expressions usually denotemathematical objects, whereas formulas are statementsabout mathematical objects.[2] This is analogous tonatural language, where anoun phrase refers to an object, and a wholesentence refers to afact. For example, and are both expressions, while theinequality is a formula. However, formulas are often considered as expressions that can be evaluated to theBoolean valuestrue orfalse.
Toevaluate an expression means to find a numericalvalue equivalent to the expression.[3][4] Expressions can beevaluated orsimplified by replacingoperations that appear in them with their result. For example, the expression simplifies to, and evaluates to
An expression is often used to define afunction, by taking the variables to bearguments, or inputs, of the function, and assigning the output to be the evaluation of the resulting expression.[5] For example, and define the function that associates to each number itssquare plus one. An expression with no variables would define aconstant function. Usually, two expressions are consideredequal orequivalent if they define the same function. Such an equality is called a "semantic equality", that is, both expressions "mean the same thing."
Inelementary algebra, avariable in an expression is aletter that represents a number whose value may change. Toevaluate an expression with a variable means to find the value of the expression when the variable issubstituted with given number. Expressions can besimplified by replacingoperations that appear in them with their result, or by combininglike-terms. Theevaluation of an expression consists of repeating simplification steps until getting eventually a single number.[6]
For example, take the expression; it can be evaluated forx = 3 in the following steps:
, (replace x with 3)
(evaluate the square)
(evaluate the multiplication)
(evaluate the addition)
Aterm is a constant or theproduct of a constant and one or more variables. Some examples include The constant of the product is called thecoefficient. Terms that are either constants or have the same variables raised to the same powers are calledlike terms. If there are like terms in an expression, one can simplify the expression by combining the like terms. One adds the coefficients and keeps the same variable.
Any variable can be classified as being either afree variable or abound variable. For a given combination of values for the free variables, an expression may be evaluated, although for some combinations of values of the free variables, the value of the expression may beundefined. Thus an expression represents anoperation over constants and free variables and whose output is the resulting value of the expression.[7]
For a non-formalized language, that is, in most mathematical texts outside ofmathematical logic, for an individual expression it is not always possible to identify which variables are free and bound. For example, in, depending on the context, the variable can be free and bound, or vice-versa, but they cannot both be free. Determining which value is assumed to be free depends on context andsemantics.[8]
An expression is often used to define afunction, or denotecompositions of functions, by taking the variables to bearguments, or inputs, of the function, and assigning the output to be the evaluation of the resulting expression.[9] For example, and define the function that associates to each number itssquare plus one. An expression with no variables would define aconstant function. In this way, two expressions are said to be equivalent if, for each combination of values for the free variables, they have the same output, i.e., they represent the same function.[10][11] The equivalence between two expressions is called anidentity and is sometimes denoted with
For example, in the expression the variablen is bound, and the variablex is free. This expression is equivalent to the simpler expression12x; that is The value forx = 3 is 36, which can be denoted
Thelanguage of mathematics exhibits a kind ofgrammar (calledformal grammar) about how expressions may be written. There are two considerations for well-definedness of mathematical expressions,syntax andsemantics. Syntax is concerned with the rules used for constructing, or transforming the symbols of an expression without regard to anyinterpretation ormeaning given to them. Expressions that are syntactically correct are calledwell-formed. Semantics is concerned with the meaning of these well-formed expressions. Expressions that are semantically correct are calledwell-defined.
The syntax of mathematical expressions can be described somewhat informally as follows: the allowedoperators must have the correct number of inputs in the correct places (usually written withinfix notation), the sub-expressions that make up these inputs must be well-formed themselves, have a clearorder of operations, etc. Strings of symbols that conform to the rules of syntax are calledwell-formed, and those that are not well-formed are called,ill-formed, and do not constitute mathematical expressions.[12]
For example, inarithmetic, the expression1 + 2 × 3 is well-formed, but
is not.
However, being well-formed is not enough to be considered well-defined. For example in arithmetic, the expression is well-formed, but it is not well-defined (seeDivision by zero). Such expressions are calledundefined.
Semantics is the study of meaning.Formal semantics is about attaching meaning to expressions. An expression that defines a uniquevalue or meaning is said to bewell-defined. Otherwise, the expression is said to be ill defined or ambiguous.[13] In general the meaning of expressions is not limited to designating values; for instance, an expression might designate a condition, or anequation that is to be solved, or it can be viewed as an object in its own right that can be manipulated according to certain rules. Certain expressions that designate a value simultaneously express a condition that is assumed to hold, for instance those involving the operator to designate an internaldirect sum.
Inalgebra, an expression may be used to designate a value, which might depend on values assigned tovariables occurring in the expression. The determination of this value depends on thesemantics attached to the symbols of the expression. The choice of semantics depends on the context of the expression. The same syntactic expression1 + 2 × 3 can have different values (mathematically 7, but also 9), depending on theorder of operations implied by the context (See alsoOperations § Calculators).
Forreal numbers, the product is unambiguous because; hence the notation is said to bewell defined.[13] This property, also known asassociativity of multiplication, guarantees the result does not depend on the sequence of multiplications; therefore, a specification of the sequence can be omitted. Thesubtraction operation is non-associative; despite that, there is a convention that is shorthand for, thus it is considered "well-defined". On the other hand,Division is non-associative, and in the case of, parenthesization conventions are not well established; therefore, this expression is often considered ill-defined.
Unlike with functions, notational ambiguities can be overcome by means of additional definitions (e.g., rules ofprecedence, associativity of the operator). For example, in the programming languageC, the operator- for subtraction isleft-to-right-associative, which means thata-b-c is defined as(a-b)-c, and the operator= for assignment isright-to-left-associative, which means thata=b=c is defined asa=(b=c).[14] In the programming languageAPL there is only one rule: fromright to left – but parentheses first.
The term 'expression' is part of thelanguage of mathematics, that is to say, it is not definedwithin mathematics, but taken as aprimitive part of the language. To attempt to define the term would not be doing mathematics, but rather, one would be engaging in a kind ofmetamathematics (themetalanguage of mathematics), usuallymathematical logic. Within mathematical logic, mathematics is usually described as a kind offormal language, and a well-formed expression can bedefined recursively as follows:[7]
Thealphabet consists of:
With this alphabet, the recursive rules for forming a well-formed expression (WFE) are as follows:
A well-formed expression can be thought as asyntax tree.[15] Theleaf nodes are always atomic expressions. Operations and have exactly two child nodes, while operations, and have exactly one. There are countably infinitely many WFE's, however, each WFE has a finite number of nodes.
Incomputer science, anexpression is asyntactic entity in aprogramming language that may be evaluated to determine itsvalue[16] or fail to terminate, in which case the expression is undefined.[17] It is a combination of one or moreconstants,variables,functions, andoperators that the programming language interprets (according to its particularrules of precedence and ofassociation) and computes to produce ("to return", in astateful environment) another value. This process, for mathematical expressions, is calledevaluation.In simple settings, theresulting value is usually one of variousprimitive types, such asstring,Boolean, or numerical (such asinteger,floating-point, orcomplex).
Incomputer algebra, formulas are viewed as expressions that can be evaluated as a Boolean, depending on the values that are given to the variables occurring in the expressions. For example takes the valuefalse ifx is given a value less than 1, and the valuetrue otherwise.
Expressions are often contrasted withstatements—syntactic entities that have no value (an instruction).

Except fornumbers andvariables, every mathematical expression may be viewed as the symbol of an operator followed by asequence of operands. In computer algebra software, the expressions are usually represented in this way. This representation is very flexible, and many things that seem not to be mathematical expressions at first glance, may be represented and manipulated as such. For example, an equation is an expression with "=" as an operator, amatrix may be represented as an expression with "matrix" as an operator and its rows as operands.
See:Computer algebra expression
Acomputation is any type ofarithmetic or non-arithmeticcalculation that is "well-defined".[19] The notion that mathematical statements should be 'well-defined' had been argued by mathematicians since at least the1600s,[20] but agreement on a suitable definition proved elusive.[21] A candidate definition was proposed independently by several mathematicians in the 1930s.[22] The best-known variant was formalised by the mathematicianAlan Turing, who defined a well-defined statement or calculation as any statement that could be expressed in terms of the initialisation parameters of aTuring machine.[23][page needed] Turing's definition apportioned "well-definedness" to a very large class of mathematical statements, including all well-formedalgebraic statements, and all statements written in modern computer programming languages.[24]
Despite the widespread uptake of this definition, there are some mathematical concepts that have no well-defined characterisation under this definition. This includesthe halting problem andthe busy beaver game. It remains an open question as to whether there exists a more powerful definition of 'well-defined' that is able to capture both computable and 'non-computable' statements.[a][25] All statements characterised in modern programming languages are well-defined, includingC++,Python, andJava.[24]
Common examples of computation are basicarithmetic and theexecution of computeralgorithms. Acalculation is a deliberate mathematical process that transforms one or more inputs into one or more outputs orresults. For example,multiplying 7 by 6 is a simple algorithmic calculation. Extracting thesquare root or thecube root of a number using mathematical models is a more complex algorithmic calculation.
Expressions can be computed by means of anevaluation strategy.[26] To illustrate, executing a function callf(a,b) may first evaluate the argumentsa andb, store the results inreferences or memory locationsref_a andref_b, then evaluate the function's body with those references passed in. This gives the function the ability to look up the original argument values passed in through dereferencing the parameters (some languages use specific operators to perform this), to modify them viaassignment as if they were local variables, and to return values via the references. This is the call-by-reference evaluation strategy.[27] Evaluation strategy is part of the semantics of the programming language definition. Some languages, such asPureScript, have variants with different evaluation strategies. Somedeclarative languages, such asDatalog, support multiple evaluation strategies. Some languages define acalling convention.
Inrewriting, areduction strategy or rewriting strategy is a relation specifying a rewrite for each object or term, compatible with a given reduction relation. A rewriting strategy specifies, out of all the reducible subterms (redexes), which one should be reduced (contracted) within a term. One of the most common systems involveslambda calculus.
A polynomial consists of variables andcoefficients, that involve only the operations ofaddition,subtraction,multiplication andexponentiation tononnegative integer powers, and has a finite number of terms. The problem ofpolynomial evaluation arises frequently in practice. Incomputational geometry, polynomials are used to compute function approximations usingTaylor polynomials. Incryptography andhash tables, polynomials are used to computek-independent hashing.
In the former case, polynomials are evaluated usingfloating-point arithmetic, which is not exact. Thus different schemes for the evaluation will, in general, give slightly different answers. In the latter case, the polynomials are usually evaluated in afinite field, in which case the answers are always exact.
For evaluating theunivariate polynomial the most naive method would use multiplications to compute, use multiplications to compute and so on for a total of multiplications and additions. Using better methods, such asHorner's rule, this can be reduced to multiplications and additions. If some preprocessing is allowed, even more savings are possible
Analgebraic expression is an expression built up fromalgebraic constants,variables, and thealgebraic operations (addition,subtraction,multiplication,division andexponentiation by arational number).[28] For example,3x2 − 2xy +c is an algebraic expression. Since taking thesquare root is the same as raising to the power1/2, the following is also an algebraic expression:
See also:Algebraic equation andAlgebraic closure
Apolynomial is an expression built withscalars (numbers of elements of some field),variables, and the operators of addition, multiplication, and exponentiation to nonnegative integer powers; for example
Usingassociativity,commutativity anddistributivity, every polynomial expression is equivalent to apolynomial, that is an expression that is alinear combination of products of integer powers of the indeterminates. For example the above polynomial expression is equivalent (denote the same polynomial as
Many author do not distinguish polynomials and polynomial expressions. In this case the expression of a polynomial expression as a linear combination is called thecanonical form,normal form, orexpanded form of the polynomial.
Aformal expression is a kind ofstring ofsymbols, created by the sameproduction rules as standard expressions, however, they are used without regard to the meaning of the expression. In this way, twoformal expressions are considered equal only if they aresyntactically equal, that is, if they are the exact same expression.[29][30] For instance, the formal expressions "2" and "1+1" are not equal.
Formal languages allowformalizing the concept of well-formed expressions.
In the 1930s, a new type of expression, thelambda expression, was introduced byAlonzo Church andStephen Kleene for formalizingfunctions and their evaluation.[31][b] The lambda operators (lambda abstraction and function application) form the basis for lambda calculus, a formal system used inmathematical logic andprogramming language theory.
The equivalence of two lambda expressions isundecidable (but seeunification (computer science)). This is also the case for the expressions representing real numbers, which are built from the integers by using the arithmetical operations, the logarithm and the exponential (Richardson's theorem).
The earliest written mathematics likely began withtally marks, where each mark represented one unit, carved into wood or stone. An example of earlycounting is theIshango bone, found near theNile and dating back over20,000 years ago, which is thought to show a six-monthlunar calendar.[32]Ancient Egypt developed a symbolic system usinghieroglyphics, assigning symbols for powers of ten and using addition and subtraction symbols resembling legs in motion.[33][34] This system, recorded in texts like theRhind Mathematical Papyrus (c. 2000–1800 BC), influenced otherMediterranean cultures. InMesopotamia, a similar system evolved, with numbers written in a base-60 (sexagesimal) format onclay tablets written inCuneiform, a technique originating with theSumerians around 3000 BC. This base-60 system persists today in measuring time andangles.
The "syncopated" stage of mathematics introduced symbolic abbreviations for commonly used operations and quantities, marking a shift from purelygeometric reasoning.Ancient Greek mathematics, largely geometric in nature, drew onEgyptian numerical systems (especiallyAttic numerals),[35] with little interest in algebraic symbols, until the arrival ofDiophantus ofAlexandria,[36] who pioneered a form ofsyncopated algebra in hisArithmetica, which introduced symbolic manipulation of expressions.[37] His notation represented unknowns and powers symbolically, but without modern symbols forrelations (such asequality orinequality) orexponents.[38] An unknown number was called.[39] The square of was; the cube was; the fourth power was; the fifth power was; and meant to subtract everything on the right from the left.[40] So for example, what would be written in modern notation as:Would be written in Diophantus's syncopated notation as:
In the 7th century,Brahmagupta used different colours to represent the unknowns in algebraic equations in theBrāhmasphuṭasiddhānta. Greek and other ancient mathematical advances, were often trapped in cycles of bursts of creativity, followed by long periods of stagnation, but this began to change as knowledge spread in theearly modern period.

The transition to fully symbolic algebra began withIbn al-Banna' al-Marrakushi (1256–1321) andAbū al-Ḥasan ibn ʿAlī al-Qalaṣādī, (1412–1482) who introduced symbols for operations usingArabic characters.[41][42][43] Theplus sign (+) appeared around 1351 withNicole Oresme,[44] likely derived from the Latinet (meaning "and"), while the minus sign (−) was first used in 1489 byJohannes Widmann.[45]Luca Pacioli included these symbols in his works, though much was based on earlier contributions byPiero della Francesca. Theradical symbol (√) forsquare root was introduced byChristoph Rudolff in the 1500s, andparentheses forprecedence byNiccolò Tartaglia in 1556.François Viète’sNew Algebra (1591) formalized modern symbolic manipulation. Themultiplication sign (×) was first used byWilliam Oughtred and thedivision sign (÷) byJohann Rahn.
René Descartes further advanced algebraic symbolism inLa Géométrie (1637), where he introduced the use of letters at the end of the alphabet (x, y, z) forvariables, along with theCartesian coordinate system, which bridged algebra and geometry.[46]Isaac Newton andGottfried Wilhelm Leibniz independently developedcalculus in the late 17th century, withLeibniz's notation becoming the standard.
{{cite book}}:ISBN / Date incompatibility (help){{cite book}}:ISBN / Date incompatibility (help){{cite book}}:ISBN / Date incompatibility (help)algebraic expression over a field.
Descartes, René (2006) [1637].A discourse on the method of correctly conducting one's reason and seeking truth in the sciences. Translated by Ian Maclean. Oxford University Press.ISBN 0-19-282514-3.