# Improper Integral $\displaystyle\int_0^\infty\left(\frac{\tanh(x)}{x^3}-\frac1{x^2\cosh^2(x)}\right)dx = \frac{7\zeta(3)}{\pi^2}$

$\newcommand{\sech}{\operatorname{sech}}$ $\displaystyle \int_0^{\infty}{\left(\frac{\tanh(x)}{x^3} - \frac{\sech^2(x)}{x^2} \right)\ dx }= \frac{7\zeta(3)}{\pi^2}$

What I tried

I simplified it to -

$\displaystyle \int_0^{\infty}{\frac{\sinh(2x) - 2x}{x^3 \cosh^2(x)} \ dx}$

Then I don't know how to solve. I tried Feynman's method

$\displaystyle I(a) = \int_0^{\infty}{\frac{\sinh(ax) - ax}{x^3 \cosh^2(x)} \ dx}$

But then too it didn't help much.

I thought of replacing them with trigonometric forms and then complex number real and imaginary part but wasn't helpful much.

Please try to avoid complex analysis.

• residue theorem finish this integral quickly – tired Sep 3 '16 at 17:38
• Since the function is even we can extend the range of integration to $(- \infty,\infty)$. It is also not too difficult to see that the integrand $f(z)$ as a function of a complex variable $z$ is $\sim \mathcal{O}(|z|^{-2})$ as $|z|\rightarrow \infty$ and also bounded at the origin. We can therefore choose a big semicircle in the u.h.p. as an contour of integration. We obtain $$2I=2 \pi i\sum_{n=1}^{\infty}\text{res}\left(f(z),z=\frac{i n \pi}{2}\right)$$ .... – tired Sep 3 '16 at 17:44
• ...with $\text{res}\left(f(z),z=\frac{i n \pi}{2}\right)=\frac{-8 i }{\pi^3 (2n-1)^3}$ we get >$$I=\frac{8}{\pi^2}\sum_{n=1}^{\infty}\frac{1} {(2n-1)^3}=\frac{7\zeta(3)}{\pi^2}$$ – tired Sep 3 '16 at 17:45
• by the way your second integral is wrong...how can we get an odd function out of an even one=? – tired Sep 3 '16 at 17:48
• Thanks to @tired, I saw OP's typo. When simplifying the integral, the denominator should become $x^3 \cosh^2 x$. That case, my answer below makes no sense. I am deleting it. – iamvegan Sep 3 '16 at 18:16


$\ds{\int_{0}^{\infty} \bracks{{\tanh\pars{x} \over x^{3}} - {1 \over x^{2}\cosh^{2}\pars{x}}}\,\dd x :\ ?}$.

\begin{align} &\color{#f00}{\int_{0}^{\infty} \bracks{{\tanh\pars{x} \over x^{3}} - {1 \over x^{2}\cosh^{2}\pars{x}}}\,\dd x} = \int_{0}^{\infty}{\tanh\pars{x} - x \over x^{3}}\,\dd x + \int_{0}^{\infty}{\tanh^{2}\pars{x} \over x^{2}}\,\dd x \\[5mm] = & -\,\half\int_{x\ =\ 0}^{x\ \to\ \infty}\bracks{\tanh\pars{x} - x} \,\dd\pars{1 \over x^{2}} + \int_{0}^{\infty}{\tanh^{2}\pars{x} \over x^{2}}\,\dd x \\[5mm] = &\ \half\int_{0}^{\infty}{\mrm{sech}^{2}\pars{x} - 1 \over x^{2}}\,\dd x + \int_{0}^{\infty}{\tanh^{2}\pars{x} \over x^{2}}\,\dd x = \half\int_{0}^{\infty}{\tanh^{2}\pars{x} \over x^{2}}\,\dd x \\[5mm] = &\ 32\sum_{k = 0}^{\infty}\,\sum_{n = 0}^{\infty}\,\,\ \underbrace{% \int_{0}^{\infty}{1 \over \bracks{\pars{2k + 1}\pi}^{\, 2} + 4x^{2}}\, {1 \over \bracks{\pars{2n + 1}\pi}^{\, 2} + 4x^{2}}\,\dd x} _{\ds{1 \over 8\pi^{2}\pars{2k + 1}\pars{2n + 1}\pars{k + n + 1}}} \label{1}\tag{1} \\[5mm] = &\ {4 \over \pi^{2}}\ \underbrace{\sum_{k = 0}^{\infty}{H_{k} + 2\ln\pars{2} \over \pars{2k + 1}^{2}}} _{\ds{{7 \over 4}\,\zeta\pars{3}}}\label{2}\tag{2} = \color{#f00}{{7 \over \pi^{2}}\,\zeta\pars{3}} \end{align}

Note that

• In \eqref{1}, we use the identity $\ds{{\tanh\pars{x} \over x} = 8\sum_{j = 0}^{\infty}{1 \over \bracks{\pars{2j + 1}\pi}^{\, 2} + 4x^{2}}}$
• The sum over $\ds{n}$, in \eqref{1}, yields a Digamma Function term $\ds{\Psi\pars{1 + k}}$ which explains the appearance of the Harmonic Number $\ds{H_{k} = \Psi\pars{1 + k} + \gamma}$. $\ds{\gamma}$ is the Euler-Mascheroni Constant.
• $\ds{\sum_{k = 0}^{\infty}{H_{k} \over \pars{2k + 1}^{2}} = {1 \over 4}\bracks{7\zeta\pars{3} - \pi^{2}\ln\pars{2}}}$ is a well known result.
• $\ds{\sum_{k = 0}^{\infty}{1 \over \pars{2k + 1}^{2}} = {1 \over 8}\,\pi^{2}}$.
• Check other evaluations of $\int_0^\infty \tanh^2 x / x^2 \, dx$ here. – nospoon Sep 4 '16 at 12:05
• @nospoon Thanks for your information. I was not aware of that page. I was familiar with $\int_{0}^{\Lambda}{\tanh(x) \over x}\,\mathrm{d}x$ which appears in Superconductivity Theory, Charge and Spin Density Waves, etc... The usual approach is integration by parts which was my first attempt. That was a messy. Then, I could remember the $\tanh(x)/x$ expansion which is widely known in Superconductivity. In Superconductivity, the above mentioned integral is evaluated for large but finite $\Lambda$. The page you showed me has a lot of information. Thanks. – Felix Marin Sep 5 '16 at 1:21

A Residue Calculus Approach

At $z=\left(k+\frac12\right)\pi i$, the residue of $\frac{\tanh(x)}{x^3}$ is $\frac{i}{\left(\left(k+\frac12\right)\pi\right)^3}$ and the residue of $\frac1{x^2\cosh^2(x)}$ is $\frac {2i}{\left(\left(k+\frac12\right)\pi\right)^3}$

Therefore, \begin{align} &\int_0^\infty\left(\frac{\tanh(x)}{x^3}-\frac1{x^2\cosh^2(x)}\right)\,\mathrm{d}x\tag{1}\\ &=\frac12\int_{-\infty}^\infty\left(\frac{\tanh(x)}{x^3}-\frac1{x^2\cosh^2(x)}\right)\,\mathrm{d}x\tag{2}\\ &=\frac12\int_{-\infty-i}^{\infty-i}\left(\frac{\tanh(x)}{x^3}-\frac1{x^2\cosh^2(x)}\right)\,\mathrm{d}x\tag{3}\\[6pt] &=\pi i\sum_{k=0}^\infty\left[\frac{i}{\left(\left(k+\frac12\right)\pi\right)^3}-\frac{2i}{\left(\left(k+\frac12\right)\pi\right)^3}\right]\tag{4}\\ &=\frac8{\pi^2}\sum_{k=0}^\infty\frac1{(2k+1)^3}\tag{5}\\[6pt] &=\frac{7\zeta(3)}{\pi^2}\tag{6} \end{align} Explanation:
$(2)$: the integrand is even
$(3)$: the integrand vanishes at $x=\pm\infty$ and has no sinularities in $-1\lt\mathrm{Im}(z)\lt0$
$(4)$: the integrand vanishes like $\frac1{z^2}$ on $\mathrm{Im}(z)\in\mathbb{Z}\pi$
$\phantom{\text{(4): }}$and like $\frac1{z^3}$ as $|\mathrm{Re}(z)|\to\infty$
$\phantom{\text{(4): }}$so the integral is $2\pi i$ times the sum of the residues
$(5)$: algebra
$(6)$: note that the sum is $\frac78\zeta(3)$

• hey @robjohn may i ask why you shift the path of integration to $-i$? I don't see the reason at the moment... – tired Sep 18 '16 at 9:01
• @tired: it avoids the singularity at $0$. The difference does not have a singularity at $0$, but we are computing the residues after we have separated the functions. The functions are even, so they have $0$ residue at $0$, but they are like $\frac1{z^2}$ near $0$, so we can't just take a small semi-circle around $0$ and discount it. This just avoids having to worry about $0$ at all. – robjohn Sep 18 '16 at 11:07

Integrating by parts we get $$I=\int_{0}^{\infty}\left(\frac{\tanh\left(x\right)}{x^{3}}-\frac{1}{x^{2}\cosh^{2}\left(x\right)}\right)dx=$$ $$-\int_{0}^{\infty}\frac{1}{x}\left(-\frac{\tanh\left(x\right)}{x^{2}}+\frac{1}{x\cosh^{2}\left(x\right)}+2\frac{\tanh\left(x\right)}{\cosh^{2}\left(x\right)}\right)dx$$ so $$\int_{0}^{\infty}\left(\frac{\tanh\left(x\right)}{x^{3}}-\frac{1}{x^{2}\cosh^{2}\left(x\right)}\right)dx=-\int_{0}^{\infty}\frac{\tanh\left(x\right)}{x\cosh^{2}\left(x\right)}dx$$ and now taking $x=-\log\left(u\right)$ we get $$I=4\int_{0}^{1}\frac{\left(u^{2}-1\right)u}{\left(u^{2}+1\right)^{3}\log\left(u\right)}du=4\int_{0}^{1}\frac{u^{3}-u}{\left(u^{2}+1\right)^{3}\log\left(u\right)}du$$ $$=4\int_{0}^{1}\frac{1}{\left(u^{2}+1\right)^{3}}\int_{1}^{3}u^{z}dzdu=4\int_{1}^{3}\int_{0}^{1}\frac{u^{z}}{\left(u^{2}+1\right)^{3}}dudz$$ and the last integral can be written in terms of the Gauss hypergeometric function $$\int_{0}^{1}\frac{u^{z}}{\left(u^{2}+1\right)^{3}}du=\frac{1}{2}\int_{0}^{1}\frac{u^{z/2-1/2}}{\left(u+1\right)^{3}}du=\frac{1}{z+1}\,_{2}F_{1}\left(3,\frac{z+1}{2},1+\frac{z+1}{2},-1\right)$$ and this particular hypergeometric function has a “closed form” in terms of Digamma function, so we have $$I=\frac{1}{8}\int_{1}^{3}\left(z^{2}-4z+3\right)\left(\psi\left(\frac{z+3}{4}\right)-\psi\left(\frac{z+1}{4}\right)\right)dz-\frac{1}{8}\int_{1}^{3}2z-8dz.$$ Now note that every single term is in the form $$a\int_{1}^{3}z^{b}\psi\left(\frac{z+c}{4}\right)dz=4a\int_{(1+c)/4}^{(3+c)/4}\left(4v-c\right)^{b}\psi\left(v\right)dv$$ with $b=0,1,2$ and $c=1,3$ so let us consider the case $b=0$. We have $$\int_{(1+c)/4}^{(3+c)/4}\psi\left(v\right)dv=\log\left(\frac{\Gamma\left(\frac{3+c}{4}\right)}{\Gamma\left(\frac{1+c}{4}\right)}\right)$$ if $b=1$ we have, integrating by parts, $$\int_{(1+c)/4}^{(3+c)/4}v\psi\left(v\right)dv=\left(v\log\left(\Gamma\left(v\right)\right)-\psi^{\left(-2\right)}\left(v\right)\right)_{(1+c)/4}^{(3+c)/4}$$ and if $b=2$ we have $$\int_{(1+c)/4}^{(3+c)/4}v^{2}\psi\left(v\right)dv=\left(v^{2}\log\left(\Gamma\left(v\right)\right)-2v\psi^{\left(-2\right)}\left(v\right)+3\psi^{\left(-3\right)}\left(v\right)\right)_{(1+c)/4}^{(3+c)/4}$$ so combining this result and the closed form about polygamma at negative orders we obtain $$I=\color{red}{\frac{7\zeta\left(3\right)}{\pi^{2}}}$$ as wanted.