# Square (algebra)

5⋅5, or 52 (5 squared), can be shown graphically using a square. Each block represents one unit, 1⋅1, and the entire square represents 5⋅5, or the area of the square.

In algebra, a square is the result of multiplying a number, or other expression, by itself. In other words, squaring is exponentiation to the power 2.

The squaring function is denoted by a superscript 2, as in (x + 1)2. However when superscripts are not available, as for instance in programming languages or plain text files, the notations x^2 or x**2 are commonly used. The adjective which corresponds to squaring is quadratic.

An integer that is the square of some other integer, for example 25 which is 52, is known as a square number. All square numbers are non-negative. More generally, for any ring an element which is the square of some other element is known as a perfect square, or more simply, a square.

In algebraic structures where addition, subtraction and multiplication are defined and the multiplication is a bilinear map,[1] the square function satisfies the identity x2 = (−x)2, i.e. the squaring function is even.

## In real numbers

y = x2. The graph of a quadratic function has a parabolic shape. The squares of numbers make a power law.

The squaring function monotonically increases on positive numbers [0, +∞), but monotonically decreases on (−∞,0]. Hence, zero is its global minimum. The only cases where the square x2 of a number is less than x occur when 0 < x < 1, that is, when x belongs to an open interval (0,1). This implies that the square of an integer is never less than the original number.

Any positive real number is the square of exactly two numbers, one strictly positive one strictly negative, 0 is just the square itself. For this reason, it is possible to define the square root function, which associates with a real number the non-negative number whose square is the original number.

No square root can be taken of a negative number within the system of real numbers, because squares of all real numbers are non-negative. This permits the expansion of the real number system to the complex numbers, by postulating the imaginary unit i, which is one of the square roots of −1.

The property "every non negative real number is a square" has been generalized to the notion of real closed field, which is an ordered field such that every non negative element is a square. The real closed fields can not be distinguished from the field of real numbers by their algebraic properties: every property of the real numbers, which may be expressed in first-order logic (that is expressed by a formula in which the variables that are quantified by ∀ or ∃ represent elements, not sets), is true for every real closed field, and conversely every property of the first-order logic, which is true for a specific real closed field is also true for the real numbers.

## In fields in general

The squaring function is defined in any field. An element in the image of this function is called a square of the field, and the inverse images of a square are called square roots. A square usually has two square roots whose sum is 0. There are two exceptions: In any field, 0 has only one square root, which is 0 itself. In a field of characteristic 2, an element has zero or one square root. Otherwise, any non-zero element either has two square roots (see below why not more) or does not have any.

Given an odd prime number p, a non-zero element of the field Z/pZ with p elements is a quadratic residue if it is a square in Z/pZ. Otherwise, it is a quadratic non-residue. Zero, while a square, is not considered a quadratic residue. There are (p − 1)/2 quadratic residues and (p − 1)/2 quadratic non-residues. The quadratic residues form a group under multiplication. The properties of quadratic residues are widely used in number theory.

## In rings in general

The squaring function is defined in any ring. Depending on the ring, it may have different properties that are sometimes used to classify rings.

Zero may be the square of some non-zero elements. A commutative ring such that the square of a non zero element is never zero is called a reduced ring. More generally, in a commutative ring, a radical ideal is an ideal I such that $x^2 \in I$ implies $x \in I$. Both notions are important in algebraic geometry, because of Hilbert's Nullstellensatz.

An element of a ring that is equal to its square is called an idempotent. In any ring, 0 and 1 are idempotents. There are no other idempotents in fields and more generally in integral domains. Also, each element of an integral domain has no more than 2 square roots due to the difference of two squares identity:[2] if u2v2 = 0, then u = v or u + v = 0, where the latter means that two roots are mutually additive inverse.

The ring of the integers modulo n has 2k idempotents, where k is the number of distinct prime factors of n.

A commutative ring in which every element is equal to its square (every element is idempotent) is called a Boolean ring. The Boolean rings play an important role in computer science.

In a supercommutative algebra (away from 2), the square of any odd element equals to zero.

## In geometry and linear algebra

There are several major uses of the squaring function in geometry.

The name of the squaring function shows its importance in the definition of the area: it comes from the fact that the area of a square with sides of length  l is equal to l2. The area depends quadratically on the size: the area of a shape n times larger is n2 times greater. The inverse-square law is a manifestation of quadratic dependence of area of the sphere to its radius.

Frenel's zone plates have rings with equally spaced squared distances to the center

The squaring function is related to distance through the Pythagorean theorem and its generalization, the parallelogram law. Euclidean distance is not a smooth function, nor are any of its odd powers C-smooth. It is the square of distance (denoted d2 or r2) which is a smooth and analytic function. The dot product of a Euclidean vector with itself is equal to the square of its length: vv = v2. This is further generalised to quadratic forms in linear spaces. The inertia tensor in mechanics is an example of a quadratic form. It demonstrates a quadratic relation of the moment of inertia to the size (length).

### Under function composition

In linear algebra, a projection is a function from a vector space into itself which is equal to its square (under function composition). The usual projections of geometry are special cases of this general notion.

The functions from a vector space to itself whose squares are the identity function are called involutions. They constitute an important class of symmetries in geometry, which contains the reflections.

## In complex analysis

The composition of the tiling Image:ConformId.jpg (understood as a function on the complex plane) with the complex square function

The complex square function z2 is a twofold cover of the complex plane, such that each non-zero complex number has exactly two square roots. This map is related to parabolic coordinates.

Another, more well known, function is the square of the absolute value | z |2 = zz, which is real-valued. It is very important for quantum mechanics: see probability amplitude and Born rule. On the complex plane this function equals to the square of the distance to 0 discussed above.

## Other uses

Squares are ubiquitous in algebra, more generally, in almost every branch of mathematics, and also in physics where many units are defined using squares and inverse squares: see below.

Least squares is the standard method used with overdetermined systems.

Squaring is used in statistics and probability theory in determining the standard deviation of a set of values, or a random variable. The deviation of each value xi from the mean $\overline{x}$ of the set is defined as the difference $x_i - \overline{x}$. These deviations are squared, then a mean is taken of the new set of numbers (each of which is positive). This mean is the variance, and its square root is the standard deviation. In finance, the volatility of a financial instrument is the standard deviation of its values.

Algebraic
Other

## Footnotes

1. ^ Algebraic structures with "+", "−" and "⋅" include, but are not limited to rings (such as various number systems) and inner product spaces (such as Euclidean vector space or Hilbert space). These examples show all prominent properties of the squaring function, such as its algebraic identities.
2. ^ The u2v2 = (uv)(u + v) identity is provided by commutativity of multiplication in an integral domain.