How can I calculate the following integral using Mathematica? $$\int_{-\infty}^{\infty} \frac{\mathrm{d} x}{\left(1+x^2\right) \operatorname{ch} \frac{\pi x}{2}} = 2 \ln 2$$
I tried:
int1 = Assuming[Element[x, Reals],
Integrate[
FullSimplify[1/((1 + x^2)*Cosh[(Pi*x)/2])], {x, -Infinity,
Infinity}, PrincipalValue -> True]]
int2 = Integrate[
1/((1 + x^2)*Cosh[(Pi*x)/2]), {x, -Infinity, Infinity},
Assumptions -> Element[x, Reals], GenerateConditions -> False]
int3 = Integrate`InverseIntegrate[
1/((1 + x^2)*Cosh[(Pi*x)/2]), {x, -Infinity, Infinity},
Assumptions -> Element[x, Reals]]
I can calculate it using the residue theorem, but this belongs to mathematics. Is it possible to directly solve this integral with Mathematica without using the residue theorem?
NIntegrate[1/((1 + x^2)*Cosh[(Pi*x)/2]), {x, -Infinity, Infinity}]
enough? $\endgroup$Log[4]
. $\endgroup$