40

I have homework to evaluate this integral $$I=\int_{0}^{\infty} \frac{\tanh(x)\,\tanh(2x)}{x^2}\;dx$$


Here is what I have done so far. I tried integration by parts using $u=\tanh(x)\,\tanh(2x)$ and $dv=\frac{dx}{x^2}$, I got $$\begin{align}\int_{0}^{\infty} \frac{\tanh(x)\,\tanh(2x)}{x^2}\;dx&=-\left.\frac{\tanh(x)\,\tanh(2x)}{x}\right|_{0}^{\infty}+2\int_{0}^{\infty}\frac{\tanh(2x)\,\text{sech}(2x)}{x}\;dx\\&=2\int_{0}^{\infty}\frac{\tanh(2x)\,\text{sech}(2x)}{x}\;dx\end{align}$$ At this part I'm stuck. I'm thinking of using Frullani's integral but I'm having trouble to find a relation as such $\tanh(2x)\,\text{sech}(2x)=f(ax)-f(bx)$.

I also tried using differentiation under integral sign by considering $$I(a,b)=\int_{0}^{\infty} \frac{\tanh(ax)\,\tanh(bx)}{x^2}\;dx$$ then $$\frac{dI}{da}=\int_{0}^{\infty} \frac{\text{sech}^2(ax)\,\tanh(bx)}{x}\;dx=\int_{0}^{\infty} \frac{\tanh(bx)-\tanh^2(ax)\tanh(bx)}{x}\;dx$$ Again I tried to use Frullani's integral but I'm having trouble to find the sufficient $f(x)$. Integrating again with respect to $b$, I got $$\frac{d^2I}{da\;db}=\int_{0}^{\infty} \text{sech}^2(ax)\text{sech}^2(bx)\;dx$$ It's obviously a dead end to me. At this rate my friends and I contacted my professor to confirm whether the integral can be evaluated in terms of elementary functions or not because W|A cannot find it (I know that W|A cannot do everything). He only said, "Sure! The answer is only 3 characters" and then he left us. Assuming he is right, so $I$ must have a nice closed form, but I'm unable to find it.

Would you help me? Any help would be appreciated. Thanks in advance.

Venus
  • 10,966

8 Answers8

23

Your professor is right. Note that $$ \tanh(x)=\frac{e^x-e^{-x}}{e^x+e^{-x}}, \tanh(2x)=\frac{e^{2x}-e^{-2x}}{e^{2x}+e^{-2x}}=\frac{(e^x-e^{-x})(e^x+e^{-x})}{e^{2x}+e^{-2x}}$$ and hence \begin{eqnarray*} \int_0^\infty\frac{\tanh(x)\tanh(2x)}{x^2}dx&=&\int_0^\infty\frac{(e^{x}-e^{-x})^2}{x^2(e^{2x}+e^{-2x})}dx\\ &=&\int_0^\infty\frac{e^{2x}-2+e^{-2x}}{x^2(e^{2x}+e^{-2x})}dx. \end{eqnarray*} Now define $$ I(a)=\int_0^\infty\frac{e^{ax}-2+e^{-ax}}{x^2(e^{2x}+e^{-2x})}dx$$ to get \begin{eqnarray} I''(a)&=&\int_0^\infty\frac{e^{(-a-2)x}+e^{(-a+2)x}}{1+e^{-4x}}dx,\\ &=&\int_0^\infty\sum_{n=0}^\infty(-1)^n(e^{(-a-2)x}+e^{(-a+2)x})e^{-4nx}dx\\ &=&\sum_{n=0}^\infty(-1)^n\left(\frac{1}{4n-a+2}+\frac{1}{4n+a+2}\right)\\ &=&\frac{\pi}{4}\sec\left(\frac{a\pi}{4}\right). \end{eqnarray} So \begin{eqnarray} I'(a)&=&\int_0^a\frac{\pi}{4}\sec\left(\frac{\pi t}{4}\right)dt\\ &=&\ln\left(1+\sin\left(\frac{\pi a}{4}\right)\right)-\ln\cos\left(\frac{\pi a}{4}\right) \end{eqnarray} and hence \begin{eqnarray} I(2)&=&\int_0^2\ln\left(1+\sin\left(\frac{\pi a}{4}\right)\right)da-\int_0^2\ln\cos\left(\frac{\pi a}{4}\right)da. \end{eqnarray} Note $$ \int_0^2\ln\cos\left(\frac{\pi a}{4}\right)da=-2\ln2 $$ from Evaluating $\int_0^{\large\frac{\pi}{4}} \log\left( \cos x\right) \, \mathrm{d}x $ and it should not be hard to get $$ \int_0^2\ln\left(1+\sin\left(\frac{\pi a}{4}\right)\right)da=\frac{8G}{\pi}-2\ln 2$$ and thus $$ I(2)=\frac{8G}{\pi}. $$

$\bf{Update}$ 1: Let us first work on $ \sum_{n=0}^\infty(-1)^n\left(\frac{1}{4n-a+2}+\frac{1}{4n+a+2}\right)=\frac{\pi}{4}\sec\left(\frac{a\pi}{4}\right)$. In fact \begin{eqnarray*} &&\sum_{n=0}^\infty(-1)^n\left(\frac{1}{4n-a+2}+\frac{1}{4n+a+2}\right)\\ &=&\sum_{n=0}^\infty\left(\frac{1}{8n-a+2}-\frac{1}{8n-a+6}\right)+\sum_{n=0}^\infty\left(\frac{1}{8n+a+2}-\frac{1}{8n+a+6}\right)\\ &=&\sum_{n=0}^\infty\frac{4}{(8n-a+2)(8n-a+6)}+\sum_{n=0}^\infty\frac{4}{(8n+a+2)(8n+a+6)}\\ &=&\sum_{n=-\infty}^\infty\frac{4}{(8n-a+2)(8n-a+6)}=\sum_{n=-\infty}^\infty\frac{4}{(8n-a+4)^2-2^2}\\ &=&\frac{1}{16}\sum_{n=-\infty}^\infty\frac{1}{(n+\frac{4-a}{8})^2-(\frac{1}{4})^2}. \end{eqnarray*} Now using a result from Closed form for $\sum_{n=-\infty}^\infty \frac{1}{(z+n)^2+a^2}$ for $a=\frac{i}{4}$ and $z=\frac{4-a}{8}$ and after some basic calculation we can get this result. Also see An alternative proof for sum of alternating series evaluates to $\frac{\pi}{4}\sec\left(\frac{a\pi}{4}\right)$ for a short proof.

$\bf{Update}$ 2: We work on $\int_0^2\ln\left(1+\sin\left(\frac{\pi a}{4}\right)\right)da=\frac{8G}{\pi}-2\ln 2$. In fact \begin{eqnarray} \int_0^2\ln\left(1+\sin\left(\frac{\pi a}{4}\right)\right)da=\frac{4}{\pi}\int_0^{\pi/2}\ln\left(1+\sin(a)\right)da=\frac{4}{\pi}\int_0^{\pi/2}\ln(1+\cos(a))da. \end{eqnarray} Using $2\cos^2\frac{a}{2}=1+\cos a$ and a result $G=\int_0^{\pi/4}\ln(\cos(t))dt$ from http://en.wikipedia.org/wiki/Catalan%27s_constant, it is easy to obtain $$ \int_0^2\ln\left(1+\sin\left(\frac{\pi a}{4}\right)\right)da= \frac{8G}{\pi}-2\ln 2. $$

xpaul
  • 44,000
  • Amazing! This very simple! You've posted since 19 hrs ago but why I didn't notice it earlier? +1 – Venus Nov 12 '14 at 18:19
  • Anyway, could you elaborate this part $$\int_0^2\ln\left(1+\sin\left(\frac{\pi a}{4}\right)\right)da=\frac{8G}{\pi}-2\ln 2$$Thanks... – Venus Nov 12 '14 at 18:40
  • Never mind, I can handle it. Thanks for your simple & nice solution. :-) – Venus Nov 12 '14 at 18:43
  • Sorry, last question. How I can proof this series $$\sum_{n=0}^\infty(-1)^n\left(\frac{1}{4n-a+2}+\frac{1}{4n+a+2}\right)=\frac{ \pi }{4}\sec\left(\frac{a \pi }{4}\right)$$ Do you have any references? Or did you use residue method? Can you elaborate using real analysis method? Thanks... – Venus Nov 12 '14 at 18:49
  • @venus, I added the proof of the series. I will come back to give the proof the integral. It is not trivial. – xpaul Nov 12 '14 at 22:47
  • 1
    @Venus: Let $u=\dfrac\pi4 a$ and $\sin u=\cos\bigg(\dfrac\pi2-u\bigg)$ and $\dfrac{1+\cos t}2=\cos^2\dfrac t2$ – Lucian Nov 12 '14 at 22:54
20

Here is a method that avoids complex analysis. That being said however, I think achille hui's approach is far superior as this answer uses too much (unnecessarily) heavy machinery.

Let $x\mapsto-\ln{x}$. We get \begin{align} \mathcal{I} =\int^1_0\frac{1-x^2}{1+x^2}\frac{1-x^4}{1+x^4}\frac{{\rm d}x}{x\ln^2{x}} =\int^1_0\left(\frac{1}{x}-\frac{2x}{1+x^4}\right)\frac{{\rm d}x}{\ln^2{x}} \end{align} Define $$\mathcal{I}(\alpha)=\int^1_0\left(\frac{1}{x}-\frac{2x}{1+x^4}\right)\frac{x^{\alpha}{\rm d}x}{\ln^2{x}}$$ Differentiating twice, one obtains \begin{align} \mathcal{I}''(\alpha) =&\frac{1}{\alpha}-2\sum^\infty_{n=0}(-1)^n\int^1_0x^{4n+\alpha+1}{\rm d}x\\ =&\frac{1}{\alpha}-2\sum^\infty_{n=0}\frac{(-1)^n}{4n+\alpha+2}\\ =&\frac{1}{\alpha}-\frac{1}{4}\sum^\infty_{n=0}\frac{1}{n+\frac{\alpha+2}{8}}+\frac{1}{4}\sum^\infty_{n=0}\frac{1}{n+\frac{\alpha+6}{8}}\\ =&\frac{1}{\alpha}+\frac{1}{4}\psi_0\left(\frac{\alpha+2}{8}\right)-\frac{1}{4}\psi_0\left(\frac{\alpha+6}{8}\right) \end{align} Integrate back once. \begin{align} \mathcal{I}'(\alpha) =&\ln{\alpha}+2\ln{\Gamma\left(\frac{\alpha+2}{8}\right)}-2\ln{\Gamma\left(\frac{\alpha+6}{8}\right)}+C_1 \end{align} The constant of integration is, by Striling's asymptotic series, $-3\ln{2}$. Now, recall the fact that $$\int\ln{\Gamma(x)}\ {\rm d}x=\frac{x(1-x)}{2}+\frac{x}{2}\ln(2\pi)+x\ln{\Gamma(x)}-\ln{G(x+1)}+C_2$$ You may find a proof in this answer. Hence, integrating once again, we obtain \begin{align} \mathcal{I}(\alpha) =&\alpha\ln{\alpha}-\alpha-\frac{(\alpha+2)(\alpha-6)}{8}+(\alpha+2)\ln(2\pi)+2(\alpha+2)\ln{\Gamma\left(\frac{\alpha+2}{8}\right)}\\ &-16\ln{G\left(\frac{\alpha+10}{8}\right)}+\frac{(\alpha-2)(\alpha+6)}{8}-(\alpha+6)\ln(2\pi)\\ &-2(\alpha+6)\ln{\Gamma\left(\frac{\alpha+6}{8}\right)}+16\ln{G\left(\frac{\alpha+14}{8}\right)}-3\alpha\ln{2}+C_2\\ =&C_2-4\ln(2\pi)-3\alpha\ln{2}+\alpha\ln{\alpha}+2(\alpha+2)\ln{\Gamma\left(\frac{\alpha+2}{8}\right)}\\ &-2(\alpha+6)\ln{\Gamma\left(\frac{\alpha+6}{8}\right)}-16\ln{G\left(\frac{\alpha+10}{8}\right)}+16\ln{G\left(\frac{\alpha+14}{8}\right)} \end{align} One may use the asymptotic series of the Barnes G (derived from the log-gamma integral and Stirling's) to check that $C_2=4\ln(2\pi)$. Letting $\alpha\to 0$, \begin{align} \mathcal{I} =&\mathcal{I}(0)\\ =&4\ln{\Gamma\left(\frac{1}{4}\right)}-12\ln{\Gamma\left(\frac{3}{4}\right)}-16\ln{G\left(\frac{5}{4}\right)}+16\ln{G\left(\frac{7}{4}\right)} \end{align} It remains to simplify this result. Using the Gamma reflection formula $\Gamma(z)\Gamma(1-z)=\pi\csc(\pi z)$, as well as the Barnes G functional equation $G(z+1)=G(z)\Gamma(z)$, we get $$\mathcal{I}=-6\ln{2}-12\ln{\pi}-16\ln\left(\frac{G\left(\frac{1}{4}\right)}{G\left(\frac{7}{4}\right)}\right)$$ Now recall that $G(z+1)$ has the infinite product representation $$G(z+1)=\left(\sqrt{2\pi}\right)^{z}e^{-\frac{(1+\gamma)z^2+z}{2}}\prod^\infty_{k=1}e^{\frac{z^2}{2k}-z}\left(1+\frac{z}{k}\right)^k$$ Taking the logarithm, \begin{align} \ln{G(z+1)} =&-\frac{z}{2}+\frac{z}{2}\ln(2\pi)-\frac{z^2}{2}-\frac{\gamma z^2}{2}+\sum^\infty_{k=1}\left\{k\ln\left(1+\frac{z}{k}\right)+\frac{z^2}{2k}-z\right\}\\ =&-\frac{z}{2}+\frac{z}{2}\ln(2\pi)-\frac{z^2}{2}-\frac{\gamma z^2}{2}+\sum^\infty_{k=1}\left\{\frac{z^2}{2k}-z+\sum^\infty_{m=1}\frac{(-1)^{m-1}}{m}\frac{z^m}{k^{m-1}}\right\}\\ =&-\frac{z}{2}+\frac{z}{2}\ln(2\pi)-\frac{z^2}{2}-\frac{\gamma z^2}{2}+\sum^\infty_{k=1}\sum^\infty_{m=3}\frac{(-1)^{m-1}}{m}\frac{z^m}{k^{m-1}}\\ =&-\frac{z}{2}+\frac{z}{2}\ln(2\pi)-\frac{z^2}{2}-\frac{\gamma z^2}{2}+\sum^\infty_{m=3}\frac{(-1)^{m-1}\zeta(m-1)}{m}z^m\\ =&-\frac{z}{2}+\frac{z}{2}\ln(2\pi)-\frac{z^2}{2}-\frac{\gamma z^2}{2}+\sum^\infty_{m=2}\frac{(-1)^{m}\zeta(m)}{m+1}z^{m+1}\\ \end{align} Letting $z\mapsto -z$, $$\ln{G(1-z)}=\frac{z}{2}-\frac{z}{2}\ln(2\pi)-\frac{z^2}{2}-\frac{\gamma z^2}{2}-\sum^\infty_{m=2}\frac{\zeta(m)}{m+1}z^{m+1}$$ It follows that \begin{align} \ln{\frac{G(1-z)}{G(1+z)}} =&z-z\ln(2\pi)-2\sum^\infty_{m=1}\frac{\zeta(2m)}{2m+1}z^{2m+1}\\ =&-z\ln(2\pi)+\int^z_0\pi x\cot(\pi x)\ {\rm d}x \end{align} Let $z=\frac{3}{4}$. \begin{align} \ln\left(\frac{G\left(\frac{1}{4}\right)}{G\left(\frac{7}{4}\right)}\right) =&-\frac{3}{4}\ln(2\pi)+2\sum^\infty_{n=1}\int^\frac{3}{4}_0\pi x\sin(2n\pi x)\ {\rm d}x\\ =&-\frac{3}{4}\ln(2\pi)+\frac{1}{2\pi}\sum^\infty_{n=1}\frac{\sin(3n\pi/2)}{n^2}-\frac{3}{4}\sum^\infty_{n=1}\frac{\cos(3n\pi/2)}{n}\\ =&-\frac{3}{4}\ln(2\pi)-\frac{1}{2\pi}\sum^\infty_{n=0}\frac{(-1)^n}{(2n+1)^2}+\frac{3}{8}\sum^\infty_{n=1}\frac{(-1)^{n-1}}{n}\\ =&-\frac{3}{8}\ln{2}-\frac{3}{4}\ln{\pi}-\frac{\mathbf{G}}{2\pi} \end{align} Finally, $$\mathcal{I}=-6\ln{2}-12\ln{\pi}-16\left(-\frac{3}{8}\ln{2}-\frac{3}{4}\ln{\pi}-\frac{\mathbf{G}}{2\pi}\right)=\Large{\frac{8\mathbf{G}}{\pi}}$$

M.N.C.E.
  • 10,439
  • 2
    Thank you so much for the real method approach. It's ok if it's too complicated, I haven't learned contour integration yet. +1 – Venus Nov 12 '14 at 10:27
  • 1
    @Venus I am glad you found this answer useful in some way. Thanks. – M.N.C.E. Nov 12 '14 at 12:22
  • 1
    +1 because you takes care of writing the result at the very end. Usually we have to guess what was the result. Good. – Felix Marin Dec 21 '14 at 04:25
18

Let $f(x) = \tanh(x)\tanh(2x)$. Rewrite the integral at hand as $$I = \int_0^\infty \frac{f(x)}{x^2}dx = \frac12 \int_{-\infty}^{\infty} \frac{f(x)}{x^2} dx = \frac12 \lim_{k\to\infty} \int_{-k\pi}^{k\pi} \frac{f(x)}{x^2} dx\\ $$ For each positive integer $k$, consider the rectangular region $$D_k = \big\{ u + iv \in \mathbb{C} : |u| \le k\pi, 0 \le v \le k\pi \big\}$$ and the contour integral over its boundary:

$$C_k \stackrel{def}{=} \int_{\partial D_k} \frac{f(z)}{z^2} dz = \left( \int_{-k\pi}^{k\pi} + \int_{k\pi}^{k\pi(1+i)} + \int_{k\pi(1+i)}^{k\pi(-1+i)} + \int_{k\pi(-1+i)}^{-k\pi} \right) \frac{f(z)}{z^2} dz $$

$C_k$ split into 4 pieces, one for each edges of the $D_k$. It is not hard to show as $k \to \infty$, the contribution from the three edges (the top, left and bottom) goes to zero. This implies

$$I = \frac12 \lim_{k\to\infty} \int_{\partial D_k} \frac{f(z)}{z^2} dz\tag{*1}$$

Let $\phi = e^{2z}$, we have

$$\begin{align}f(z) &= \tanh(z) \tanh(2z) = \left(\frac{\phi - 1}{\phi+1}\right)\left(\frac{\phi^2-1}{\phi^2+1}\right) = \frac{(\phi-1)^2}{\phi^2+1} = 1 - \frac{2\phi}{\phi^2+1} \\ &= 1 - \frac{1}{\cosh 2z}\end{align}$$

Recall the well known? expansion of $\cot z$

$$\cot z = \sum_{n=-\infty}^\infty \frac{1}{z - n\pi}$$

We have

$$\begin{array}{rrl} & \frac{1}{\sin z} &= \frac{1+\cos z}{\sin z} - \frac{\cos z}{\sin z} = \cot\frac{z}{2} - \cot z = \sum_{n=-\infty}^\infty \frac{(-1)^n}{z - n\pi}\\ \implies & \frac{1}{\cos z} &= -\frac{1}{\sin(z - \frac{\pi}{2})} = \sum_{n=-\infty}^\infty \frac{(-1)^{n-1}}{z - (n+\frac12)\pi}\\ \implies & \frac{1}{\cosh z} &= \frac{1}{\cos(-i z)} = -i \sum_{n=-\infty}^\infty \frac{(-1)^n}{z - (n+\frac12)\pi i}\\ \implies & f(z) & = 1 + \frac{i}{2} \sum_{n=-\infty}^\infty \frac{(-1)^n}{z - (n+\frac12)\frac{\pi}{2} i}\tag{*2} \end{array}$$

Inside $D_k$, $f(z)$ has poles at $(n + \frac12)\frac{\pi}{2} i$ for each $n \in \mathbb{N}$. We can evaluate the contour integral in $(*1)$ by summing the residues at these poles. As a result,

$$I = \frac12 (2\pi i)(\frac{i}{2})\sum_{n=0}^\infty \frac{(-1)^n}{((n+\frac12)\frac{\pi}{2}i)^2} = \frac{8K}{\pi}$$

where $\;\displaystyle K = \sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)^2}\;$ is the Catalan's constant.

Update

If one want to minimize the use of complex analysis, an alternate starting point is the expansion of $f(z)$ in $(*2)$. Let $\alpha_n = (n+\frac12)\frac{\pi}{2}$ and notice $\alpha_{-1-n} = -\alpha_n$, we have

$$f(x) = 1 + \frac{i}{2}\sum_{n=0}^\infty (-1)^n\left(\frac{1}{x -\alpha_n i} - \frac{1}{x + \alpha_n i}\right) = 1 - \sum_{n=0}^\infty \frac{(-1)^n \alpha_n}{x^2 + \alpha_n^2} $$ Since $f(0) = 0$, we have

$$\frac{f(x)}{x^2} = \frac{f(x)-f(0)}{x^2} = \frac{1}{x^2} \sum_{n=0}^\infty (-1)^n \alpha_n\left( \frac{1}{\alpha_n^2} - \frac{1}{x^2 + \alpha_n^2}\right) = \sum_{n=0}^\infty\frac{(-1)^n}{\alpha_n(x^2+\alpha_n^2)} $$ If you look at the terms of this series in units of pair, we find the value of any pair is always non-negative. This means we can integrate this series pair by pair and get:

$$\int_0^\infty \frac{f(x)}{x^2}dx = \sum_{n=0}^\infty \frac{(-1)^n}{\alpha_n}\int_0^\infty \frac{dx}{x^2+\alpha_n^2} = \frac{\pi}{2}\sum_{n=0}^\infty \frac{(-1)^n}{\alpha_n^2} = \frac{8}{\pi}\sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)^2} = \frac{8K}{\pi} $$ The same result we obtained using contour integrals.

achille hui
  • 122,701
5

By symmetry, we have $$\newcommand{\Res}{\operatorname*{Res}} \int_0^\infty\frac{\tanh(x)\tanh(2x)}{x^2}\,\mathrm{dx} =\frac12\int_{-\infty}^\infty\frac{\tanh(x)\tanh(2x)}{x^2}\,\mathrm{dx}\tag1 $$ There are singularities at $z_k=i\pi\frac{2k+1}4$ and $$ \Res_{z=z_k}\left(\frac{\tanh(z)\tanh(2z)}{z^2}\right)=(-1)^{k+1}\frac{8i}{\pi^2(2k+1)^2}\tag2 $$ Sum over the telescoping paths $$ \gamma_k=\color{#090}{\overbrace{\left(-R+i\pi\tfrac k2,R+i\pi\tfrac k2\right)}^\text{these contours telescope}}\cup\color{#C00}{\overbrace{\left(R+i\pi\tfrac k2,R+i\pi\tfrac{k+1}2\right)}^\text{these integrals vanish}}\cup\\ \phantom{\gamma_k}\color{#090}{\left(R+i\pi\tfrac{k+1}2,-R+i\pi\tfrac{k+1}2\right)}\cup\color{#C00}{\left(-R+i\pi\tfrac{k+1}2,-R+i\pi\tfrac k2\right)}\tag3 $$ where $\gamma_k$ contains $z_k$.

enter image description here

The sum of the residues in the upper half plane times $\pi i$ will be the integral on the half line: $$ \begin{align} \int_0^\infty\frac{\tanh(x)\tanh(2x)}{x^2}\,\mathrm{dx} &=\pi i\sum_{k=0}^\infty(-1)^{k+1}\frac{8i}{\pi^2(2k+1)^2}\tag4\\ &=\frac8\pi\sum_{k=0}^\infty\frac{(-1)^k}{(2k+1)^2}\tag5\\[3pt] &=\frac{8G}\pi\tag6 \end{align} $$ where $G$ is Catalan's Constant.

robjohn
  • 345,667
3

Write $$ I=\frac{1}{2}\int^{\infty}_{-\infty}\frac{\tanh(x)\tanh(2x)}{x^2}dx=\int^{\infty}_{-\infty}\frac{f(x)}{\cosh(\pi x)}dx, $$ where $f(x)=\frac{2(-1+\cosh(\pi x))}{\pi^2 x^2}$.

Lemma.

If the function $f(z)$ is analytic in $Im(z)>0$ and continuous at $Im(z)\geq 0$. It also satisfies $$ |f(z)|\leq C (1+|z|)^{N} e^{b |Re(z)|}\textrm{, }0\leq b\leq\pi-\epsilon\textrm{, }\epsilon>0 $$ for all $z$ with $Im(z)\geq 0$ (note: here is $b=\pi$, but $N=-2$), then $$ \int^{\infty}_{-\infty}\frac{f(t)}{\cosh(\pi t)}e^{ita}dt=2\sum^{\infty}_{k=0}(-1)^k f(i(k+1/2))e^{-a(k+1/2)}\textrm{, }a>0. $$ Proof. The function $g(z)=\frac{f(z)}{\cosh(\pi z)}$ is meromorphic in $Im(z)>0$ and has poles at $z_k=i(k+1/2)$ with $$ Res(g;i(k+1/2))=f(i(k+1/2))\frac{(-1)^k}{\pi i} $$ a in the real line and meromorphic at $Im(z)>0$. Hence if $m$ is natural number, $R=m$ and $\gamma_R$ is the upper semicircle of diameter $[-R,R]$, then $$ \frac{1}{2\pi i}\int_{\gamma_R}g(z)dz=\sum^{\infty}_{k=0}\frac{(-1)^k}{\pi i}f(i(k+1/2)) $$ For we have $|\cos(\pi R e^{i \theta})|\geq c e^{\pi |\cos(\theta)|}$ and $$ \left|\int^{\pi}_{0}\frac{f(Re^{i\theta})}{\cosh(\pi R e^{i\theta})}iRe^{i\theta}\right|\leq C \left|\int^{\pi}_{0}(1+R)^{-2}Re^{(b-\pi)R|\cos(\theta)|}d\theta\right|\leq C $$ $$ \leq C \int^{\pi}_{0}(1+R)^{-1}d\theta\rightarrow 0\textrm{, when }R\rightarrow \infty. $$ $$ QED $$

For the case $$ f(x)=\frac{2(-1+\cosh(\pi x))}{\pi^2 x^2} $$
we have $$ I=\frac{\pi}{2}2\sum^{\infty}_{k=0}(-1)^k\frac{8(1+\sin(k\pi))}{\pi^2(2k+1)^2}=\frac{8C}{\pi} $$

3

Note

$$I=\int_{-\infty}^{\infty} \frac{\tanh x \tanh 2x}{2x^2} dx \overset{t=e^{-2x}} = \int_0^\infty \frac{(1-t)^2dt}{t(1+t^2)\ln^2 t} \overset{IBP} =\int_0^\infty \frac{2(t^2-1)dt}{(1+t^2)^2\ln t}\\ $$

Let $J(a)=\int_0^\infty \frac{t^{a+1}}{(1+t^2)^2\ln t}dt$ $$J’(a) = \int_0^\infty \frac{t^{a+1}dt}{(1+t^2)^2} \overset{IBP} =-\frac a2 \int_0^\infty \frac{t^{a+1}dt}{1+t^2} =\frac{\pi a}{4}\csc\frac{\pi a}2 $$ Then

$$I= 2\int_{-1}^{1}J’(a)da \overset{u=\frac{\pi a}2}=\frac4\pi \int_0^{\pi/2}u\csc u\>du \overset{t=\tan\frac u2} =\frac 8\pi \int_0^{1}\frac {\tan^{-1}t}{t}dt =\frac{8}{\pi}G \\ $$

Quanto
  • 97,352
2

$$ I=\int^{\infty}_{0}\frac{\tanh(2x)\tanh(x)}{x^2}dx=\int^{\infty}_{0}\left(1-\frac{1}{\cosh(2x)}\right)\frac{dx}{x^2}=2\int^{\infty}_{0}\left(1-\frac{1}{\cosh(x)}\right)\frac{dx}{x^2}. $$ Set $x=\cosh^{(-1)}(t)$ to get $$ I=2\int^{\infty}_{1}\frac{1-1/t}{\sqrt{t^2-1}}\frac{dt}{\cosh^{(-1)}(t)^2}. $$ From $\frac{d}{dt}\left(\frac{1}{\cosh^{(-1)}(t)}\right)=\frac{1}{\cosh^{(-1)}(t)^2\sqrt{t^2-1}}$, we get $$ I=2\int^{\infty}_{1}\frac{1}{t^2\cosh^{(-1)}(t)}dt. $$ Going backwords we set $t=\cosh(y)$. Hence $$ I=2\int^{\infty}_{0}\frac{\tanh(y)}{y\cosh(y)}dy=\frac{8C}{\pi}\tag 1 $$

(1) is here (relation 41)

2

I wrote a fairly short residue answer to this question, but here is a completely real answer.


A Useful Euler Sum

Applying $(1)$ from this answer to $-x^2$ gives $$ \sum_{k=0}^\infty(-1)^kH_kx^{2k}=-\frac{\log\left(1+x^2\right)}{1+x^2}\tag1 $$ and therefore, $$ \begin{align} \sum_{k=0}^\infty\frac{(-1)^k}{2k+1}H_k &=-\int_0^1\frac{\log\left(1+x^2\right)}{1+x^2}\,\mathrm{d}x\tag2\\ &=2\int_0^{\pi/4}\log(\cos(u))\,\mathrm{d}u\tag3\\ &=2\sum_{k=1}^\infty\frac{(-1)^{k-1}}k\int_0^{\pi/4}\cos(2kx)\,\mathrm{d}x-\frac\pi2\log(2)\tag4\\ &=\sum_{k=1}^\infty\frac{(-1)^{k-1}}{k^2}\sin\left(\frac\pi2k\right)-\frac\pi2\log(2)\tag5\\ &=\sum_{k=0}^\infty\frac{(-1)^k}{(2k+1)^2}-\frac\pi2\log(2)\tag6\\[3pt] &=\mathrm{G}-\frac\pi2\log(2)\tag7 \end{align} $$ Explanation:
$(2)$: integrate $(1)$
$(3)$: substitute $x\mapsto\tan(u)$
$(4)$: $\log(\cos(x))=\sum\limits_{k=1}^\infty\frac{(-1)^{k-1}}k\cos(2kx)-\log(2)$
$\phantom{\text{(13):}}$ as shown in this answer
$(5)$: integrate
$(6)$: $\sin\left(\frac\pi2k\right)=0$ for even $k$
$\phantom{\text{(6):}}$ $\sin\left(\frac\pi2(2k+1)\right)=(-1)^k$
$(7)$: definition of Catalan's Constant


The Integral

Integration by Parts says $$\newcommand{\sech}{\operatorname{sech}} \begin{align} \int_0^\infty\frac{\tanh(x)\tanh(2x)}{x^2}\,\mathrm{d}x &=2\int_0^\infty\frac{\sech(2x)\tanh(2x)}x\,\mathrm{d}x\tag8\\ &=2\int_0^\infty\frac{\sech(x)\tanh(x)}x\,\mathrm{d}x\tag9 \end{align} $$ Using $\pi\cot(\pi x)=\sum\limits_{k\in\mathbb{Z}}\frac1{k+x}$ and $\pi\csc(\pi x)=\sum\limits_{k\in\mathbb{Z}}\frac{(-1)^k}{k+x}$, as shown in this answer, it is not too hard to derive $$ \frac\pi{4x}\tanh\left(\frac\pi2x\right) =\sum_{j=0}^\infty\frac1{(2j+1)^2+x^2}\tag{10} $$ and $$ \frac\pi4\sech\left(\frac\pi2x\right) =\sum_{k=0}^\infty\frac{(-1)^k(2k+1)}{(2k+1)^2+x^2}\tag{11} $$ Furthermore, Partial Fractions gives $$ \int_0^\infty\frac1{a^2+x^2}\frac1{b^2+x^2}\,\mathrm{d}x =\frac\pi{2(a+b)ab}\tag{12} $$ Therefore, $$ \begin{align} 2\int_0^\infty\frac{\tanh(x)\sech(x)}{x}\,\mathrm{d}x &=\frac8\pi\sum_{j=0}^\infty\sum_{k=0}^\infty\frac{(-1)^k}{(k+j+1)(2j+1)}\tag{13}\\ &=\frac8\pi\sum_{j=0}^\infty\sum_{k=0}^\infty(-1)^k\left(\frac1{j+\frac12}-\frac1{k+j+1}\right)\frac1{2k+1}\tag{14}\\ &=\frac8\pi\sum_{k=0}^\infty(-1)^k\frac{\color{#C00}{H_k}\color{#090}{-H_{-1/2}}}{2k+1}\tag{15}\\[3pt] &=\frac8\pi\left(\color{#C00}{\mathrm{G}-\frac\pi2\log(2)}\color{#090}{+\frac\pi2\log(2)}\right)\tag{16}\\[9pt] &=\frac{8\mathrm{G}}\pi\tag{17} \end{align} $$ Explanation:
$(13)$: $(10)$, $(11)$, and $(12)$ with $a=2j+1$ and $b=2k+1$
$(14)$: partial fractions
$(15)$: sum in $j$
$(16)$: apply $(7)$
$\phantom{\text{(16):}}$ the Gregory Series says that $\sum\limits_{k=0}^\infty\frac{(-1)^k}{2k+1}=\frac\pi4$
$\phantom{\text{(16):}}$ this answer computes $H_{-1/2}=-2\log(2)$
$(17)$: cancel $\frac\pi2\log(2)$

Putting together $(9)$ and $(17)$ yields $$ \int_0^\infty\frac{\tanh(x)\tanh(2x)}{x^2}\,\mathrm{d}x=\frac{8\mathrm{G}}\pi\tag{18} $$

robjohn
  • 345,667