Let
$r(B)$ be the number of integers $1 \leq n \leq B$ such that $n = x^2 + y^2$ for some $x, y \in \mathbb{Z}.$
Then it is a known theorem of Landau that
$$
r(B) \sim C \frac{B}{\sqrt{\log B}}
$$
for some $C > 0$. I was wondering if there is a generalization of this result for
slightly more general function $ax^2 + b y^2$ where $a, b$ are positive integers.
Thank you!

3$\begingroup$ it will turn out the same for positive form $a x^2 + b xy + c y^2,$ although the constant $C$ will change. In brief, there is a representation for some positive $n$ only when, for every prime $q$ with Legendre symbol $(b^2  4ac q) = 1, \; \; $ the exponent of prime $q$ in $n = q^e \cdot other $ is even. Actually, indefinite forms should work as well, as long as the discriminant is not square $\endgroup$– Will JagyMar 19 at 15:27

$\begingroup$ @WillJagy do you know a reference for the mentioned result? thank you $\endgroup$– Johnny T.Mar 19 at 15:41

2$\begingroup$ not exactly. At the end of Topics of Number Theory by LeVeque, volume 2 section 75, he does two squares with attention to detail. In my Dover reprint, two volumes in one, it is pages 257263. I also have two books on analytic number theory by Apostol, might be in there. $\endgroup$– Will JagyMar 19 at 15:48
1 Answer
The general result you seek is due to Paul Bernays, who studied under E. Landau in Göttingen and proved in his dissertation (1912) that $$\tag{$\star$}\sum_{n \le x} b_Q(n) \sim C_Q \frac{x}{\sqrt{\log x}}$$ as $x \to \infty$ where $Q(x,y)=ax^2+bxy+cy^2$ is a primitive positivedefinite binary quadratic form ($b^2−4ac<0$, $a>0$, $a,b,c \in \mathbb{Z}$) and $b_Q$ is the indicator function of integers representable as $Q(x,y)$ ($x,y \in \mathbb{Z}$). The constant $C_Q$ depends only on the discriminant of $Q$.
You want to apply it with $b=0$ (in the above notation); if $a,b$ (in your notation) are not coprime you need to first reduce to the primitive case before applying Bernays’ result. (E.g. if $Q_1$ and $Q_2$ are two binary quadratic form with the same discriminant, it does not necessarily follow that $\sum_{n \le x} b_{Q_1}(n) \sim \sum_{n \le x} b_{Q_2}(n)$ unless you first assume $Q_i$ are primitive.)
The dissertation is titled “Über die Darstellung von positiven, ganzen Zahlen durch die primitiven, binären quadratischen Formen einer nichtquadratischen Diskriminante”, and is available here.
Since the dissertation is in German, let me mention that there are two alternative proofs, giving rate of decay for the error term in $(\star)$.
R. W. K. Odoni in “On norms of integers in a full module of an algebraic number field and the distribution of values of binary integral quadratic forms” (Mathematika, Lond. 22, 108–111 (1975)) proved that $(\star)$ holds with a relative saving of $(\log x)^{c_Q}$ for some $c_Q>0$.
O. M. Fomenko, in “Distribution of values of Fourier coefficients for modular forms of weight 1” (J. Math. Sci., New York 89, No. 1, 1051–1071 (1998)) gave a third proof, that leads to formulas for $C_Q$ and $c_Q$. See section 2 of this paper for a useful overview of other results.