Limit with polylog How do you show the following limit? 
$$\lim_{x\to\infty} x\log(-e^x + 1)+\operatorname{Li}_2(e^x)-\frac12x^2=\frac{\pi^2}3$$
Where $\operatorname{Li}_n(x)$ is the polylogarithm. 
This question is inspired by a thread in the sagemath mailinglist. 
 A: One may observe that

$$
{\rm Li}_2(y)+{\rm Li}_2\left(\frac1y\right)=\frac{\pi^2}3-\frac12\ln^2 y-i\pi\ln y, \qquad y \in [1,\infty) \tag1
$$ 

as may be proved by putting $\displaystyle z=ye^{i\pi}$ in the standard identity
$$
{\rm Li}_2(z)+{\rm Li}_2\left(\frac1z\right)=\frac{\pi^2}3-\frac12\left(\log (-z)\right)^2, \qquad z \in \mathbb{C}\backslash[0,\infty). \tag2
$$ 
(Identity $(2)$ may be proved by differentiating both sides using the integral representation $$
{\rm Li}_2(z)=-\int_0^z \frac{\log (1-t)}tdt \tag3
$$ and using $\displaystyle {\rm Li}_2(1)=\zeta(2)=\frac{\pi^2}6$).
Then, putting $y=e^x$ in $(1)$ gives, as $x \to +\infty$,
$$
\begin{align}
{\rm Li}_2(e^x)&=\frac{\pi^2}3-\frac{x^2}2-i\pi x-{\rm Li}_2\left(e^{-x}\right)\\\\
{\rm Li}_2(e^x)&=\frac{\pi^2}3-\frac{x^2}2-i\pi x-e^{-x}+\mathcal{O}\left(e^{-2x}\right) \tag4
\end{align}
$$ on the other hand, we have, as $x \to +\infty$,
$$
\begin{align}
x\log(-e^x+1)&=x\left(\log\left(1-e^{-x}\right)+x+i\pi\right)\\\\
x\log(-e^x+1)&=x^2+i\pi x+\mathcal{O}\left(xe^{-x}\right) \tag5
\end{align}
$$ summing $(4)$ and $(5)$ yields the desired limit.
A: The asymptotic expansion of dilog is :
$$Li_2(X)=-\frac{1}{2}\ln^2\left(\frac{1}{X}\right)+i\pi\ln\left(\frac{1}{X}\right)+\frac{\pi^2}{3}+O\left(\frac{1}{X}\right)$$
$$Li_2(e^x)=-\frac{1}{2}\ln^2\left(\frac{1}{e^x}\right)+i\pi\ln\left(\frac{1}{e^x}\right)+\frac{\pi^2}{3}+O\left(e^{-x}\right)=-\frac{x^2}{2}-i\pi x+\frac{\pi^2}{3}+O\left(e^{-x}\right)$$
The asymptotic expansion of $x\ln(1-e^x)$ is :
$$x\ln(1-e^x)=x\ln\left(-e^x(1-e^{-x})\right)=x\ln(-e^x)+x\ln(1-e^{-x})=x^2+i\pi x+O\left(xe^{-x}\right)$$
Then, comming back to $Li_2(e^x)+x\ln(1-e^x)-\frac{x^2}{2}$
$$Li_2(e^x)+x\ln(1-e^x)-\frac{x^2}{2}=-\frac{x^2}{2}-i\pi x+\frac{\pi^2}{3}+x^2+i\pi x-\frac{x^2}{2}+O\left(xe^{-x}\right)$$
After simplification :
$$Li_2(e^x)+x\ln(1-e^x)-\frac{x^2}{2}=\frac{\pi^2}{3}+O\left(xe^{-x}\right)$$
So, the limit for $x$ tending to infinity is $\frac{\pi^2}{3}$
