Quadratic integer

In number theory, quadratic integers are a generalization of the integers to quadratic fields. Quadratic integers are algebraic integers of degree two, that is, solutions of equations of the form 
with and (usual) integers. When algebraic integers are considered, the usual integers are often called "rational integers".
Common examples of quadratic integers are the square roots of rational integers, such as , and the complex number , which generates the Gaussian integers. Another common example is the non-real cubic root of unity , which generates the Eisenstein integers.
Quadratic integers occur in the solutions of many Diophantine equations, such as Pell's equations, and other questions related to integral quadratic forms. The study of rings of quadratic integers is basic for many questions of algebraic number theory.
History.
Medieval Indian mathematicians had already discovered a multiplication of quadratic integers of the same , which allowed them to solve some cases of Pell's equation.
The characterization given in of the quadratic integers was first given by Richard Dedekind in 1871.
Definition.
A quadratic integer is an algebraic integer of degree two. More explicitly, it is a complex number formula_1, which solves an equation of the form , with "b" and "c" integers. Each quadratic integer that is not an integer is not rational—namely, it's a real irrational number if and non-real if —and lies in a uniquely determined quadratic field formula_2, the extension of formula_3 generated by the square-root of the unique square-free integer that satisfies for some integer . If is positive, the quadratic integer is real. If D < 0, it is "imaginary" (that is complex and nonreal).
The quadratic integers (including the ordinary integers), which belong to a quadratic field formula_2, form an integral domain called the "ring of integers of" formula_5
Although the quadratic integers belonging to a given quadratic field form a ring, the set of "all" quadratic integers is not a ring because it is not closed under addition or multiplication. For example, formula_6 and formula_7 are quadratic integers, but formula_8 and formula_9 are not, as their minimal polynomials have degree four.
Explicit representation.
Here and in the following, the quadratic integers that are considered belong to a quadratic field formula_10 where is a square-free integer. This does not restrict the generality, as the equality (for any positive integer ) implies formula_11
An element of formula_2 is a quadratic integer if and only if there are two integers and such that either 
or, if is a multiple of 
In other words, every quadratic integer may be written , where and  are integers, and where is defined by:
(as has been supposed square-free the case formula_16 is impossible, since it would imply that D would be divisible by the square 4).
Norm and conjugation.
A quadratic integer in formula_2 may be written 
where and  are either both integers, or, only if , both halves of odd integers. The norm of such a quadratic integer is 
The norm of a quadratic integer is always an integer. If , the norm of a quadratic integer is the square of its absolute value as a complex number (this is false if ). The norm is a completely multiplicative function, which means that the norm of a product of quadratic integers is always the product of their norms.
Every quadratic integer has a conjugate
A quadratic integer has the same norm as its conjugate, and this norm is the product of the quadratic integer and its conjugate. The conjugate of a sum or a product of quadratic integers is the sum or the product (respectively) of the conjugates. This means that the conjugation is an automorphism of the ring of the integers of formula_2—see , below.
Quadratic integer rings.
Every square-free integer (different from 0 and 1) defines a quadratic integer ring, which is the integral domain consisting of the algebraic integers contained in formula_20 It is the set where formula_21 if , and otherwise. It is often denoted formula_22, because it is the ring of integers of ), which is the integral closure of in formula_20 The ring consists of all roots of all equations whose discriminant is the product of by the square of an integer. In particular belongs to , being a root of the equation , which has as its discriminant. 
The square root of any integer is a quadratic integer, as every integer can be written , where is a square-free integer, and its square root is a root of .
The fundamental theorem of arithmetic is not true in many rings of quadratic integers. However, there is a unique factorization for ideals, which is expressed by the fact that every ring of algebraic integers is a Dedekind domain. Being the simplest examples of algebraic integers, quadratic integers are commonly the starting examples of most studies of algebraic number theory.
The quadratic integer rings divide in two classes depending on the sign of . If , all elements of formula_22 are real, and the ring is a "real quadratic integer ring". If , the only real elements of formula_22 are the ordinary integers, and the ring is a "complex quadratic integer ring". 
For real quadratic integer rings, the class number, which measures the failure of unique factorization, is given in OEIS A003649; for the imaginary case, they are given in OEIS A000924.
Units.
A quadratic integer is a unit in the ring of the integers of formula_2 if and only if its norm is or . In the first case its multiplicative inverse is its conjugate. It is the negation of its conjugate in the second case.
If , the ring of the integers of formula_2 has at most six units. In the case of the Gaussian integers (), the four units are . In the case of the Eisenstein integers (), the six units are . For all other negative , there are only two units, which are and .
If , the ring of the integers of formula_2 has infinitely many units that are equal to , where is an arbitrary integer, and is a particular unit called a "fundamental unit". Given a fundamental unit , there are three other fundamental units, its conjugate formula_29 and also formula_30 and formula_31 Commonly, one calls "the" fundamental unit, the unique one which has an absolute value greater than 1 (as a real number). It is the unique fundamental unit that may be written as , with and positive (integers or halves of integers).
The fundamental units for the 10 smallest positive square-free are , , (the golden ratio), , , , , , , . For larger , the coefficients of the fundamental unit may be very large. For example, for , the fundamental units are respectively 
, and .
Examples of complex quadratic integer rings.
For  < 0, ω is a complex (imaginary or otherwise non-real) number. Therefore, it is natural to treat a quadratic integer ring as a set of algebraic complex numbers.
Both rings mentioned above are rings of integers of cyclotomic fields Q(ζ4) and Q(ζ3) correspondingly.
In contrast, Z[] is not even a Dedekind domain.
Both above examples are principal ideal rings and also Euclidean domains for the norm. This is not the case for 
which is not even a unique factorization domain. This can be shown as follows.
In formula_35 we have
The factors 3, formula_37 and formula_38 are irreducible, as they have all a norm of 9, and if they were not irreducible, they would have a factor of norm 3, which is impossible, the norm of an element different of being at least 4. Thus the factorization of 9 into irreducible factors is not unique.
The ideals formula_39 and formula_40 are not principal, as a simple computation shows that their product is the ideal generated by 3, and, if they were principal, this would imply that 3 would not be irreducible.
Examples of real quadratic integer rings.
For , is a positive irrational real number, and the corresponding quadratic integer ring is a set of algebraic real numbers. The solutions of the Pell's equation , a Diophantine equation that has been widely studied, are the units of these rings, for . 
Principal rings of quadratic integers.
Unique factorization property is not always verified for rings of quadratic integers, as seen above for the case of . However, as for every Dedekind domain, a ring of quadratic integers is a unique factorization domain if and only if it is a principal ideal domain. This occurs if and only if the class number of the corresponding quadratic field is one.
The imaginary rings of quadratic integers that are principal ideal rings have been completely determined. These are formula_22 for 
This result was first conjectured by Gauss and proven by Kurt Heegner, although Heegner's proof was not believed until Harold Stark gave a later proof in 1967. (See Stark–Heegner theorem.) This is a special case of the famous class number problem.
There are many known positive integers , for which the ring of quadratic integers is a principal ideal ring. However, the complete list is not known; it is not even known if the number of these principal ideal rings is finite or not.
Euclidean rings of quadratic integers.
When a ring of quadratic integers is a principal ideal domain, it is interesting to know whether it is a Euclidean domain. This problem has been completely solved as follows.
Equipped with the norm
formula_42 as a Euclidean function,
formula_22 is a Euclidean domain for negative when 
and, for positive , when 
There is no other ring of quadratic integers that is Euclidean with the norm as a Euclidean function.
For negative , a ring of quadratic integers is Euclidean if and only if the norm is a Euclidean function for it. It follows that, for 
the four corresponding rings of quadratic integers are among the rare known examples of principal ideal domains that are not Euclidean domains.
On the other hand, the generalized Riemann hypothesis implies that a ring of "real" quadratic integers that is a principal ideal domain is also a Euclidean domain for some Euclidean function, which can indeed differ from the usual norm.
The values "D" = 14, 69 were the first for which the ring of quadratic integers was proven to be Euclidean, but not norm-Euclidean.