# How to solve $\int_0^\infty x^2/(e^{x/2}+e^{-x/2})\text dx$? [duplicate]

I've tried MacLaurin expansion of the integrand, which resulted in

• $x^2/4 - x^4/16 + x^6/96 + O(x^7)$

When integrated from $0$ to $\infty$ it obviously explodes, but the defined result is ~ $1645$. I've also tried using hyperbolic functions, but it was useless. Does anyone know how to solve this?

Thank you

• What can you throw at it? Complex analysis? Mar 8, 2016 at 21:51
• math.stackexchange.com/questions/696953/… Mar 8, 2016 at 22:06
• math.stackexchange.com/questions/850442/… Mar 8, 2016 at 22:09
• @Winther Oh my, I'm really lacking attention here. Tks once more. Mar 8, 2016 at 22:44
• why this questions aren't shot down fster? Mar 9, 2016 at 13:21

$$I = \int_{0}^{+\infty}\frac{x^2\,dx}{2\cosh\frac{x}{2}} = 8\int_{0}^{+\infty}\frac{t^2\,dt}{e^{t}+e^{-t}}=8\int_{1}^{+\infty}\frac{\log^2 u}{u^2+1}\,du=8\int_{0}^{1}\frac{\log^2 v}{1+v^2}\,dv$$ but since: $$\int_{0}^{1} v^n \log^2(v)\,dv = \frac{2}{(1+n)^3}$$ we have:

$$I = 8\cdot\sum_{k=0}^{+\infty}(-1)^k \int_{0}^{1}v^{2k}\log^2(v)\,dv = 16\cdot\sum_{k\geq 0}\frac{(-1)^k}{(2k+1)^3}=\color{red}{\frac{\pi^3}{2}}$$

where the last identity is a consequence of a more general one.

You may notice that: $$\int_{0}^{1}\frac{\log^2 v}{1+v^2}\,dv = \frac{d^2}{d\alpha^2}\left.\int_{0}^{1}\frac{v^{\alpha}\,dv}{1+v^2}\,\right|_{\alpha=0}=\frac{1}{32}\lim_{\alpha\to 0}\left(\psi''\left(\frac{a+3}{4}\right)-\psi''\left(\frac{a+1}{4}\right)\right).$$

Let's call for simplicity $y = x/2$ so $\text{d}y = \text{d}x/2$ and $x = 2y$. Then you have

$$\int_0^{+\infty} \frac{(2y)^2}{e^y + e^{-y}} 2\ \text{d}y$$

namely

$$8\int_0^{+\infty} \frac{(y)^2}{e^y + e^{-y}}\ \text{d}y$$

we may now collect a $e^{y}$ term from the denominator

$$8\int_0^{+\infty} \frac{(y)^2}{e^y(1 + e^{-2y})}\ \text{d}y$$

We now use the Geometric Series, allowed since $e^{-2x} < 1$ considering the range of integration.

$$8\int_0^{+\infty} y^2e^{-y}\sum_{k = 0}^{+\infty} (-e^{-2y})^k\ \text{d}y$$

Arraging

$$8 \sum_{k = 0}^{+\infty}(-1)^k \int_0^{+\infty}y^2 e^{-y(1 + 2k)}\ \text{d}y$$

Integration is now trivial, you can do it by parts twice, getting:

$$\int_0^{+\infty}y^2 e^{-x(1 + 2k)}\ \text{d}y = \frac{2}{(1+2k)^3}$$

Thence:

$$8 \sum_{k = 0}^{+\infty}(-1)^k \frac{2}{(1+2k)^3}$$

This sum does converge, and the result is

$$16\left\{\frac{1}{64}\left[\zeta\left(3, \frac{1}{4}\right) - \zeta\left(3, \frac{3}{4}\right)\right]\right\}$$

Actually, the final numerical value is

$$15.5031\cdots$$

But to me it seems ok (my procedure I mean).. Maybe someone might check this??

• Agrees with mine. Mar 8, 2016 at 22:10

$\begin{array}\\ \int_0^{\infty} \frac{x^2}{e^{x/2}+e^{-x/2}} dx &=\int_0^{\infty} \frac{x^2e^{-x/2}}{1+e^{-x}} dx\\ &=\int_0^{\infty} x^2e^{-x/2}\sum_{n=0}^{\infty}(-1)^ne^{-nx} dx\\ &=\sum_{n=0}^{\infty}(-1)^n\int_0^{\infty} x^2e^{-(n+1/2)x} dx\\ &=\sum_{n=0}^{\infty}(-1)^n\frac{2}{(n+1/2)^3} \qquad\text{(see below)}\\ &=\sum_{n=0}^{\infty}(-1)^n\frac{16}{(2n+1)^3}\\ &=16\sum_{n=0}^{\infty}(-1)^n\frac{1}{(2n+1)^3}\\ &=\frac{\pi^3}{2} \qquad\text{(according to Wolfy)}\\ &\approx 15.5031\\ \end{array}$

As a check, again according to Wolfy, $\int_0^{100} \frac{x^2}{e^{x/2}+e^{-x/2}} dx \approx 15.5031$.

Since $\int x^2 e^{-a x} dx = -\frac{e^{-a x} (a^2 x^2+2 a x+2)}{a^3}$, $\int_0^{\infty} x^2 e^{-a x} dx = \frac{2}{a^3}$.

• Very nice resolution!! Great! Mar 8, 2016 at 22:11

\begin{align} \int_0^\infty\frac{x^2}{e^{x/2}+e^{-x/2}}\,\mathrm{d}x &=8\int_0^\infty\frac{x^2}{e^x+e^{-x}}\,\mathrm{d}x\tag{1}\\ &=8\int_0^\infty\frac{x^2}{1+e^{-2x}}e^{-x}\,\mathrm{d}x\tag{2}\\ &=8\int_0^\infty x^2\sum_{k=0}^\infty(-1)^ke^{-(2k+1)x}\,\mathrm{d}x\tag{3}\\ &=8\int_0^\infty x^2e^{-x}\sum_{k=0}^\infty\frac{(-1)^k}{(2k+1)^3}\,\mathrm{d}x\tag{4}\\[6pt] &=8\Gamma(3)\beta(3)\tag{5}\\[9pt] &=8\cdot2\cdot\frac{\pi^3}{32}\tag{6}\\[3pt] &=\bbox[5px,border:2px solid #C0A000]{\frac{\pi^3}2}\tag{7} \end{align} Explanation:
$(1)$: substitute $x\mapsto2x$
$(2)$: multiply by $\frac{e^{-x}}{e^{-x}}$
$(3)$: use the Taylor series for $\frac x{1+x^2}$
$(4)$: substitute $x\mapsto\frac x{2k+1}$
$(5)$: apply the Dirichlet Beta Function
$(6)$: get values from this answer
$(7)$: simplify

Note that $$\int_0^\infty\frac{x^{s-1}}{e^x+e^{-x}}\,\mathrm{d}x=\Gamma(s)\beta(s)$$ and $$\int_0^\infty\frac{x^{s-1}}{e^x+1}\,\mathrm{d}x=\Gamma(s)\eta(s)$$ and $$\int_0^\infty\frac{x^{s-1}}{e^x-1}\,\mathrm{d}x=\Gamma(s)\zeta(s)$$ where $\eta(s)$ is the Dirichlet Eta Function and $\zeta(s)$ is the Riemann Zeta Function.

• I don't agree completely, as I'd say that the simpler way for proving $\beta(3) = \pi^2/32$ is from $\Gamma(s) \beta(s)$ and the functional equation for $\beta(s)$ Mar 9, 2016 at 21:45
• What is it you don't agree with? Is something in error?
– robjohn
Mar 9, 2016 at 21:51

We borrow the result from the post left by @JackD'Aurizio and write

\begin{align} \int_0^\infty \frac{x^2}{e^{x/2}+e^{-x/2}}\,dx=4\int_{0}^{+\infty}\frac{\log^2 u}{u^2+1}\,du \end{align}

Next, we examine the integral $I$ as given by

$$I=\oint_C \frac{\log^3(z)}{z^2+1}\,dz$$

where $C$ is the classical key-hole contour that runs along both sides of the positive real axis. Since the integrand is analytic in and on $C$, its value is given by the residue theorem as

\begin{align} I&=2\pi i \text{Res}\left(\frac{\log^3(z)}{z^2+1}, z=\pm i\right)\\\\ &=2\pi i\left(\frac{\log^3(e^{i\pi/2})}{2i}+\frac{\log^3(e^{i3\pi/2})}{-2i}\right)\\\\ &=\frac{13\pi^4}{4}\,i \tag 1 \end{align}

Next, we note that we can write $I$ as

\begin{align} I&=\int_0^\infty \frac{\log^3(x)-(\log(x)+i2\pi)^3}{x^2+1}\,dx\\\\ &=-i6\pi \int_0^\infty \frac{\log^2(x)}{x^2+1}\,dx\\\\ &+12\pi^2\int_0^\infty \frac{\log(x)}{x^2+1}\,dx\\\\ &+i8\pi^3\int_0^\infty \frac{1}{x^2+1}\,dx \tag 2 \end{align}

The first integral on the right-hand side of $(2)$ is $1/4$ the integral of interest, the second integral is $0$ (to see this, enforce the substitution $x\to 1/x$), and the third integral is

$$\int_0^\infty \frac{1}{x^2+1}=\pi/2 \tag 3$$

Using $(1)-(3)$ reveals

$$-i6\pi \int_0^\infty \frac{\log^2(x)}{x^2+1}\,dx=\frac{13\pi^4}{4}\,i -i4\pi^4$$

and therefore, we find that

$$\int_0^\infty \frac{x^2}{e^{x/2}+e^{-x/2}}\,dx=\frac{\pi^3}{2}$$