In
mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and their changes (cal ...
, an expression or mathematical expression is a finite combination of
symbols
A symbol is a mark, sign, or word
In linguistics
Linguistics is the scientific study of language
A language is a structured system of communication used by humans, including speech (spoken language), gestures (Signed languag ...
that is
well-formed
Well-formed or wellformed indicate syntactic correctness and may refer to:
* Well-formedness, quality of linguistic elements that conform to grammar rules
* Well-formed formula, a string that is generated by a formal grammar in logic
* Well-formed ...
according to rules that depend on the context. Mathematical symbols can designate numbers (
constant
Constant or The Constant may refer to:
Mathematics
* Constant (mathematics)
In mathematics, the word constant can have multiple meanings. As an adjective, it refers to non-variance (i.e. unchanging with respect to some other Value (mathematics ...
s),
variables,
operations,
function
Function or functionality may refer to:
Computing
* Function key
A function key is a key on a computer
A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern comp ...
s,
bracket
A bracket is either of two tall fore- or back-facing punctuation
Punctuation (or sometimes interpunction) is the use of spacing, conventional signs (called punctuation marks), and certain typographical devices as aids to the understanding ...
s, punctuation, and grouping to help determine
order of operations
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

and other aspects of
logical syntax.
Many authors distinguish an expression from a
formula
In science
Science () is a systematic enterprise that Scientific method, builds and organizes knowledge in the form of Testability, testable explanations and predictions about the universe."... modern science is a discovery as well a ...

, the former denoting a mathematical object, and the latter denoting a statement about mathematical objects. For example,
is an expression, while
is a formula. However, in modern mathematics, and in particular in
computer algebra
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...
, formulas are viewed as expressions that can be evaluated to ''true'' or ''false'', depending on the values that are given to the variables occurring in the expressions. For example
takes the value ''false'' if is given a value less than –1, and the value ''true'' otherwise.
Examples
The use of expressions ranges from the simple:
::
::
(
linear polynomial
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). I ...
)
::
(
quadratic polynomial
In algebra
Algebra (from ar, الجبر, lit=reunion of broken parts, bonesetting, translit=al-jabr) is one of the areas of mathematics, broad areas of mathematics, together with number theory, geometry and mathematical analysis, analysis. I ...
)
::
(
rational fraction
In algebra
Algebra (from ar, الجبر, lit=reunion of broken parts, bonesetting, translit=al-jabr) is one of the areas of mathematics, broad areas of mathematics, together with number theory, geometry and mathematical analysis, analysis. In ...
)
to the complex:
::
Syntax versus semantics
Syntax
An expression is a syntactic construct. It must be
well-formed
Well-formed or wellformed indicate syntactic correctness and may refer to:
* Well-formedness, quality of linguistic elements that conform to grammar rules
* Well-formed formula, a string that is generated by a formal grammar in logic
* Well-formed ...
: the allowed
operators must have the correct number of inputs in the correct places, the characters that make up these inputs must be valid, have a clear
order of operations
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

, etc. Strings of symbols that violate the rules of syntax are not well-formed and are not valid mathematical expressions.
For example, in the
usual notation of
arithmetic
Arithmetic (from the Ancient Greek, Greek wikt:en:ἀριθμός#Ancient Greek, ἀριθμός ''arithmos'', 'number' and wikt:en:τική#Ancient Greek, τική wikt:en:τέχνη#Ancient Greek, έχνη ''tiké échne', 'art' or 'cr ...
, the expression ''1 + 2 × 3'' is well-formed, but the following expression is not:
:
.
Semantics
Semantics is the study of meaning. Formal semantics is about attaching meaning to expressions.
In
algebra
Algebra (from ar, الجبر, lit=reunion of broken parts, bonesetting, translit=al-jabr) is one of the areas of mathematics, broad areas of mathematics, together with number theory, geometry and mathematical analysis, analysis. In its most ge ...

, an expression may be used to designate a value, which might depend on values assigned to
variables occurring in the expression. The determination of this value depends on the
semantics
Semantics (from grc, σημαντικός ''sēmantikós'', "significant") is the study of reference
Reference is a relationship between objects in which one object designates, or acts as a means by which to connect to or link to, another ...
attached to the symbols of the expression. The choice of semantics depends on the context of the expression. The same syntactic expression ''1 + 2 × 3'' can have different values (mathematically 7, but also 9), depending on the
order of operations
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

implied by the context (See also
).
The semantic rules may declare that certain expressions do not designate any value (for instance when they involve division by 0); such expressions are said to have an undefined value, but they are well-formed expressions nonetheless. In general the meaning of expressions is not limited to designating values; for instance, an expression might designate a condition, or an
equation
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no ge ...

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 internal
direct sum
The direct sum is an operation from abstract algebra
In algebra, which is a broad division of mathematics, abstract algebra (occasionally called modern algebra) is the study of algebraic structures. Algebraic structures include group (mathema ...
.
Formal languages and lambda calculus
Formal languages allow
formalizing the concept of well-formed expressions.
In the 1930s, a new type of expressions, called
lambda expressions
Lambda calculus (also written as ''λ''-calculus) is a formal system
A formal system is an abstract structure used for inferring theorems from axioms according to a set of rules. These rules, which are used for carrying out the inference of theor ...
, were introduced by
Alonzo Church
Alonzo Church (June 14, 1903 – August 11, 1995) was an American
American(s) may refer to:
* American, something of, from, or related to the United States of America, commonly known as the United States
The United States of America (US ...
and
Stephen Kleene
Stephen Cole Kleene ( ; January 5, 1909 – January 25, 1994) was an American mathematician. One of the students of Alonzo Church, Kleene, along with Rózsa Péter, Alan Turing, Emil Post, and others, is best known as a founder of the branch of m ...
for formalizing
function
Function or functionality may refer to:
Computing
* Function key
A function key is a key on a computer
A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern comp ...
s and their evaluation. They form the basis for
lambda calculus
Lambda calculus (also written as ''λ''-calculus) is a formal system
A formal system is an used for inferring theorems from axioms according to a set of rules. These rules, which are used for carrying out the inference of theorems from axioms, ar ...
, a
formal system
A formal system is an abstract structure used for inferring theorems from axioms according to a set of rules. These rules, which are used for carrying out the inference of theorems from axioms, are the logical calculus of the formal system.
A for ...
used in
mathematical logic
Mathematical logic is the study of formal logic within mathematics. Major subareas include model theory, proof theory, set theory, and recursion theory. Research in mathematical logic commonly addresses the mathematical properties of formal sys ...
and the
theory of programming languages.
The equivalence of two lambda expressions is
undecidable. 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).
Variables
Many mathematical expressions include
variables. Any variable can be classified as being either a
free variable
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...
or a
bound variable
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...
.
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 be undefined. Thus an expression represents a
function
Function or functionality may refer to:
Computing
* Function key
A function key is a key on a computer
A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern comp ...
whose inputs are the values assigned to the free variables and whose output is the resulting value of the expression.
For example, the expression
:
evaluated for ''x'' = 10, ''y'' = 5, will give 2; but it is
undefined
Undefined may refer to:
Mathematics
* Undefined (mathematics), with several related meanings
** Indeterminate form, in calculus
Computing
* Undefined behavior, computer code whose behavior is not specified under certain conditions
* Undefined v ...
for ''y'' = 0.
The evaluation of an expression is dependent on the definition of the mathematical operators and on the system of values that is its context.
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. Example:
The expression
:
has free variable ''x'', bound variable ''n'', constants 1, 2, and 3, two occurrences of an implicit multiplication operator, and a summation operator. The expression is equivalent to the simpler expression 12''x''. The value for ''x'' = 3 is 36.
See also
*
Algebraic closure
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...
*
Algebraic expressionIn mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ha ...
*
Analytic expression
Generally speaking, analytic (from el, ἀναλυτικός, ''analytikos'') refers to the "having the ability to analyze" or "division into elements or principles".
Analytic can also have the following meanings:
Natural sciences Chemistry
* ...
*
Closed-form expression
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...
*
Combinator
Combinatory logic is a notation to eliminate the need for Quantifier (logic), quantified variables in mathematical logic. It was introduced by Moses Schönfinkel and Haskell Curry, and has more recently been used in computer science as a theoreti ...
*
*
Defined and undefined
In mathematics, the term undefined is often used to refer to an expression which is not assigned an interpretation or a value (such as an indeterminate form, which has the propensity of assuming different values). The term can take on several diff ...
*
Equation
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no ge ...

*
Expression (programming) In computer science
Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application.
Computer science is the study of , , an ...
*
Formal grammar
In formal language theory
In logic
Logic is an interdisciplinary field which studies truth and reasoning
Reason is the capacity of consciously making sense of things, applying logic
Logic (from Ancient Greek, Greek: grc, wikt:λ ...
*
Formula
In science
Science () is a systematic enterprise that Scientific method, builds and organizes knowledge in the form of Testability, testable explanations and predictions about the universe."... modern science is a discovery as well a ...

*
Functional programming
In computer science
Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application.
Computer science is the study of , ...
*
Logical expression
*
Term (logic)
In mathematical logic, a term denotes a mathematical object while a Formula (mathematical logic), formula denotes a mathematical fact. In particular, terms appear as components of a formula. This is analogous to natural language, where a noun phras ...
Notes
References
*
{{Mathematical logic
Abstract algebra
Logical expressions
bg:Израз
pl:Wyrażenie algebraiczne