TITLE: An integral that somehow equals pi^2/6 and involves dilogarithms?
QUESTION [8 upvotes]: I am attempting to show that
$$ \sum_{k \ge 1}^\infty {k^2 x^k \over (1+x^k)^2} \sim (1-x)^{-3} {\pi^2 \over 6} $$
as $x$ approaches 1 from below.  The sum can be approximated by the integral
$$ \int_0^\infty {k^2 x^k \over (1+x^k)^2} \: dk $$
and making the change of variable $u = x^k$ this is equal to
$$ {1 \over \log^3 x} \int_1^0 {\log^2 u \over (1+u)^2} \: du. $$
Maple tells me that this integral is equal to $\pi^2/6$.  Moreover if I try to find the same integral but with arbitrary rational numbers as bounds, it is successful: for example
$$ \int_{1/2}^2 {\log^2 u \over (1+u)^2} \: du = -4 \log 2 \log 3 + {7 \over 3} \log^2 2 - 2 dilog(3) + 2 dilog(3/2). $$
Specifically, I'd like to know:

How can I find the integral in the third displayed equation (or, really what I'm interested in, the sum in the first displayed equation)? 
How can I find the indefinite integral $\int \log^2 u / (1+u)^2 \: du$?
Various integrals of this type (roughly speaking, logarithms divided by polynomials) are recurring in my work.  Presumably they can be computed with the ordinary techniques of calculus and the correct identities involving polylogarithms.  What are these identities, or where can I find them?

REPLY [3 votes]: This problem can also be approached by rewriting the sum. I'll show a lot of details, probably too many, here.
Use the binomial series to write
$ \frac{1}{(1+x^k)^2} = \sum_{m=0}^{\infty} \binom{m+1}{1} (-1)^m x^{km} $
and insert this into the original sum $S$ to obtain
$ S = \sum_{k=1} k^2 x^k \sum_{m=0} (-1)^m (m+1) x^{km}. $
Interchange the sums to obtain
$ S = \sum_{m=0} (m+1) (-1)^m \sum_{k=1} k^2 x^{k(m+1)} $
$ = \sum_{m=0} (m+1) (-1)^m \frac{x^{m+1} (1+x^{m+1})}{(1-x^{m+1})^3} $
$ = -\sum_{m=1} m (-1)^m \frac{x^{m} (1+x^{m})}{(1-x^{m})^3}. $
Now use the factorization $1-x^m = (1-x)(1+x+x^2 +x^3 + \cdots + x^{m-1}) $ to write
$ S = \frac{-1}{(1-x)^3} \sum_{m=1} (-1)^m m \frac{x^m (1+x^m)}{(1+x+x^2 + \cdots + x^{m-1})^3}. $
We have now factored out the most singular term as $x \rightarrow 1.$ We can take the most rough approximation of the sum by finding its limit as $x \rightarrow 1$, which gives
$ S \approx \frac{-1}{(1-x)^3} \sum_{m=1} (-1)^m m \frac{2}{m^3}.$
Using the known sum $ \sum_{m=1} \frac{ (-1)^m }{m^2} = -\frac{\pi^2}{12} $ now gives 
$S \approx \frac{\pi^2}{6} \frac{1}{(1-x)^3} $ as desired....
NOTE: the last sum over $m$, if you don't just take $x=1$, but keep the powers $x^m$ in the numerator, gives dilogarithms of $x$ and $x^2$. However, I've probably thrown away too much in the denominator for that to be useful!!