Question about a lesser-known "class number formula" of Gauss My question refers to article 301 of section 5 of Gauss's D. A. - there Gauss gives an asymptotic formula for the mean number of classes of forms with positive discriminant ($D>0$):
$$h(D) = \frac{4}{\pi^2}\log (D) + \delta$$
where $\delta$ is the following constant:
$$\delta = \frac{8}{\pi^2}C+\frac{48}{\pi^4}\sum_{n=2}^{\infty}\frac{\log (n)}{n^2} - \frac{2 \log 2}{3\pi^2}$$
and $C$ is the Euler-Mascheroni constant. This formula is noteworthy because Gauss also evaluates the error term $\delta$ in this class formula. I tried to search on the web for references to this analytic result of Gauss but all I found is articles about his asymptotic class number formula for forms with negative discriminant ($D<0$), which Gauss gives in the next article of D. A. (article 302).
My question is mainly about getting a reference for this result of Gauss. If such a reference doesn't exist, I'll be glad to hear an expert opinion on the historic significance of this formula (Gauss did publish this formula; thereby it's plausible that it did have influence).
 A: Concerning the historic significance of Gauss's article 301: Marius Overholt traces back to this publication on the growth of class numbers the use of local averaging to study the growth of arithmetic functions.
A: I think the only detailed discussion of this particular result of Gauss is due to Dirichlet, and appears in his 1838 publication "on the use of infinite series in the theory of numbers", which is available on internet archive on p.376-391 of G. Lejeune Dirichlet's Werke. In fact, this publication of Dirichlet is discussed in a recent (2018) biography of Dirichlet (by Uta C. Merzbach), which cites the pages in Dirichlet's publication on Gauss's formula from D.A article 301:

Finally, Dirichlet observed that by the same kind of analysis he could find the formulas presented in article 301 of Gauss's beautiful work:

Suppose, for example, that it's a question of obtaining the mean number of genera for the determinant $-n$, a number which we shall denote by $F(n)$. If one compares art. 231 (of the D.A) where all the complete characters assignable a priori are enumerated, with art. 261 and 287, where the illustrius author showed that only half of these characters correspond to really existing genera, one could easily find (...) five equations (...) which (on appropriate summing and substituting), result in the asymptotic formula of the mean value of the number of genera for a determinant $-n$ as $$\frac{4}{\pi^2}(\mathbb{log (n)}+\frac{12C'}{\pi^2}+2C-\frac{1}{6}\mathbb{log (2)})$$
which coincides with the result of M. Gauss.


Looking at Dirichlet's relatively long reconstruction of Gauss's result, i gained the impression that this is one of those results where truly rigorous analytic methods were needed in it's derivation (this is also evident from the title of Dirichlet's memoir). I think this makes clear that, despite not giving a proof for this result (not even in his Nachlass), Gauss was fully aware of some equivalent form of Dirichlet's L-series technique; Gauss's formula is too precise, and therefore it cannot be assumed that he conjectured it on empirical basis. This might seem to contradict Gauss's own statement from art. 301, according to which he discovered this result after a long tables study - but i guess the "tables study" needs to be interpreted as a "semi-empirical derivation".
