Factor . Its splitting field is . The first quadratic field is real, so it cannot contain the nonreal . Thus adjoining the second square root doubles the degree again. Independent sign changes of the two square roots give all four automorphisms, so
To prove existence, first multiply the elements of a rational basis by suitable nonzero integers to obtain an integral rational basis . Put . The trace pairing is nondegenerate in characteristic zero, and the matrix has integer entries and nonzero determinant . If is integral, all are integers, so . The adjugate formula gives . ConsequentlyA subgroup of a free abelian group is free, and these inclusions force rank . A -basis of is therefore an integral basis.
Now put and . The polynomial is irreducible by Eisenstein at any prime dividing the squarefree , except for , where is Eisenstein at . Thus and . Every has the unique form with . The nontrivial -automorphism sends to , so an integral has integral conjugate . Relative trace and norm of integral elements are integral in . Applying them to and taking the trace of givesThe power basis has discriminantIndeed, the resultant of and is ; the discriminant sign factor is . By the discriminant-index formula for an integral lattice, a prime dividing must divide .
No odd prime can divide this index. The Eisenstein equation gives , while has nonintegral field norm for and : its -adic norm valuation is . If were integral, multiplication by first forces ; subtracting and multiplying by forces . Continuing forces all coefficients divisible by . This excludes an index element of order .
To exclude , any index element of order two would be represented by an integralwith integers not all even. Here and . The integrality of forcesSince , the first congruence implies have the same parity. If both were odd, the second would require , impossible. Hence are even. The second congruence then forces to have the same parity, while the first forces even. Thus are even too, a contradiction. Therefore the index is one andFor the last request, let and take . It satisfies , and henceThis monic integer polynomial proves integrality. Its coordinates in the rational power basis have halves, so . Also with a nonzero coefficient in ; if were in that quadratic field, then would be too, contradicting degree four. Thus it meets both exclusions.
Represent by the pair in the quadratic field . Its multiplication rule isThe constructor copies both rational components, so later reduction through another pointer cannot change the constructed value:
PROCEDURE mkIrr(r,i: rational): irrational;
VAR z: irrational;
BEGIN
NEW(z);
z.rat := mkRat(r.num,r.den);
z.irr := mkRat(i.num,i.den);
RETURN z
END mkIrr;
PROCEDURE addIrr(x,y: irrational): irrational;
BEGIN
RETURN mkIrr(addRat(x.rat,y.rat),addRat(x.irr,y.irr))
END addIrr;
PROCEDURE mulIrr(x,y: irrational): irrational;
VAR r,i: rational;
BEGIN
r := addRat(mulRat(x.rat,y.rat),
mulRat(mkRat(5,1),mulRat(x.irr,y.irr)));
i := addRat(mulRat(x.rat,y.irr),mulRat(x.irr,y.rat));
RETURN mkIrr(r,i)
END mulIrr;The representation includes rational values when the second coefficient is zero; the supplied type name does not require every stored value to be irrational.
Ring of integers of a quadratic field Created 2026-09-24 Updated 2026-10-14
Let be a square-free integer, and let be the associated quadratic field. ThenThe pair is an integral basis. The field discriminant is in the first case and in the second. This statement requires to be a square-free integer: for example, but omits .[ref]
https://kconrad.math.uconn.edu/blurbs/gradnumthy/quadraticgrad.pdf. Conrad, Factoring in Quadratic Fields, Theorem 3.4
For , the integral basis is , and the field discriminant is . For , it is with , and the field discriminant is . The identity makes closed under multiplication. Since , the smaller order in a number field consists precisely of with even . This computes its index two and shows concretely why adjoining a square root does not always supply every algebraic integer.
In this second integral basis, the field norm isIn particular, and : the extra algebraic integer is also a unit. The units of the quadratic field Q square root of five describe all its powers.