TITLE: Contour integral for $x^3/(e^x-1)$?
QUESTION [24 upvotes]: What contour and integrand do we use to evaluate
$$ \int_0^\infty \frac{x^3}{e^x-1} dx $$
Or is this going to need some other technique?

REPLY [7 votes]: I am fully aware that this is long overdue, but I wanted to suggest another way of finding the integral using a slightly different contour that has no indentations. This approach is quite similar to Brightsun's (basically the same!) but uses a little known fact about poles at the corner of a contour and how they should be treated. I have obviously skipped some intermediate steps in order to emphasize the different process. I hope someone will find this (at least partly) useful.
We'll start off by evaluating the following integral 
\begin{equation}
\oint_C\frac{z^4}{-e^z-1}dz
\end{equation}
where $C$ is a rectangle of vertices $(0,-\pi),(R,-\pi),(R,\pi),(0,\pi)$.
Notice that the sum of the residues must be multiplied by $i\pi /2$ instead of $2\pi i$ since the two poles are at two corners of the contour of angle $\pi/2$ each. As a general rule, when the curve is smooth where it passes through a pole, the residue is multiplied by $i\pi$. However if the pole is at the tip of a corner of inner angle $\psi$ then the corresponding residue is multiplied by $i\psi $. The general form of the residue can be readily found:$$\text{Res}_{z=i(2k+1)\pi}\left(\frac{-z^4}{e^z+1}\right)=\left(\frac{-z^4}{e^z}\right)_{z=i(2k+1)\pi}=\left(\frac{-(i(2k+1)\pi)^4}{e^{i(2k+1)\pi}}\right)=(2k\pi+\pi)^4$$
The two poles on the left corners correspond to $k=0$ and $k=-1$
\begin{align}    
\int_0 ^R \frac{(x-i\pi)^4}{e^x - 1}\mathrm{d}x +& \int_{-\pi} ^{\pi} \frac{(R+iy)^4}{-e^{R+iy}- 1}i\mathrm{d}y +\\[8pt]
 &\int_{R}^0 \frac{(x+i\pi)^4}{e^{x}-1}\mathrm{d}x + \int_{\pi}^{-\pi}\frac{(iy)^4}{-e^{iy}-1}i\mathrm{d}y= i\frac{\pi}{2}\times\left(\pi^4+\pi^4\right)
   \end{align}
    \begin{align}
\int_0 ^\infty \frac{(x-i\pi)^4-(x+i\pi)^4}{e^x - 1}\mathrm{d}x  + \int_{\pi}^{-\pi}\frac{(iy)^4}{-e^{iy}-1}i\mathrm{d}y &=i \pi^5
\\[8pt]\end{align}
As $R\to\infty$ the second  integral vanishes. After manipulating the fourth integral to separate the imaginary from the real parts, we equate the imaginary parts of the two sides of the equation:
            \begin{align}
\int_0 ^\infty \frac{(x-i\pi)^4-(x+i\pi)^4}{e^x - 1}\mathrm{d}x  +  \frac{1}{2} \int_{\pi}^{-\pi} y^4 \mathrm{d}y&= \pi^5
\\[8pt]
-8\pi \int_0 ^\infty \frac{x^3-x\pi^2}{e^x - 1}\mathrm{d}x  + \frac{1}{2} \int_{\pi}^{-\pi} y^4 \mathrm{d}y  &= \pi^5\\[8pt]
8\pi I=\frac{4\pi^5}3+\frac {\pi^5}5-\pi^5=\pi^5\left(\frac{20+3-15}{15}\right)&=\frac{8\pi^5}{15}
    \end{align}
                $$\boxed{\int_0^\infty \frac{x^3}{e^x-1}dx=\frac{\pi^4}{15}}$$