# Counting fundamental units of real quadratic fields

For a given real quadratic field $K$, the group of units of its ring of integers is $\mathcal{O}_K^{\times}\cong(\pm1)\times \mathbb{Z}$ by the Dirichlet unit theorem. For each $\mathcal{O}_K$, pick the fundamental unit as $\epsilon >1$, then $\epsilon=m\sqrt{d}+n$, where $m,n>0$ are integers or half integers. Now for a large variable $x>>1$, define the counting function $$u(x):=\sum_{1<\epsilon<x} 1,$$ where the sum is over all real quadratic fields.

Firstly the sum is finite, since by the above token, there are only finitely many $\epsilon=m\sqrt{d}+n$ with bounded absolute value as $d\rightarrow\infty$.

What asymptotic information is known about $u(x)$?

First, let's count

$$v(x) = \sum_{1 < \mu < x} 1$$

where $\mu$ ranges over every unit greater than $1$ of every real quadratic field.

Setting $\mu = m \sqrt{d} + n$, we require $n^2 - m^2 d = \pm 1$. Given that equation, the inequalities are equivalent:

$$1 < \mu < x \Longleftrightarrow 1 < n < \frac{x^2 \pm 1}{2x}$$

For each choice of half-integer $n$ and choice of sign, there is a unique solution for $m,d$ with $d$ a squarefree integer. This solution will have $m > 0$.

Consequently, we can count units simply by counting the number of half-integers $n$ and counting signs:

$$v(x) = 2x + O(1)$$

Another way to count every unit greater than $1$ is by observing it is a positive power of the fundamental unit. If we count them, their squares, their cubes, and so forth, we get:

$$v(x) = \sum_{k=1}^{\infty} \sum_{1 < \epsilon^k < x} 1 = \sum_{k=1}^{\infty} u(x^{1/k})$$

which we can reverse via inclusion-exclusion to get

$$u(x) = \sum_{k=1}^{\infty} \mu(k) v(x^{1/k})$$

and consequently,

$$u(x) = 2x - 2\sqrt{x} - 2\sqrt{x} + O(\sqrt{x})$$

• Thank you Hurkyl for this nice answer! But I do not think there should be the factor $\frac{1}{2}$. Oct 14, 2015 at 17:05
• @Dianbin: Basically, you just count all units of all real quadratic fields; every unit of magnitude greater than $1$ can be uniquely written as $\epsilon_d^b$ where $b > 0$ and $\epsilon_d$ is the fundamental unit of discriminant $d$. After thinking about it some more, I was right the first time and I shouldn't have included the $1/2$ factor.
– user13113
Oct 14, 2015 at 17:10
• @Dianbin: Better estimate up. I'm a little embarrassed of the previous one, since it's not often I actually make things a lot harder on myself when trying to make a crude estimate of things!
– user13113
Oct 15, 2015 at 4:35
• Thank you very much, this is exactly what I want. @Hurkyl Oct 15, 2015 at 12:27

In Proposition 4.1 of Sarnak you'll find an asymptotic for the related quantity (take there $p=1$) when one considers all ring discriminants (not just the fundamental field discriminants that you want). If restricted to field discriminants, the work of Raulf obtains such asymptotic formulae (see Lemma 5.1 in that paper). In both papers, the interest is in obtaining averages for the class number $h(d)$ when the discriminants are arranged according to the size of $\epsilon_d$.