# Contour integral for $x^3/(e^x-1)$?

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?

I assume by "or is this going to need some something else" you meant that you are open to non-contour integration techinques, I will show you one of those and let the contour integration be left to someone else (it's not too bad, I just wish I had graphing software).

The classic way to evaluate this integral is as follows

\begin{aligned}\int_0^\infty\frac{x^m}{e^x-1}\;dx &= \int_0^{\infty}\frac{e^{-x}x^m}{1-e^{-x}}\;dx\\ &=\int_0^{\infty}\sum_{n=0}^{\infty}x^me^{-x(n+1)}\;\\ &= \sum_{n=0}^{\infty}\int_0^{\infty}x^me^{-x(n+1)}\;dx\\ &=\Gamma(m+1)\sum_{n=0}^{\infty}\frac{1}{(n+1)^{m+1}}\\ &=\Gamma(m+1)\zeta(m+1)\end{aligned}

This is, in fact, the way one defines $\zeta(x)$ for $x>1$.

• Could you elaborate why you are allowed to interchange limits in the 3rd step? I imagine you are using the dominated convergence theorem in some way? – Sjorszini Oct 4 '17 at 12:44
• He is allowed to interchange the summation and the integral because the sum converges along the path integrated. If you need more insight, then I'm more than happy to explain. – Highvoltagemath Aug 12 '19 at 21:25

To solve the integral I thought of a rectangle of vertices $0$, $R$, $R+i2\pi$ and $i2\pi$. Since the function we are going to use is singular in $i2k\pi$ we have to indent the first and the last vertex by using a quarter of circle for each one: let's make them small, of radius $\epsilon$. Calling this contour $\Gamma$ we have:

$$\oint_{\Gamma} \frac{z^4}{e^z -1}\mathrm{d}x = 0$$ by Cauchy's theorem.

As you will notice we have by now 4 segments and 2 quarters of circle to integrate on, namely: $$\int_\epsilon ^R \frac{x^4}{e^x - 1}\mathrm{d}x + \int_0 ^{2\pi} \frac{(R+iy)^4}{e^{R+iy}- 1}i\mathrm{d}y + \int_{R}^\epsilon \frac{(x+i2\pi)^4}{e^{x+i2\pi}-1}\mathrm{d}x + \int_0 ^{-\frac{\pi}{2}}\frac{(2 \pi i + \epsilon e^{i\theta})^4}{e^{2\pi i + \epsilon e^{i\theta}}-1} i\epsilon e^{i\theta}\mathrm{d}\theta + \int_{2\pi- \epsilon}^{\epsilon}\frac{(iy)^4}{e^{iy}-1}i\mathrm{d}y+ \int_{\frac{\pi}{2}}^{0}\frac{(\epsilon e^{i\theta})^4}{e^{\epsilon e^{i\theta}}-1}i\epsilon e^{i\theta} \mathrm{d}\theta = 0.$$

We can first expand the power in the third integral and note that its first term cancels out with the first integral.

Before writing anything else we take into account the limits $R \to +\infty$, which cancels out the second integral, and $\epsilon \to 0^+$, which annuls the last one and yields a finite value $-8i\pi^5$ in the 4th one.

Therefore we get $$-i8\pi \int_0 ^\infty \frac{x^3}{e^x - 1} \mathrm{d}x + 24\pi^2\int_0 ^\infty \frac{x^2}{e^x -1}\mathrm{d}x + i 32 \pi^3 \int_0 ^\infty \frac{x}{e^x - 1}\mathrm{d}x- 16\pi^4\int_0 ^\infty \frac{1}{e^x - 1}\mathrm{d}x -i8\pi^5+\frac{i}{2} \int_0 ^{2\pi} y^4 \mathrm{d}y - \frac{1}{2} \int_0 ^{2\pi} \frac{y^4 \sin y}{1-\cos y}\mathrm{d}y=0.$$ Where we have split the 5th integral into its real and imaginary parts.

By considering the expression of the imaginary parts only: $$-8\pi \int_0 ^\infty \frac{x^3}{e^x - 1} \mathrm{d}x + 32\pi^3 \int_0 ^\infty \frac{x}{e^x - 1}\mathrm{d}x - 8\pi^5 + \frac{16}{5}\pi^5 = 0.$$

The second integral gives $\frac{\pi^2}{6}$ (for a solution of this one a contour similar to the one we've used here is needed; I'm pretty sure it has already been solved here on Math.SE).

Finally: $$\int_0 ^\infty \frac{x^3}{e^x - 1} \mathrm{d}x = \frac{\pi^4}{8} \left(\frac{16}{3}-8+\frac{16}{5}\right) = \frac{\pi^4}{15}.$$

• The second integral after taking the imaginary part equals $\zeta(2)=\pi/6$ and not $\pi/12$, as stated in the answer. The result still does work out though. – Cyclone Apr 15 '16 at 13:13
• @Cyclone Thanks, corrected (btw it's $\pi^2 / 6$, not $\pi/6$). – Brightsun Apr 15 '16 at 14:21
• Yes, thanks for spotting the typo. – Cyclone Apr 15 '16 at 14:42

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}}$$

• I'm sorry, but isn't the half circular bend around the origin unnecessary? The indent/outdent should be where the poles happen to be (i.e., where you use the residue formula), I think. Furthermore, shifting the contour of $i\pi$ plus using $-e^z=e^{z+i\pi}$ in the denominator doesn't really give a different contour... – Brightsun Aug 23 '16 at 9:32
• @Brightsun you're right, I hadn't noticed. I removed the bend, but my point wasn't to shift the contour, but rather to get rid of the bends and use the fact that you can find the residue at a pole even if it's at a corner (of any angle). And shifting the contour so that it's symmetric about the real axis reduces the number of terms by two. – GeorgSaliba Aug 23 '16 at 10:02
• I think that the two ''missing'' terms are due to the residue formula for the vertices, and not to the shift: you have four terms on the left-hand side and two on the right-hand side, whereas I have six on the left-hand side. I agree that the difference between using bends for poles on the boundary and using the residue formula is merely academic, since the latter approach follows from the former. – Brightsun Aug 23 '16 at 10:34