Square (algebra)

In mathematics, a square is the result of multiplying a number by itself. The verb "to square" is used to denote this operation. Squaring is the same as raising to the power 2, and is denoted by a superscript 2; for instance, the square of 3 may be written as 32, which is the number 9.
In some cases when superscripts are not available, as for instance in programming languages or plain text files, the notations "x"^2 or "x"**2 may be used in place of "x"2.
The adjective which corresponds to squaring is "quadratic".
The square of an integer may also be called a square number or a perfect square. In algebra, the operation of squaring is often generalized to polynomials, other expressions, or values in systems of mathematical values other than the numbers. For instance, the square of the linear polynomial is the quadratic polynomial .
One of the important properties of squaring, for numbers as well as in many other mathematical systems, is that (for all numbers ), the square of is the same as the square of its additive inverse . That is, the square function satisfies the identity . This can also be expressed by saying that the square function is an even function.
In real numbers.
The squaring operation defines a real function called the ' or the '. Its domain is the whole real line, and its image is the set of nonnegative real numbers.
The square function preserves the order of positive numbers: larger numbers have larger squares. In other words, the square is a monotonic function on the interval . On the negative numbers, numbers with greater absolute value have greater squares, so the square is a monotonically decreasing function on . Hence, zero is the (global) minimum of the square function.
The square of a number is less than (that is ) if and only if , that is, if belongs to the open interval . This implies that the square of an integer is never less than the original number .
Every positive real number is the square of exactly two numbers, one of which is strictly positive and the other of which is strictly negative. Zero is the square of only one number, itself. For this reason, it is possible to define the square root function, which associates with a non-negative 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. The lack of real square roots for the negative numbers can be used to expand the real number system to the complex numbers, by postulating the imaginary unit , 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 a real closed field, which is an ordered field such that every non-negative element is a square and every polynomial of odd degree has a root. The real closed fields cannot 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 geometry.
There are several major uses of the square function in geometry.
The name of the square 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   is equal to . The area depends quadratically on the size: the area of a shape  times larger is  times greater. This holds for areas in three dimensions as well as in the plane: for instance, the surface area of a sphere is proportional to the square of its radius, a fact that is manifested physically by the inverse-square law describing how the strength of physical forces such as gravity varies according to distance.
The square function is related to distance through the Pythagorean theorem and its generalization, the parallelogram law. Euclidean distance is not a smooth function: the three-dimensional graph of distance from a fixed point forms a cone, with a non-smooth point at the tip of the cone. However, the square of the distance (denoted or ), which has a paraboloid as its graph, is a smooth and analytic function.
The dot product of a Euclidean vector with itself is equal to the square of its length: . This is further generalised to quadratic forms in linear spaces via the inner product. 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).
There are infinitely many Pythagorean triples, sets of three positive integers such that the sum of the squares of the first two equals the square of the third. Each of these triples gives the integer sides of a right triangle.
In abstract algebra and number theory.
The square function is defined in any field or ring. An element in the image of this function is called a "square", and the inverse images of a square are called "square roots".
The notion of squaring is particularly important in the finite fields Z/"pZ formed by the numbers modulo an odd prime number . A non-zero element of this field is called a quadratic residue if it is a square in Z/"pZ, and otherwise, it is called a quadratic non-residue. Zero, while a square, is not considered to be a quadratic residue. Every finite field of this type has exactly quadratic residues and exactly quadratic non-residues. The quadratic residues form a group under multiplication. The properties of quadratic residues are widely used in number theory.
More generally, in rings, the square function 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  such that formula_1 implies formula_2. Both notions are important in algebraic geometry, because of Hilbert's Nullstellensatz.
An element of a ring that is equal to its own 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. However, 
the ring of the integers modulo  has idempotents, where is the number of distinct prime factors of .
A commutative ring in which every element is equal to its square (every element is idempotent) is called a Boolean ring; an example from computer science is the ring whose elements are binary numbers, with bitwise AND as the multiplication operation and bitwise XOR as the addition operation.
In a totally ordered ring, for any . Moreover,  if and only if .
In a supercommutative algebra where 2 is invertible, the square of any "odd" element equals to zero.
If "A" is a commutative semigroup, then one has
In the language of quadratic forms, this equality says that the square function is a "form permitting composition". In fact, the square function is the foundation upon which other quadratic forms are constructed which also permit composition. The procedure was introduced by L. E. Dickson to produce the octonions out of quaternions by doubling. The doubling method was formalized by A. A. Albert who started with the real number field ℝ and the square function, doubling it to obtain the complex number field with quadratic form , and then doubling again to obtain quaternions. The doubling procedure is called the Cayley–Dickson construction, and has been generalized to form algebras of dimension 2n over a field "F" with involution.
The square function "z"2 is the "norm" of the composition algebra ℂ, where the identity function forms a trivial involution to begin the Cayley–Dickson constructions leading to bicomplex, biquaternion, and bioctonion composition algebras.
In complex numbers and related algebras over the reals.
The complex square function  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.
The absolute square of a complex number is the product involving its complex conjugate;
it can also be expressed in terms of the complex modulus or absolute value, .
It can be generalized to vectors as the complex dot product.
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  from the mean formula_4 of the set is defined as the difference formula_5. 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.