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:


1. 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](http://www.uni-ulm.de/fileadmin/website_uni_ulm/nawi.inst.260/paper/10/tp10-1.pdf)) 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".
2. 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.



Dirichlet's divisor problem via Lambert series
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.


