TITLE: Approximating $\pi$ and $\ln 2$ with $I_k=\int_0^\infty \left(\text{sech}x\tanh\tfrac12x\right)^k\,dx$ for integer $k$
QUESTION [7 upvotes]: Consider the following integral:
$$I_k=\int_0^\infty \left(\text{sech}x\tanh\tfrac12x\right)^k\,dx$$
where $k\in\Bbb N$.
If we evaluate $I_1$, $I_2$, $I_3$, etc. we get the following pattern:

$I_1=\log(2)$
$I_2=-3+\pi$
$I_3=\frac 72-5\log(2)$
$I_4=22-7\pi$
$I_5=-\frac{341}{12}+41\log(2)$
$I_6=-\frac{968}{5}+\frac{493}{8}\pi$
...

From this data we can see that:
$$\begin{align}
\pi&=3+I_2=\frac{22}{7}-\frac17 I_4=\frac{7744}{2465}+\frac{8}{493}I_6 \\[4pt]
\log(2)&=0+I_1=\frac{7}{10}-\frac15I_3=\frac{341}{492}+I_5
\end{align}$$
And because $I_k$ decreases very rapidly($I_{10}$ is in the order of $1e6$) we can set $I_k\approx 0$ for high $k$ and we get rational approximations of both, $\pi$ and $\log(2)$, for $I_{2k}$ and $I_{2k+1}$, respectively, that apparently go on forever.

I see some equations that somehow "encode" the information of a given number, but how is it that this integral has the information of both $\pi$ and $\log(2)$, apparently unrelated numbers?

Thanks.

REPLY [2 votes]: Too long for a comment.
We have the convenient relation 
$$\text{sech}(x)\tanh(x/2)=\frac{2}{e^x+1}-\frac{2}{e^{2x}+1},$$
so let 
$$L_n=I_{2n+1}=2^{2n+1}\sum_{k=0}^{2n+1}(-1)^k{2n+1\choose k}\int_0^{\infty}\frac{dx}{(e^x+1)^{2n-k+1}(e^{2x}+1)^k}$$
and $$P_n=I_{2n}=2^{2n}\sum_{k=0}^{2n}(-1)^k{2n\choose k}\int_0^{\infty}\frac{dx}{(e^x+1)^{2n-k}(e^{2x}+1)^k}.$$
These integrals may be easier to evaluate explicitly.