# Integral with hyperbolic cosine squared

Does anyone can give me a hint how to integrate the following:

$$\int_0^\infty{\frac{x^2 {\rm d}x}{\mathrm{cosh}^2(x)}}.$$

The answer is $\frac{\pi^2}{12}$ (taken from the book).

I've started with

$$\int_0^\infty{\frac{x^2 {\rm d}x}{\mathrm{cosh}^2x}} =$$

$\int_0^\infty{\frac{x^2}{\mathrm{cosh}~x}\frac{{\rm d}(\mathrm{sinh}~x)}{1 + \mathrm{sinh}^2x}}=\left. \arctan{(\mathrm{sinh}~x)}\frac{x^2}{\mathrm{cosh}~x}\right|_0^\infty-\int_0^\infty \arctan{(\mathrm{sinh}~x)}\frac{2x~\mathrm{cosh}~x-x^2 \mathrm{sinh}~x}{\mathrm{cosh}^2x}{\rm d}=$

$$-\frac{1}{2}\int_0^\infty {\rm d}(\arctan^2(\mathrm{sinh}~x))\left[2x-x^2 \mathrm{tanh}~x\right].$$

Definitely, $$\frac{1}{2}\int_0^\infty {\rm d}(\arctan^2(\mathrm{sinh}~x)) = \frac{\pi^2}{8},$$

and I think that's the way to the answer. But I can't imagine how to deal with the part in square brackets...

I will be grateful for any help.

## 1 Answer

$$\int_0^{\infty} dx \frac{x^2}{\mathrm{cosh}^2{x}} = 4 \int_0^{\infty} dx \: x^2 e^{-2 x} (1+e^{-2 x})^{-2}$$

$$= 4 \int_0^{\infty} dx \: x^2 e^{-2 x} \sum_{k=0}^{\infty} (-1)^k (k+1) e^{-2 k x}$$

$$= 4 \sum_{k=0}^{\infty} (-1)^k (k+1) \int_0^{\infty} dx \: x^2 e^{-2 (k+1) x}$$

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

The expression in the second line comes from the Taylor expansion of $(1+y)^{-2}$ about $y=0$.

• Can you maybe give an argument for the interversion of $\sum$ and $\int$ from line 2 to line 3? – jathd Jan 14 '13 at 15:03
• The integral and the sum are both absolutely convergent; thus, their order may be reversed. An extended discussion of this for integration may be found in T.W. Koerner's book, Fourier Analysis, Secs. 47 & 48, here: books.google.com/… – Ron Gordon Jan 14 '13 at 15:05