TITLE: Examples of "difficult" integrals with are easier to solve with a series?
QUESTION [6 upvotes]: Yesterday someone posted an extremely elegant solution to a seemingly bizarre series where the integral:
$$\int_{0}^{1} x^{m}\ dx =  \frac{1}{m + 1}$$
was utilized. 
Oftentimes one will also interchange the summation from inside the integral to the outside in the case of uniformly convergent series.
Are there situations where an otherwise complicated looking integral has a "trivial" solution as a series?

REPLY [2 votes]: In statistical physics, integrals of the form $\int_0^\infty dx\, {x^n}(e^{x}\pm 1)^{-1}$ are common, and the standard approach is to expand the reciprocal in powers of $e^{-x}$:
\begin{align}
\int_0^\infty dx\, \frac{x^n}{e^{x}\pm 1} 
&= \int_0^\infty dx\, \frac{x^n e^{-x}}{1\pm e^x}\\
&= \int_0^\infty dx\, x^n \sum_{k=0}^\infty (\mp 1)^k e^{-(k+1)x}\\
&= \sum_{k=0}^\infty (\mp 1)^k \int_0^\infty dx\, x^n e^{-(k+1)x}\\
&= \sum_{k=0}^\infty (\mp 1)^k \frac{n!}{(k+1)^{n+1}} = \left\{\array{n!\,\eta(n+1)\\ n!\, \zeta(n+1)}\right\}
\end{align}
where $\eta(n)$ and $\zeta(n)$ are the Dirichlet eta and Riemann zeta functions respectively. (Note that such integrals are really particular cases of the polylogarithm.)