Let $-D < 0$ be a negative fundamental discriminant and let $y$ range over the values $y = y\_Q = \frac{\sqrt{|D|}}{2a}$, as the values $(a,b,c)$ run through the reduced binary quadratic forms $Q = aX^2+bXY+cY^2$ of discriminant $b^2-4ac = -D$ (thus $\mathrm{gcd}(a,b,c) = 1$, $-a < b \leq a \leq c$). Those are the ordinates of the CM points $z\_Q = \frac{b + \sqrt{-D}}{2a}$ in the standard fundamental domain for $\mathcal{H} / \mathrm{PSL}(2,\mathbb{Z})$. 


By Duke's theorem, the $z\_Q$ are equidistributed in the measure $\frac{3}{\pi} \frac{dx \, dy}{y^2}$. The highest lying point has ordinate $k := \sqrt{|D|}/2$, and if $\varphi: [1,\infty) \to \mathbb{R}$ is any compactly supported or fast enough decaying function, it follows that the mean value of $\varphi(\frac{\pi}{3}y\_Q)$ (over all reduced forms $Q$ if the given discriminant $-D$) is equal to $\int\_1^k \varphi(t) \frac{dt}{t^2} + o\_{\varphi}(1)$, as $D \to \infty$. The asymptotic $\mathrm{Avg}\_Q \varphi(\frac{\pi}{3}y\_Q) \sim \int\_1^k 
\varphi(t) \frac{dt}{t^2}$ turns out to be also satisfied for $\varphi(t) = t$ (assuming $L(s,\chi\_D)$ satisfies the Riemann hypothesis), for a very special reason: the Kronecker-Chowla-Selberg limit formula expresses 
$$
\mathrm{Avg}\_Q \big(\frac{\pi}{3} y\_Q - \log{y\_Q} \big) = \log{k} + \frac{L'}{L}(1,\chi\_D) + O(1),
$$
with an absolutely bounded $O(1)$ term.


On the other hand it is plain that $\mathrm{Avg}\_Q \varphi(\frac{\pi}{3}y\_Q) \sim \int\_1^k 
\varphi(t) \frac{dt}{t^2}$ fails to hold with $\varphi(t) = t^{1+\epsilon}$, for any fixed $\epsilon > 0$: already the principal form (with $a = 1$) contributes an $\sim k^{\epsilon} \frac{k}{h}$ to this average ($h$ denoting the class number), a contribution that can be as big as $k^{\epsilon} \log{\log{k}}$.


I am interested in what happens for $\varphi(t) = t\log{t}$.


**Question.** *Assume GRH, and possibly some other standard analytic hypotheses. What can be said about the mean value of $\frac{\pi}{3} y\_Q \log{y\_Q}$*, asymptotically as $D \to \infty$?


Evidently this mean value lies somewhere between $\log{k}$ and $(\log{k})^2$. Should the limit $\lim\_{D \to \infty} \mathrm{Avg}\_Q(y\_{Q}\log{y\_Q}) \big/ (\log{k})^2$ even exist?


[Of course, the same question could be asked for the positive discriminants (indefinite binary quadratic forms and closed geodesics on the modular surface). ] 



The mean value of $y \log{y}$ over the ordinates of the CM points
Let $g : \Gamma \backslash \mathbb{H} \to \mathbb{C}$ be any bounded continuous function. Duke's theorem states that
\[\frac{1}{h(D)} \sum\_{A \in \mathrm{Cl}\_K} g(z\_A) = \frac{1}{\mathrm{vol}(\Gamma \backslash \mathbb{H})} \int\_{\Gamma \backslash \mathbb{H}} g(z) \, d\mu(z) + o\_g(1)\]
as $D \to -\infty$ through negative fundamental discriminants, where $h(D) = \# \mathrm{Cl}\_K$ the class number of $K = \mathbb{Q}(\sqrt{D})$, $\mathrm{Cl}\_K$ the class group, and $d\mu(z) = \frac{dx \, dy}{y^2}$ the $\mathrm{SL}\_2(\mathbb{R})$-invariant measure on the upper half-plane $\mathbb{H}$.


The proof uses the spectral decomposition
\[g(z) = \frac{\langle g, 1\rangle}{\mathrm{vol}(\Gamma \backslash \mathbb{H})} + \sum\_{f \in \mathcal{B}\_0(\Gamma)} \langle g, f \rangle f(z) + \frac{1}{4\pi} \int\_{-\infty}^{\infty} \left\langle g, E\left(\cdot, \frac{1}{2} + it\right)\right\rangle E\left(z, \frac{1}{2} + it\right) \, dt,\]
where $\mathcal{B}\_0(\Gamma)$ denotes an orthonormal basis of Hecke-Maass cusp forms and $E(z,s)$ denotes the real-analytic Eisenstein series.


We want to take $g(z) = y \log y$, but this is of course not square-integrable with respect to $d\mu(z)$. The trick is to let $g\_s(z) = y^s \log y$ and $G\_s(z) = g\_s(z) - \frac{\partial}{\partial s} E(z,s)$ with $\Re(s) > 1/2$ and $s \neq 1$. Then $G\_s(z)$ *is* square-integrable, with
\[g\_s(z) = \frac{\partial}{\partial s} E(z,s) + \frac{\langle G\_s, 1\rangle}{\mathrm{vol}(\Gamma \backslash \mathbb{H})} + \sum\_{f \in \mathcal{B}\_0(\Gamma)} \langle G\_s, f \rangle f(z) + \frac{1}{4\pi} \int\_{-\infty}^{\infty} \left\langle G\_s, E\left(\cdot, \frac{1}{2} + it\right)\right\rangle E\left(z, \frac{1}{2} + it\right) \, dt.\]


It is clear that $\langle G\_s, f\rangle = \langle g\_s, f\rangle$. Using Zagier's method of renormalisation of integrals, one can show that
\[\langle G\_s, 1\rangle = \int\_{\sqrt{3}/2}^{1} y^{s - 2} \log y \left(1 - 2\sqrt{1 - y^2}\right) \, dy + \frac{1}{(s - 1)^2},\]
and that
\[\left\langle G\_s, E\left(\cdot, \frac{1}{2} + it\right)\right\rangle = 0.\]
(Both of these are somewhat nontrivial to show, however.) It follows by analytic continuation that
\[g(z) = \lim\_{s \to 1} \left(\frac{\partial}{\partial s} E(z,s) + \frac{1}{\mathrm{vol}(\Gamma \backslash \mathbb{H}) (s - 1)^2}\right) + C + \sum\_{f \in \mathcal{B}\_0(\Gamma)} \langle g, f \rangle f(z),\]


where
\[C = \frac{1}{\mathrm{vol}(\Gamma \backslash \mathbb{H})} \int\_{\sqrt{3}/2}^{1} y^{-1} \log y \left(1 - 2\sqrt{1 - y^2}\right) \, dy \approx -0.00181698.\]


Now we let $z = z\_A$ and sum over all $A \in \mathrm{Cl}\_K$. Then the sum over $f \in \mathcal{B}\_0(\Gamma)$ is $O((-D)^{1/2 - \delta})$ for some $\delta > 0$ via the period formula for Hecke-Maass cusp forms at Heegner points and subconvexity bounds for $L(1/2,f \otimes \chi\_D)$. Next, we have that
\[\sum\_{A \in \mathrm{Cl}\_K} E(z\_A,s) = \frac{w\_K}{2} \frac{\Lambda\_K(s)}{\Lambda(2s)},\]
where $w\_K = \# \mathcal{O}\_{K,\mathrm{tors}}^{\times}$ (which is equal to $2$ for $D \leq -4$), $\Lambda\_K(s) = (2\pi)^{-s} \Gamma(s) \zeta(s) L(s,\chi\_D)$, and $\Lambda(2s) = \pi^{-s} \Gamma(s) \zeta(2s)$. We may rewrite this as
\[\frac{w\_K \sqrt{-D}}{4} \frac{\exp\left((s - 1) \log \frac{\sqrt{-D}}{2}\right) \zeta(s) L(s,\chi\_D)}{\zeta(2s)}.\]
This has a simple pole at $s = 1$ with residue
\[\frac{3}{\pi} \frac{w\_K \sqrt{-D} L(1,\chi\_D)}{2\pi} = \frac{h(D)}{\mathrm{vol}(\Gamma \backslash \mathbb{H})}\]
by the class number formula. It follows that if $C' = C'(D)$ denotes the coefficient of $s - 1$ in the Laurent expansion of this, then
\[\sum\_{A \in \mathrm{Cl}\_K} g(z\_A) = C' + C h(D) + O((-D)^{1/2 -\delta}).\]
The main term from $C'$ is
\[\frac{3}{\pi} \frac{w\_K \sqrt{-D} L(1,\chi\_D)}{2\pi} \frac{1}{2} \left(\log \frac{\sqrt{-D}}{2}\right)^2 = \frac{h(D)}{\mathrm{vol}(\Gamma \backslash \mathbb{H})} \frac{1}{2} \left(\log \frac{\sqrt{-D}}{2}\right)^2.\]
To prove that the remaining terms in $C'$ are smaller requires bounds of the form
\[\frac{L'}{L}(1,\chi\_D) = o(\log (-D)), \quad \frac{L''}{L}(1,\chi\_D) = o((\log (-D))^2).\]
Such bounds certainly follow from the generalised Riemann hypothesis, though I don't believe they are known unconditionally.




---


I should mention that this method works more generally for $g(y) = y (\log y)^m$ with $m$ a nonnegative integer, in which case you need to take $m$-th derivatives with respect to $s$, or even more generally for $g(y) = y^s (\log y)^m$ with $s \neq 1$, in which case you no longer need to take limits, but $h(D)$ will no longer naturally appear in the main term, so the answer may fluctuate wildly depending on the size of $L^{(k)}(s,\chi\_D)/L(1,\chi\_D)$ for $0 \leq k \leq m + 1$.


