Closed form of $\int_{0}^{\infty} \frac{\tanh(x)\,\tanh(2x)}{x^2}\;dx$ 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.
 A: 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$.

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.
A: 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}
$$ 
A: 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. $$
A: 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
\\
$$
A: 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.
A: $$
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)
