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.
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. $$
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}}$$