# Improper Integral $\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 Commented Sep 3, 2016 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)$$ .... Commented Sep 3, 2016 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}$$ Commented Sep 3, 2016 at 17:45
• by the way your second integral is wrong...how can we get an odd function out of an even one=? Commented Sep 3, 2016 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. Commented Sep 3, 2016 at 18:16

$$\newcommand{\angles}[1]{\left\langle\,{#1}\,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{\mathrm{i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\Li}[1]{\,\mathrm{Li}_{#1}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$$ $$\ds{\bbox[5px,#ffd]{\int_{0}^{\infty} \bracks{{\tanh\pars{x} \over x^{3}} - {1 \over x^{2}\cosh^{2}\pars{x}}}\,\dd x = {7 \over \pi^{2}}\,\zeta\pars{3}} \approx 0.8526\ \Large ?}$$.

\begin{align} &\color{#f00}{\int_{0}^{\infty} \bracks{{\tanh\pars{x} \over x^{3}} - {1 \over x^{2}\cosh^{2}\pars{x}}}\,\dd x} \\[5mm] = &\ \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. Commented Sep 4, 2016 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. Commented Sep 5, 2016 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... Commented Sep 18, 2016 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
Commented Sep 18, 2016 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.

I know I'm very late in this thread, but please allow me to share my method. It's a bit more easier to come up with, if I do say so myself...

First, I manipulate the integral to a more friendly form. Namely, $$\require{AMScd}$$

\begin{align*} I&=\int_0^{\infty}{\left[ \frac{\tanh \left( x \right)}{x^3}-\frac{1}{x^2\cosh ^2\left( x \right)} \right] \mathrm{d}x} \\& =\int_0^{\infty}{\frac{\tanh \left( x \right) -x}{x^3}\mathrm{d}x}+\int_0^{\infty}{\frac{\sinh ^2\left( x \right)}{x^2\cosh ^2\left( x \right)}\mathrm{d}x} \\& \stackrel{\mathrm{I.B.P}}{\begin{CD}@=\end{CD}}\left. \frac{x-\tanh \left( x \right)}{2x^2} \right|_{0}^{\infty}-\frac{1}{2}\int_0^{\infty}{\frac{\sinh ^2\left( x \right)}{x^2\cosh ^2\left( x \right)}\mathrm{d}x}+\int_0^{\infty}{\frac{\sinh ^2\left( x \right)}{x^2\cosh ^2\left( x \right)}\mathrm{d}x} \\& =\frac{1}{2}\int_0^{\infty}{\frac{\sinh ^2\left( x \right)}{x^2\cosh ^2\left( x \right)}\mathrm{d}x}\stackrel{\mathrm{I.B.P}}{\begin{CD}@=\end{CD}}\left. -\frac{\sinh ^2\left( x \right)}{2x\cosh ^2\left( x \right)} \right|_{0}^{\infty}+\int_0^{\infty}{\frac{\sinh \left( x \right)}{x\cosh ^3\left( x \right)}\mathrm{d}x} \\& =\int_0^{\infty}{\frac{\sinh \left( x \right)}{x\cosh ^3\left( x \right)}\mathrm{d}x} \end{align*}

Then, I define $$I(t)$$, and use leibniz rule on it. \begin{align*} I\left( t \right) &\stackrel{\mathrm{def}}{=} \int_0^{\infty}{\frac{\sinh \left( tx \right)}{x\cosh ^3\left( x \right)}\mathrm{d}x} \\ I'\left( t \right) &=\int_0^{\infty}{\frac{\cosh \left( tx \right)}{\cosh ^3\left( x \right)}\mathrm{d}x} \stackrel{e^{-x}=s}{\begin{CD}@=\end{CD}}4\int_1^{\infty}{\frac{s^t+s^{-t}}{s\left( s+s^{-1} \right) ^3}\mathrm{d}x} \\& \stackrel{s\rightsquigarrow \frac{1}{s}}{\begin{CD}@=\end{CD}}4\int_0^1{\frac{s^t+s^{-t}}{s\left( s+s^{-1} \right) ^3}\mathrm{d}x} =2\int_0^{\infty}{\frac{s^{2+t}+s^{2-t}}{\left( s^2+1 \right) ^3}\mathrm{d}x} \\& \stackrel{s^2=u}{\begin{CD}@=\end{CD}}\int_0^{\infty}{\frac{u^{\frac{3+t}{2}-1}+u^{\frac{3-t}{2}-1}}{\left( u+1 \right) ^{\frac{3+t}{2}+\frac{3-t}{2}}}\mathrm{d}x}=2\mathrm{B}\left( \frac{3+t}{2}, \frac{3-t}{2} \right) \\& =\Gamma \left( \frac{3+t}{2} \right) \Gamma \left( \frac{3-t}{2} \right) =\frac{\pi \left( 1-t^2 \right)}{4\cos \left( \frac{\pi}{2}t \right)} \end{align*}

Then I integrated that from 0 to 1. \begin{align*} I&=\int_0^1{I'\left( t \right) \mathrm{d}t}=\int_0^1{\frac{\pi \left( 1-t^2 \right)}{4\cos \left( \frac{\pi}{2}+\frac{\pi}{2}t \right)}\mathrm{d}t} \\& \stackrel{\frac{t\pi}{2}\rightsquigarrow t}{\begin{CD}@=\end{CD}}\frac{1}{2\pi ^2}\int_0^{\frac{\pi}{2}}{\frac{\pi ^2-4t^2}{\cos \left( t \right)}\mathrm{d}t}\stackrel{\frac{\pi}{2}-t\rightsquigarrow t}{\begin{CD}@=\end{CD}}\frac{2}{\pi ^2}\int_0^{\frac{\pi}{2}}{\frac{t\left( \pi -t \right)}{\sin \left( t \right)}\mathrm{d}t} \\& \stackrel{\mathrm{I.B.P}}{\begin{CD}@=\end{CD}}\left. \frac{2}{\pi ^2}t\left( \pi -t \right) \ln \left( \tan \left( \frac{t}{2} \right) \right) \right|_{0}^{\frac{\pi}{2}}+\frac{2}{\pi ^2}\int_0^{\frac{\pi}{2}}{\left( 2t-\pi \right) \ln \left( \tan \left( \frac{t}{2} \right) \right) \mathrm{d}t} \\& \stackrel{\frac{t}{2}\rightsquigarrow t}{\begin{CD}@=\end{CD}}\frac{4}{\pi ^2}\int_0^{\frac{\pi}{4}}{\left( 4t-\pi \right) \ln \left( \tan \left( t \right) \right) \mathrm{d}t} \\& =\underset{t\rightsquigarrow t}{\underbrace{\frac{4}{\pi ^2}\int_0^{\frac{\pi}{4}}{\left( 4t-\pi \right) \ln \left( \sin \left( t \right) \right) \mathrm{d}t}}}-\underset{t\rightsquigarrow \frac{\pi}{2}-t}{\underbrace{\frac{4}{\pi ^2}\int_0^{\frac{\pi}{4}}{\left( 4t-\pi \right) \ln \left( \cos \left( t \right) \right) \mathrm{d}t}}} \\& =\frac{4}{\pi ^2}\int_0^{\frac{\pi}{4}}{\left( 4t-\pi \right) \ln \left( \sin \left( t \right) \right) \mathrm{d}t}+\frac{4}{\pi ^2}\int_{\frac{\pi}{4}}^{\frac{\pi}{2}}{\left( 4t-\pi \right) \ln \left( \sin \left( t \right) \right) \mathrm{d}t} \\& =\frac{16}{\pi ^2}\int_0^{\frac{\pi}{2}}{t\ln \left( \sin \left( t \right) \right) \mathrm{d}t}-\frac{4}{\pi}\int_0^{\frac{\pi}{2}}{\ln \left( \sin \left( t \right) \right) \mathrm{d}t} \end{align*}

the right one evaluates to $$-\frac{1}{2}\ln \left( 2 \right)$$. Plus, using the fourier expansion of $$\ln \left( \sin \left( t \right) \right)$$

\begin{align*} I&=\frac{16}{\pi ^2}\int_0^{\frac{\pi}{2}}{t\ln \left( \sin \left( t \right) \right) \mathrm{d}t}+\frac{1}{2}\ln \left( 2 \right) \\& =-\frac{16}{\pi ^2}\int_0^{\frac{\pi}{2}}{\left( t\ln \left( 2 \right) +t\sum_{n=1}^{\infty}{\frac{\cos \left( 2nt \right)}{n}} \right) \mathrm{d}t}+\frac{1}{2}\ln \left( 2 \right) \\& =-\frac{16}{\pi ^2}\sum_{n=1}^{\infty}{\frac{1}{n}}\int_0^{\frac{\pi}{2}}{t\cos \left( 2nt \right) \mathrm{d}t}=\frac{4}{\pi ^2}\sum_{n=1}^{\infty}{\frac{1-\cos \left( \pi n \right)}{n^3}} \\& =\frac{8}{\pi ^2}\sum_{n=1}^{\infty}{\frac{1}{\left( 2n-1 \right) ^3}}=\frac{8}{\pi ^2}\frac{7}{8}\zeta \left( 3 \right) =\frac{7}{\pi ^2}\zeta \left( 3 \right) \end{align*}