Integration of $\frac{x^2}{2\left(e^x+1\right)}$ Let:
$$f(x) = \int \frac{x^2}{2\left(e^x+1\right)}dx $$
Is there a way to find $f(x)$?
I've tried through integration by parts, but that didn't work out. If substitution is the answer, I can't see an appropriate substitution to make.
Can anyone help?
 A: Substitute $u=e^x$ and decompose to get
$$\int \frac{x^2}{2(e^x+1)}\,\mathrm d x=\int\frac{\ln ^2u}{u(u+1)}\,\mathrm d u=\int\frac{\ln ^2u}{u}\,\mathrm d u-\int\frac{\ln ^2u}{u+1}\,\mathrm d u$$
The first integral is easy:
$$\int\frac{\ln^2u}{u}\,\mathrm d u\stackrel{v=\ln u}{=}\int v^2\,\mathrm d v=\frac{\ln^3u}{3}+C$$
The second's a bit tougher. To calculate it, substitute $v=u+1$ and integrate by parts twice:
$$\int\frac{\ln^2u}{u+1}\,\mathrm d u=\int\frac{\ln^2(v-1)}{v}\,\mathrm d v=\ln^2(v-1)\ln v-2\int\frac{\ln (v-1)\ln v}{v-1}\,\mathrm d v=\\
\ln^2(v-1)\ln v-2\int\frac{\mathrm{Li}_2(1-v)}{v-1}\,\mathrm d v-2\,\mathrm{Li}_2(1-v)\ln(v-1)$$
Finally, substitute $t=1-v$ to see that the remaining integral is a trilogarithm:
$$\int\frac{\mathrm{Li}_2(1-v)}{v-1}\,\mathrm d v=\int\frac{\mathrm{Li}_2 (t)}{t}\,\mathrm d t=\mathrm{Li}_3(1-v)$$
After plugging in the solved integral and undoing the two substitutions we get the result:
$$\int \frac{x^2}{2(e^x+1)}\,\mathrm d x=\boxed{\frac{x^3}{6}-\frac{x^2\ln(e^x+1)}{2}-x\,\mathrm{Li}_2(-e^x)+\mathrm{Li}_3(-e^x)+C}$$
