In number theory, quadratic integers are a generalization of the rational integers to quadratic fields. These are algebraic integers of the degree 2. Important examples include the Gaussian integers and the Eisenstein integers. Though they have been studied for more than a hundred years, many open problems remain.

## Definition

Quadratic integers are solutions of equations of the form:

x2 + Bx + C = 0

for integers B and C. Such solutions have the form a + ω b, where a, b are integers, and where ω is defined by:

$\omega = \begin{cases} \sqrt{D} & \mbox{if }D \equiv 2, 3 \pmod{4} \\ {{1 + \sqrt{D}} \over 2} & \mbox{if }D \equiv 1 \pmod{4} \end{cases}$

(D is a square-free integer. Note that the case $D \equiv 0\pmod{4}$ is impossible, since it would imply that D is divisible by 4, a perfect square, which contradicts the fact that D is square-free.).

This characterization was first given by Richard Dedekind in 1871.[1][2]

The set of all quadratic integers is not closed even under addition. But for any fixed D the set of corresponding quadratic integers forms a ring, and it is these quadratic integer rings which are usually studied. Medieval Indian mathematicians had already discovered a multiplication of quadratic integers of the same D, which allows one to solve some cases of Pell's equation. The study of quadratic integers admits an algebraic version: the study of quadratic forms with integer coefficients.

Fixing a square-free integer D, the quadratic integer ring Z[ω] = { a + ω b : a, bZ}  is a subring of the quadratic field $\mathbf{Q}(\sqrt{D})$. Moreover, Z[ω] is the integral closure of Z in $\mathbf{Q}(\sqrt{D})$. In other words, it is the ring of integers $\mathcal{O}_{\mathbf{Q}(\sqrt{D})}$ of Q(D) and thus a Dedekind domain. The quadratic integer rings usually form the first class of examples on which one can build theories, inaccessible in the general case, for example the Kronecker–Weber theorem in class field theory, see below.

### Examples of complex quadratic integer rings

Gaussian integers
Eisenstein primes

For D < 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.

• A classic example is $\mathbf{Z}[\sqrt{-1}]$, the Gaussian integers, which was introduced by Carl Gauss around 1800 to state his biquadratic reciprocity law.[3]
• The elements in $\mathcal{O}_{\mathbf{Q}(\sqrt{-3})} = \mathbf{Z}\left[{{1 + \sqrt{-3}} \over 2}\right]$ are called Eisenstein integers.

Both rings mentioned above are rings of integers of cyclotomic fields Q4) and Q3) correspondingly. In contrast, Z[−3] is not even a Dedekind domain.

### Examples of real quadratic integer rings

For D > 0, ω is a positive irrational and the corresponding quadratic integer ring is a set of algebraic real numbers. Pell's equation X2DY2 = 1, a case of Diophantine equations, naturally leads to these rings for D ≡ 2, 3 (mod 4) . Algebraic study of real quadratic integer rings involves determining of the invertible elements group.

Powers of the golden ratio
• For D = 5, ω is the golden ratio. A non-negative real number belongs to the ring Z[(1+5)/2] if and only if it can be encoded in golden ratio base with finite number of 1's. This ring was studied by Peter Gustav Lejeune Dirichlet. Its invertible elements have the form ±ωn, where n is an arbitrary integer. This ring also arises from studying 5-fold rotational symmetry on Euclidean plane, for example, Penrose tilings.[4]
• Indian mathematician Brahmagupta treated the equation X261Y2 = 1, where the corresponding ring is Z[61]. Some results were presented to European community by Pierre Fermat in 1657.

### Class number

Equipped with the norm

$N(a + b\sqrt{D}) = a^2 - Db^2$,

$\mathcal{O}_{\mathbf{Q}(\sqrt{D})}$ is an Euclidean domain (and thus a unique factorization domain, UFD) when D = −1, −2, −3, −7, −11.[5] On the other hand, it turned out that Z[−5] is not a UFD because, for example, 6 has two distinct factorizations into irreducibles:

$6 = 2(3) = (1 + \sqrt{-5}) (1 - \sqrt{-5}).$

(In fact, Z[−5] has class number 2.[6]) The failure of the unique factorization led Ernst Kummer and Dedekind to develop a theory that would enlarge the set of “prime numbers”; the result was the notion of ideals and the decomposition of ideals by prime ideals (cf. splitting of prime ideals in Galois extensions).

Being a Dedekind domain, a quadratic integer ring is a UFD if and only if it is a principal ideal domain (i.e., its class number is one). However, there are quadratic integer rings that are principal ideal domains but not Euclidean domains. For example, Q[−19] has class number 1 but its ring of integers is not Euclidean.[6] There are effective methods to compute ideal class groups of quadratic integer rings, but many theoretical questions about their structure are still open after a hundred years.[when?]