TITLE: Estimate for $\sum_{a=1}^{p-1}\sum_{b=1}^{p-1}\frac{b}{a(ab)_p}$, where $p$ is a large prime
QUESTION [9 upvotes]: Is this estimate true? Can anyone give a proof of it?
$$
\sum_{a=1}^{p-1}\sum_{b=1}^{p-1}\frac{b}{a(ab)_p}=\frac{1}{2}p\ln^2 p+o(p\ln^2 p)\qquad (p\text{ prime, } p\to\infty)
$$
where $
(ab)_p\equiv ab\;(\operatorname{mod}p)$, $0<(ab)_p<p$.

REPLY [3 votes]: Not an answer, but an argument that your sum is between $(1/4+o(1))p\log^2(p)$ and $(3/4+o(1))p\log^2(p)$.
Write $S(p)$ for your sum. Separate the sum into pieces according to the integer part of $(ab/p)$:
$$
\begin{align*}
S(p)&=\sum_{a=1}^{p-1}\frac{1}{a}\sum_{k=0}^{a-1} \sum_{kp/a<b<(k+1)p/a} \frac{b}{ab-kp}\\
&\sim\sum_{a=1}^{p-1}\frac{1}{a}\sum_{k=0}^{a-1} \frac{kp}{a}\sum_{kp/a<b<(k+1)p/a} \frac{1}{ab-kp}.\\
\end{align*}
$$
The innermost sum is the sum of reciprocals of integers in an arithmetic progression. The first term in the progression is $(-pk)_a$, and the sum of the reciprocals of the other terms in the progression is $\log(p/a)/a+O(1/a)$, so
$$
\begin{align*}
S(p)&\sim\sum_{a=1}^{p-1}\frac{1}{a}\sum_{k=0}^{a-1} \frac{kp}{a}\left[\frac{1}{(-pk)_a}+\frac{1}{a}\log\left(\frac{p}{a}\right)\right]\\
&=p\sum_{a=1}^{p-1}\frac{1}{a^3}\log(p/a)\sum_{k=0}^{p-1}k+p\sum_{a=1}^{p-1}\frac{1}{a^2}\sum_{k=1}^{a-1}\frac{k}{(-pk)_a}\\
&=\frac{1}{4}p\log^2(p)+p\sum_{a=1}^{p-1}\frac{1}{a^2}\sum_{k=1}^{a-1}\frac{k}{(-pk)_a}.
\end{align*}
$$
This gives the claimed lower bound for $S(p)$. For the upper bound, we observe that for fixed $a$, we have $\{(-pk)_a:1\leq k\leq a-1\}=
\{1,\ldots,a-1\}$. So an upper bound for the second term above is
$$
p\sum_{a=1}^{p-1}\frac{1}{a^2}\sum_{k=1}^{a-1}\frac{k}{a-k}\sim \frac{1}{2}p\log^2(p).
$$