Integral $\int_0^\infty \log(1+x^2)\frac{\cosh \pi x +\pi x\sinh \pi x}{\cosh^2 \pi x}\frac{dx}{x^2}=4-\pi$? Hello am looking for a solution to proving this.
$$
I:=\int_0^\infty \log(1+x^2)\frac{\cosh \pi x +\pi x\sinh \pi x}{\cosh^2 \pi x}\frac{dx}{x^2}=4-\pi.
$$
This one is related to Integral $\int_0^\infty \log(1+x^2)\frac{\cosh{\frac{\pi x}{2}}}{\sinh^2{\frac{\pi x}{2}}}\mathrm dx=2-\frac{4}{\pi}$ that the community together seemed to solve!
I tried writing
$$
I=\int_0^\infty \log(1+x^2)\frac{dx}{x^2\cosh \pi x}+\int_0^\infty \log(1+x^2)\frac{\pi x\tanh \pi x}{\cosh \pi x }\frac{dx}{x^2}
$$
but is not so clear now that I have two integrals to solve.  I wasn't sure how integrating by parts would give me a clearer integral as the terms do not clean up here like the last one.  I am not sure how else
Introducing something like $I(\alpha), I'(\alpha)$ in this situation did help but not much after this: $$
I(\alpha)=\int_0^\infty \log(1+\alpha x^2) \frac{\cosh \pi x +\pi x\sinh \pi x}{\cosh^2 \pi x}\frac{dx}{x^2}, \frac{dI}{d\alpha}=
$$ 
$$
\int_0^\infty \frac{dx}{1+\alpha x^2}\frac{\cosh \pi x +\pi x\sinh \pi x}{\cosh^2 \pi x}=\int_0^\infty \frac{dx}{(1+\alpha x^2)\cosh \pi x}+\pi\int_0^\infty \frac{dx}{1+\alpha x^2}\frac{x\tanh \pi x}{\cosh \pi x}
$$
  Thank you
 A: I will present an alternative solution here.
Denote, for $a$ between $-\pi$ and $\pi$ inclusive, $$F(a)=\int_{-\infty}^{\infty} {\cosh(ax)\over {\cosh(\pi x)}}{1\over {1+x^2}}dx$$ then by differentiation under the integral sign, which is easily justified by uniform convergence, we have 
$$F''(a)+F'(a)=\int_{-\infty}^{\infty} {\cosh(ax)\over {\cosh(\pi x)}}dx = \sec {a\over 2}$$
The above can be evaluated by standard complex analysis techniques.
Note that $F(\pi)=\pi$ and $F'(0)=0$
These initial value conditions, along with the differential equation above, can be solved with variation of parameters, giving 
$$F(a)=4\cos{a\over 2}-\pi\cos a-2\sin a\ln\tan({a\over 4}+{\pi\over 4})$$
This gives $$F(0)=\int_{-\infty}^{\infty} {1\over {\cosh(\pi x)}}{1\over {1+x^2}}dx=4-\pi$$
which is the same as the original question according to Ron Gordon's answer.
A: This integral is doable using Fourier methods.  First note that
$$\frac{\cosh{\pi x} + \pi x \sinh{\pi x}}{x^2 \cosh^2{\pi x}} = -\frac{d}{dx} \frac1{x \cosh{\pi x}}$$
Then integrate by parts to get that
$$I = \int_{-\infty}^{\infty} dx \frac{\operatorname*{sech}{\pi x}}{1+x^2}$$
This may be evaluated using Parseval's equality, because the Fourier transform of each factor is well-known.  Thus
$$I = \frac1{2 \pi} \int_{-\infty}^{\infty} dk \, \pi \, e^{-|k|} \operatorname*{sech}{(k/2)} = 2 \int_0^{\infty} dk \frac{e^{-k}}{e^{k/2}+e^{-k/2}}$$
(For a derivation of the FT of the sech term, see this answer.)  This integral is easily evaluated by expanding the denominator:
$$I = 2 \sum_{n=0}^{\infty} (-1)^n \int_0^{\infty} dk \, e^{-(n+3/2) k} = 4 \sum_{n=0}^{\infty} \frac{(-1)^n}{2 n+3} = 4-\pi$$
ADDENDUM
It occurred to me that there's a much more straightforward way to evaluate the integral obtained through Parseval:
$$I = 2 \int_0^{\infty} dk \frac{e^{-k}}{e^{k/2}+e^{-k/2}} = 4 \int_0^1 du \frac{u}{u+1/u} \\ = 4 \int_0^1 du \left (1-\frac1{1+u^2} \right ) = 4 \left (1-\frac{\pi}{4} \right )=4-\pi$$
