<s>[INST] How can i evaluate this integral with or without using CAS $\int_0^{\infty}\frac{\mathrm dx}{(x^2+1)\cosh(\pi x)}$ $$\int_0^{\infty}\frac{\mathrm dx}{(x^2+1)\cosh(\pi x)}$$
Firstly i used substitution $\pi x=t; \mathrm dx=\frac{\mathrm dt}{\pi}$
$$\pi \int_0^{\infty}\frac{\mathrm dt}{(t^2+\pi^2)\cosh t}$$
writing $\cosh t =\frac{e^{t}+e^{-t}}{2}=\frac{1+e^{-2t}}{2e^{-t}}$
$$2\pi\int_0^{\infty}\frac{e^{-t}}{(t^2+\pi^2)(1+e^{-2t})}$$
substituting $e^{-t}=v;-e^{-t}\mathrm dt=\mathrm dv$
$$2\pi\int_0^{1}\frac{\mathrm dv}{(\ln^2 v+\pi^2)(1+v^2)}$$
 [/INST] Similar to the question already mentioned by @Laxmi Narayan Bhandari, considering the infinite series
$$\text{sech}(z)=\pi\sum_{k=0}^\infty  (-1)^k\frac{  (2 k+1)}{\pi ^2 \left(k+\frac{1}{2}\right)^2+z^2}$$
Making the problem more general
$$I=\int_0^\infty \frac{\text{sech}(a x)}{b x^2+1}\,dx \quad \text{with} \quad a>0 \quad \text{and} \quad b>0$$ we have
$$\frac{\text{sech}(a x)}{b x^2+1}=4 \pi\sum_{k=0}^\infty(-1)^k\frac{   (2 k+1)}{\left(b x^2+1\right) \left(4 a^2 x^2+\pi ^2 (2
   k+1)^2\right)}$$ Using partial fraction decomposition
$$\frac{ 1}{\left(b x^2+1\right) \left(4 a^2 x^2+\pi ^2 (2
   k+1)^2\right)}=$$ $$\frac{b}{\left(b x^2+1\right) \left(\pi ^2 b (2 k+1)^2-4 a^2\right)}-\frac{4 a^2}{\left(\pi ^2 b (2 k+1)^2-4 a^2\right) \left(4 a^2 x^2+\pi ^2 (2
   k+1)^2\right)}$$
$$\int_0^\infty\frac{ dx}{\left(b x^2+1\right) \left(4 a^2 x^2+\pi ^2 (2
   k+1)^2\right)}=$$
$$\frac{\pi  \sqrt{b}}{2 \left(\pi ^2 b (2 k+1)^2-4 a^2\right)}-\frac{a}{(2 k+1) \left(\pi ^2 b (2 k+1)^2-4 a^2\right)}$$
After summations,
$$\color{red}{I=\int_0^\infty \frac{\text{sech}(a x)}{b x^2+1}\,dx=\frac{\psi \left(\frac{a}{2 \pi\sqrt{b}  }+\frac{3}{4}\right)-\psi
   \left(\frac{a}{2 \pi\sqrt{b}  }+\frac{1}{4}\right)}{2 \sqrt{b}}}$$
If, as in your case, $a=\pi$ and $b=1$, the result is
$$\int_0^\infty \frac{\text{sech}(\pi x)}{ x^2+1}\,dx=2-\frac \pi 2$$ and, if  $a=\pi$ and $b=4$ as in the linked question
$$\int_0^\infty \frac{\text{sech}(\pi x)}{ 4x^2+1}\,dx=\frac{\log (2)}{2}$$
For $a=\pi$, these are the only cases where the result simplifies.
Edit
Update
After @Gary comment, let $z=\frac{a}{2 \pi  \sqrt{b}}$ which makes
$$I \sqrt{b}=\frac 12 \Bigg[ {\psi \left(z+\frac{3}{4}\right)-\psi
   \left(z +\frac{1}{4}\right)}\Bigg]\sim\sum_{k=0}^\infty  \frac {E_{2 k} } {(4z)^{2k+1} }$$
Using this expansion to build $P_{m,m+1}$ Padé approximants,we obtain very good approximations of $I \sqrt{b}$. For example
$$P_{3,4}=\frac {52 z+64 z^3 } {9+224 z^2+256 z^4 }$$ shows an absolute relative error of $0.0015$% for $z=2$ and
$$\Phi=\int_2^\infty \Big[I \sqrt{b}-P_{3,4}\Big]^2\,dz=5.01\times 10^{-13}$$
</s>