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)}$$

Recall the following two results:
$$\int_0^\infty  e^{-bt}\cos\left(xt \right)\,dt=\frac{b}{b^2+x^2}\tag{1}$$
$$\int_0^\infty  \frac{\cos\left(xt \right)}{\cosh\left(ax \right)}\,dx=\frac{\pi} {2a \cosh\left(\frac{\pi t}{2a} \right)} \tag{2}$$

$$
\begin{aligned}
\int_0^\infty \frac{1}{(b^2+x^2)\cosh\left(ax \right)}\,dx&= \frac 1b\int_0^\infty \frac{1}{\cosh\left(ax \right)}\,\int_0^\infty  e^{-bt}\cos\left(xt \right)\,dt\,dx\\
&= \frac 1b\int_0^\infty  e^{-bt}\int_0^\infty  \frac{\cos\left(xt \right)}{\cosh\left(ax \right)}\,dx\,dt\\
&= \frac 1b\int_0^\infty  e^{-bt}\left(\frac{\pi} {2a \cosh\left(\frac{\pi t}{2a} \right)} \right)\,dt\\
&= \frac{\pi}{2 a b}\int_0^\infty  \frac{ e^{-bt}} {\cosh\left(\frac{\pi t}{2a} \right)} \,dt\\
&= \frac{1}{b}\int_0^\infty  \frac{ e^{-\frac{2ab}{\pi}t}} {\cosh\left(t \right)} \,dt \qquad \left(\frac{2ab}{\pi}w=t\right)\\
&= \frac{2}{b}\int_0^\infty  \frac{ e^{-ct}} {e^{t}+e^{-t}} \,dt \qquad \left(c=\frac{2ab}{\pi}\right)\\
&= \frac{2}{b}\int_0^\infty  \frac{ e^{-ct}e^{-t}} {1+e^{-2t}} \,dt\\
&= \frac{2}{b}\int_0^\infty   e^{-ct}e^{-t}\left(\sum_{k=0}^\infty (-1)^{k}e^{-2kt} \right) \,dt\\
&= \frac{2}{b}\int_0^\infty   e^{-ct}\left(\sum_{k=0}^\infty (-1)^{k}e^{-(2k+1)t} \right) \,dt\\
&= \frac{2}{b}\int_0^\infty   e^{-ct}\left(\sum_{k=1}^\infty (-1)^{k-1}e^{-(2k-1)t} \right) \,dt\\
&= \frac{2}{b}\sum_{k=1}^\infty (-1)^{k-1}\,\int_0^\infty  e^{-\left(c+(2k-1)\right)t}  \,dt\\
&= \frac{2}{b}\sum_{k=1}^\infty \frac{(-1)^{k-1}}{\frac{2ab}{\pi}+(2k-1)}\\
&=\frac{2 \pi}{b}\sum_{k=1}^\infty \frac{(-1)^{k-1}}{2ab+(2k-1)\pi} \qquad \blacksquare
\end{aligned}
$$

$$
\begin{aligned}
\int_0^\infty \frac{1}{(1+x^2)\cosh\left( \pi x \right)}\,dx&=2 \pi\sum_{k=1}^\infty \frac{(-1)^{k-1}}{2 \pi+(2k-1)\pi}\\
&=2 \sum_{k=1}^\infty \frac{(-1)^{k-1}}{2k+1}\\
&=-2 \sum_{k=1}^\infty \frac{(-1)^{k}}{2k+1}\\
&=2-2 \sum_{k=0}^\infty \frac{(-1)^{k}}{2k+1}\\
&=2-2 \frac \pi 4 \\
&=2-\frac \pi 2 \qquad \blacksquare
\end{aligned}
$$

$$
\begin{aligned}
\int_0^\infty \frac{1}{(\pi^2+x^2)\cosh\left(  x \right)}\,dx&=\frac{2 \pi}{\pi}\sum_{k=1}^\infty \frac{(-1)^{k-1}}{2 \pi+(2k-1)\pi}\\
&=\frac 2 \pi \sum_{k=1}^\infty \frac{(-1)^{k-1}}{2k+1}\\
&=-\frac 2 \pi \sum_{k=1}^\infty \frac{(-1)^{k}}{2k+1}\\
&=\frac 2 \pi-\frac 2 \pi \sum_{k=0}^\infty \frac{(-1)^{k}}{2k+1}\\
&=\frac 2 \pi-\frac 2 \pi \cdot \frac \pi 4 \\
&=\frac 2 \pi-\frac 1 2 \qquad \blacksquare
\end{aligned}
$$

$$
\begin{aligned}
&\sum_{k=0}^{\infty}\frac{(-1)^k}{2k+1}\\
&=\frac{1}{2}\sum_{k=0}^{\infty}\frac{(-1)^k}{k+\frac{1}{2}}\\
&=\frac{1}{2}\sum_{k=0}^{\infty}(-1)^k\int_0^1t^{k+1/2-1}dt\\
&=\frac{1}{2}\int_0^1t^{-1/2}\left(\sum_{k=0}^{\infty}(-1)^kt^k\right)dt\\
&=\frac{1}{2}\int_0^1\frac{t^{-1/2}}{1+t}dt\\
&=\frac{1}{4}\left(\psi\left( \frac{3}{4}\right)-\psi\left( \frac{1}{4}\right) \right)\\
&=\frac{1}{4}\left(\pi \cot\left( \frac{\pi}{4}\right) \right)\\
&=\frac{\pi}{4}\\
\end{aligned}
$$
Where We used the results
$$\int_0^1\frac{t^{x-1}}{1+t}dt=\frac{1}{2}\left(\psi\left( \frac{x+1}{2}\right)-\psi\left( \frac{x}{2}\right) \right)$$
and
$$\psi(1-x)-\psi(x)=\pi \cot(\pi x)$$
