How does one integrate $x^2 \frac{e^x}{(e^x+1)^2}$? How can I show this? $$ \int_{-\infty}^{\infty} x^2 \frac{e^x}{(e^x+1)^2} dx = \pi^2/3$$
I tried applying residuals, but the pole is of infinite(?) order.

I would start by trying to find the indefinite integral, as follows:
$$
\frac{d}{dx} \frac{x2e^x}{(1+e^x)^2} = \frac{x^2e^x}{(1+e^x)^2}+2\frac{x e^x}{1+e^x}
$$
Now let's try to rid ourselves of the $2\frac{x e^x}{1+e^x}$:
$$
\frac{d}{dx} \left( 2x \log(1+e^x) \right) = 2\frac{x e^x}{1+e^x} + 2 \log(1+e^x)
$$
Well, we now have to add back $2\int \log(1+e^x) dx$.  But this is progress because dilogarithms are your friend.  (You can tell I don't have many human friends.) In particular, 
$$
\frac{d}{du} \mbox{Li}_2 (u) = -\frac{\log(1-u)}{u}
$$
and if we substitute $u=-e^x$ we can find that
$$
\frac{d}{dx} \mbox{Li}_2 (-e^{x}) = -\log(1+e^x)
$$
So we can find the indefinite integral:
$$
\int\frac{x^2e^x}{(1+e^x)^2}dx = x^2\frac{e^x}{(1+e^x)^2}-2x\log(1+e^x) - 2\mbox{ Li}_2(-e^x)
$$
After all of that, we deserve to be close to finished, but now we need to find the value of the improper definite integral.  We want
$$
\lim_{x\to\infty} \left[ x^2\frac{e^x}{(1+e^x)^2}-2x\log(1+e^x) - 2\mbox{ Li}_2(-e^x) 
-x^2\frac{e^{-x}}{(1+e^{_x})^2}-2x\log(1+e^{-x})+2\mbox{ Li}_2(-e^{-x})\right]
$$
Of these six terms, the last three (that is, all three terms form the negative side of the improper definite integral) go to zero in the limit as $x->\infty$.
We are left with
$$
\lim_{x\to\infty} \left[ x^2\frac{e^x}{(1+e^x)^2}-2x\log(1+e^x) - 2\mbox{ Li}_2(-e^x) \right]
$$
We know (at least if we have been on a couple of dates with dilogarithms) that 
$$
\lim_{x\to\infty} \mbox{ Li}_2(-e^x) +\frac{x^2}{2} = -\frac{\pi^2}{6}
$$
It is easy to see that $$\lim_{x\to\infty} \left(x^2\frac{e^x}{(1+e^x)^2} -x^2 \right)=0
$$ And it is not too hard to see that 
$$\lim_{x\to\infty} \left( x\log(1+e^x) -x^2 \right)=0$$
(effectively, for large $x$, the $1$ in the log doesn't matter so the log looks like $x$).
Combining these limits, we find that our answer is 
$$
\lim_{x\to\infty} \left[ \left(x^2\frac{e^x}{(1+e^x)^2} -x^2\right)\\ -2\left(x\log(1+e^x) -x^2\right)\\- 2 \left(\mbox{ Li}_2(-e^x) +\frac12 x^2 \right)\\+x^2-2x^2+x^2\right]\\
= 0 -2 \cdot 0 -2 \cdot \left( -\frac{\pi^2}{6}\right) = \frac{\pi^2}{3}
$$
