Integral $\int_0^{\infty} \frac{\log x}{\cosh^2x} \ \mathrm{d}x = \log\frac {\pi}4- \gamma$ Inspired by the user @Integrals, I thought I'd find some nice integrals! Especially interesting are those involving $\log \pi$. From Borwein and Devlin's "The Computer as Crucible", pg. 58 - show that
$$\displaystyle \int_0^{\infty} \frac{\log x}{\cosh^2x} \ \mathrm{d}x = \log\frac {\pi}4 - \gamma,$$
where $\gamma$ is the Euler-Mascheroni constant. 
 A: Let the considered integral be denoted by $I$. We have
$$\eqalign{I&=\int_0^{1}\frac{\ln x}{\cosh^2x}dx+\int_{1}^\infty\frac{\ln x}{\cosh^2x}dx\cr
&=\Big[(\ln x)\tanh x \Big]_0^1-\int_0^1\frac{\tanh x}{x}dx+
\Big[(\ln x)(\tanh x-1) \Big]_1^\infty-\int_1^\infty\frac{\tanh x-1}{x}dx\cr
&=2\int_1^\infty\frac{dx}{x(1+e^{2x})}-\int_0^1\frac{1-e^{-2x}}{x(1+e^{-2x})}dx\cr
&=2\int_1^\infty\frac{dx}{x(1+e^{2x})}-\int_0^1\frac{1-e^{-2x}}{x}\left(\frac{1}{1+e^{-2x}}-1\right)dx-
\int_0^1\frac{1-e^{-2x}}{x}dx\cr
&=2\int_1^\infty\frac{dx}{x(1+e^{2x})}+\int_0^1\frac{e^{-2x}-e^{-4x}}{x(1+e^{-2x})}dx-
\int_0^1\frac{1-e^{-2x}}{x}dx\cr
&=2\int_1^\infty\frac{dx}{x(1+e^{2x})}-\int_1^\infty\frac{e^{-2x}-e^{-4x}}{x(1+e^{-2x})}dx+\int_0^\infty\frac{e^{-2x}-e^{-4x}}{x(1+e^{-2x})}dx-
\int_0^1\frac{1-e^{-2x}}{x}dx\cr
&=\int_1^\infty\frac{1+e^{-2x}}{x(1+e^{2x})}dx+\int_0^\infty\frac{e^{-2x}-e^{-4x}}{x(1+e^{-2x})}dx-
\int_0^1\frac{1-e^{-2x}}{x}dx\cr
&=\int_1^\infty\frac{e^{-2x}}{x}dx-
\int_0^1\frac{1-e^{-2x}}{x}dx+\int_0^\infty\frac{e^{-2x}-e^{-4x}}{x(1+e^{-2x})}dx\cr
&=\underbrace{\int_2^\infty\frac{e^{-t}}{t}dt-
\int_0^2\frac{1-e^{-t}}{t}dt}_A+\underbrace{\int_0^\infty\frac{e^{-t}-e^{-2t}}{t(1+e^{-t})}dt}_B}
$$
Now, note that
$$\eqalign{
A&=\int_2^\infty\frac{e^{-t}}{t}dt-\int_0^1\frac{1-e^{-t}}{t}dt-
\int_1^2\frac{1-e^{-t}}{t}dt\cr
&=\int_2^\infty\frac{e^{-t}}{t}dt-\int_0^1\frac{1-e^{-t}}{t}dt-\ln2
+\int_1^2\frac{e^{-t}}{t}dt\cr
&=\int_1^\infty\frac{e^{-t}}{t}dt-\int_0^1\frac{1-e^{-t}}{t}dt-\ln2\cr
&=-\gamma-\ln2
}
$$
To calculate $B$ we can do the following 
$$\eqalign{
B&=\int_0^\infty\frac{e^{-t}-e^{-2t}}{t}\left(\sum_{n=0}^\infty(-1)^ne^{-nt}\right)dt\cr
&=\sum_{n=0}^\infty(-1)^n\int_0^\infty\frac{e^{-(n+1)t}-e^{-(n+2)t}}{t}dt\cr
&=\sum_{n=0}^\infty(-1)^n\ln\left(\frac{n+2}{n+1}\right)\cr
&=\lim_{m\to\infty}\sum_{n=0}^{2m-2}(-1)^n\ln\left(\frac{n+2}{n+1}\right)\cr
&=\lim_{m\to\infty}\ln\left(\prod_{k=1}^m\frac{2k}{2k-1}\prod_{k=1}^{m-1}\frac{2k}{2k+1}\right)\cr
&=\lim_{m\to\infty}\ln\left(\frac{(2m)!!(2m-2)!!}{((2m-1)!!)^2}\right)=\ln\left(\frac{\pi}{2}\right)\cr
}
$$
By Stirling's formula. This yields $I=\ln \pi-2\ln 2-\gamma$. $\qquad\square$
A: Let $ \displaystyle I(a) =  \int_{0}^{\infty} \frac{x^{a}}{\cosh^{2} x} \ dx$.
Then if $\text{Re} (a) >0$,
$$ \begin{align} I(a) &= 4 \int_{0}^{\infty} \frac{x^{a}}{(e^{x}+e^{-x})^{2}} \ dx \\ &= 4 \int_{0}^{\infty}x^{a} \frac{e^{-2x}}{(1+e^{-2x})^{2}} \ dx \\ &=4\int_{0}^{\infty}  x^{a} \sum_{n=1}^{\infty} (-1)^{n-1} n e^{-2nx} \ dx \\ &=4 \sum_{n=1}^{\infty} (-1)^{n-1}n \int_{0}^{\infty} x^{a} e^{-2nx} \ dx \\ &= 4 \sum_{n=1}^{\infty} (-1)^{n-1} n \frac{\Gamma(a+1)}{(2n)^{a+1}} \\ &= \frac{2 \Gamma(a+1)}{2^{a}}\sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{n^{a}} \\ &= \frac{2 \Gamma(a+1) \eta(a)}{2^{a}} \end{align}$$
where $\eta(a)$ is the Dirichlet eta function.
But by analytic continuation, the above formula is valid if $\text{Re}(a) >- 1$.
Then differentiating under the integral sign we get
$$ \begin{align} I'(a) &= \int_{0}^{\infty} \frac{x^{a} \log(x)}{\cosh^{2} x} \ dx \\ &= 2 \ \frac{[\Gamma'(a+1) \eta(a) + \Gamma(a+1) \eta'(a)]2^{a}- \Gamma(a+1) \eta(a) \log (2) 2^{a}}{2^{{2a}}} \ , \end{align}$$
which means
$$ \int_{0}^{\infty}\frac{\log x}{\cosh^{2}x} \ dx = I'(0) = 2 \Big( \Gamma'(1) \eta(0)+\eta'(0) - \eta(0) \log(2) \Big) .$$
The eta values can be determined using the relation
$$\eta(s) = (1-2^{1-s})\zeta(s) $$
and the known Riemann zeta values $$\zeta(0) = -\frac{1}{2} $$ and  $$  \zeta'(0) = - \frac{1}{2} \log (2 \pi) . $$
Therefore,
$$ \begin{align} \int_{0}^{\infty}\frac{\log x}{\cosh^{2}x} \ dx &= 2 \left[-\gamma \left(\frac{1}{2}\right)+ \frac{1}{2} \log \left(\frac{\pi}{2}\right) -\frac{1}{2}\log(2) \right] \\ &= \log \left( \frac{\pi}{4}\right) - \gamma . \end{align}$$
A: Largely speaking, we have  
$$\begin{align}
\int_0^{\infty}  \frac{\log x}{\cosh^2x}\ \mathrm{d}x &=\lim_{a\to0} \lim_{b\to2}\frac{\partial}{ \partial a \partial b}\left(-4\int_0^{ \infty}\frac{x^{a-1}}{1+e^{b x}} \ dx\right)\\&=
\lim_{a\to0} \lim_{b\to2}\frac{\partial}{\partial a \partial b}\left(b^{-a} (2^{3-a}-4) \Gamma(a) \zeta(a)\right)\\&=\log\left(\frac{\pi}{4}\right)-\gamma\end{align}$$
Done.
