Dirichlet's divisor problem via Lambert series In Über die Bestimmung asymptotischer Gesetze in der 
Zahlentheorie, Dirichlet proved his theorem on the asymptotic
behaviour of the divisor function using a Lambert series: let 
$d_n = d(n)$ denote the number of the divisors of $n$; then 
Lambert (actually this is due to Euler) observed that
$$ f(z) = \sum_{n=1}^\infty d_n z^n 
        = \sum_{n=1}^\infty  \frac{z^n}{1-z^n} . $$
This series converges for $|z| < 1$, and diverges for $z = 1$.
Setting $z = e^{-t}$ we obtain
$$ g(t) = \sum_{n=1}^\infty  \frac{e^{-nt}}{1-e^{-nt}}
        = \sum_{n=1}^\infty  \frac{1}{e^{nt}-1} . $$
Dirichlet writes that "expressing this series by a definite integral
one easily finds" that 
$$ g(t) \sim \frac1t \log \frac1t + \frac{\gamma}t $$
as $t \to 0$, where $\gamma$ is Euler's constant. 
Dirichlet then claims that the asymptotic behaviour of $g(t)$
would imply that $d_n$ is, on the average, equal to $\log n + 2 \gamma$,
which in turn implies that 
$b_1 + b_2 + \ldots + b_n \approx (n + \frac12) \log n + (2\gamma+1)n. $
He mentions that he has used the integral expressions for $\Gamma(k)$
and its derivative $\Gamma'(k)$ for deriving the first property.
Knopp (Über Lambertsche Reihen, J. Reine Angew. Math. 142) claims 
that Dirichlet's proof was "heuristic". I find that hard to believe, 
and I am convinced that Dirichlet's sketch can be turned into a valid 
proof by someone who knows the tools of the trade. 
So here are my questions:


*

*How did Dirichlet express "this series by a definite integral" and 
derive the asymptotic expression for $g(t)$?
Let me remark that Endres and Steiner (A new proof of the Voronoi 
summation formula) use Voronoi summation for proving the sharper estimate
$$  g(t) \sim \frac1t \log \frac1t + \frac{\gamma}t + \frac14 + O(t) $$
as $t \to 0$. But this is not "easily found".

*How did Dirichlet transform his knowledge about the asymptotic
behaviour of $\sum b_n e^{-nt}$ as $t \to 0$ into an average
behaviour of $b_n$? This smells like a Tauberian result, but I'm not
fluent enough in analytic number theory to see how easy this is.
 A: For part 1 of the question, he would most likely have used the Euler-Maclaurin summation formula 
$$
\sum_{n=1}^{\infty}\frac{1}{e^{nt} - 1} = \int_{1}^{\infty}\frac{dx}{e^{xt} - 1} + 
\frac{1}{2}\frac{1}{e^t - 1} + \int_{1}^{\infty}S(x)\left(\frac{d}{dx}\frac{1}{e^{xt} - 1}\right)dx
$$
with $S(x)$ the sawtooth function. It is easy to obtain the leading term, because it comes from the first integral 
$$
\int_{1}^{\infty}\frac{dx}{e^{xt} - 1} = \frac{1}{t}\int_{t}^{\infty}\frac{du}{e^u - 1}
$$
by the change of variable $u = xt$. We have 
$$
\int_{t}^{\infty}\frac{du}{e^u - 1} = \int_{t}^{1}\frac{du}{e^u - 1} + \int_{1}^{\infty}\frac{du}{e^u - 1},
$$
and 
$$
\frac{1}{e^u - 1} = \frac{1}{u} + \left(\frac{1}{e^u - 1} - \frac{1}{u}\right)
$$
on $0 \leq u \leq 1$, so that 
$$
g(t) = \frac{1}{t}\log\left(\frac{1}{t}\right) + O\left(\frac{1}{t}\right).
$$
But to get the second term looks harder, for the integral with the sawtooth function contributes to that term. To go further, one can integrate by parts in that integral, which is the standard approach, or write it as a sum of integrals over the 
intervals from $n$ to $n+1$. Also the sawtooth function has a simple Fourier expansion, which may help. I should remark that the integral with the sawtooth function is $O(1/t)$ as one sees when bounding it by passing the absolute value under the integral sign and using $|S(x)| \leq 1/2$. Anyway, I am pretty sure that part 1 is doable with some work.
Part 2 looks trickier. The Lambert series expansion
$$
\sum_{n=1}^{\infty}(1 + \mu(n))e^{-nt} = \frac{e^{-t}}{1 - e^{-t}} + e^{-t} = 
\frac{1}{t} + \frac{1}{2} + O(|t|)
$$
is a little nicer than the one for the divisor function; not only are the coefficients nonnegative, but they are also bounded. Supposing that we have a Tauberian theorem strong enough to yield 
$$
\sum_{n \leq x}(1 + \mu(n)) \sim x,
$$
we would then have proved the Prime Number Theorem from the Lambert series. It seems a little unlikely that Dirichlet had such a strong Tauberian theorem; would he not have proved the Prime Number Theorem if he had? Of course, this argument by analogy is not conclusive, since the two 
situations differ by a factor of $\log(x)$.
We shall never know what argument Dirichlet had, and he may have found an approach that 
did not use a Tauberian theorem, perhaps exploiting special properties of the divisor function. It is worth noting that Voronoi's first proof of the error term $O(x^{1/3}\log(x))$ for the divisor problem was based on the Euler-Maclaurin summation formula.
A: I'm 99% sure this is what Dirichlet did :
$$g(t) = \sum_{n=1}^\infty d_n e^{-nt}$$
with $\Gamma(s) n^{-s} = \int_0^\infty t^{s-1} e^{-nt} dt$ we get
$$\Gamma(s)\zeta(s)^2 = \int_0^\infty t^{s-1} g(t) dt$$
the LHS has a dominating pole at $s = 1$ where $\Gamma(s) \sim 1-\gamma\,(s-1)$ and $\zeta(s) \sim \frac{1}{s-1}+\gamma$ and$$\Gamma(s)\zeta(s)^2 \sim \frac{1}{(s-1)^2} + \frac{\gamma}{s-1}$$
so that 
$$\Gamma(s)\zeta(s)^2-\frac{1}{(s-1)^2} - \frac{\gamma}{s-1}=\int_0^\infty t^{s-1} (g(t)+\log t\frac{1_{t < 1} }{t}- \gamma\frac{ 1_{t < 1}}{t} )dt$$
is holomorphic on $Re(s) \ge 1$, i.e. as $t \to 0^+$ :
$$g(t) = \frac{- \log t}{t}+\frac{ \gamma}{t} + o(t^{-1})$$
