TITLE: Evaluate $\int_{0}^{\infty}\dfrac{\mathrm dx}{(e^{\pi x}+e^{-\pi x})(16+x^2)}$
QUESTION [10 upvotes]: Find the integral

$$I=\int_{0}^{\infty}\dfrac{1}{(e^{\pi x}+e^{-\pi x})(16+x^2)}dx$$

My try:let $x=-t$

$$I=\int_{-\infty}^{0}\dfrac{1}{(e^{\pi x}+e^{-\pi x})(16+x^2)}dx$$
  so
  $$2I=\int_{-\infty}^{\infty}\dfrac{1}{(e^{\pi x}+e^{-\pi x})(16+x^2)}dx$$

Then I can't,Thank you

REPLY [11 votes]: Let's compute $\newcommand{\sech}{\mathrm{sech}}(-1)^n\int_{-\infty}^\infty\frac{\sech(n\pi x)}{x^2+1}\mathrm{d}x$ .
$\sech(n\pi x)$ has simple poles at $x=\frac{2k+1}{2n}i$, with residue $\frac{(-1)^k}{n\pi i}$ .

$\frac1{x^2+1}$ has simple poles at $x=\pm i$, with residue $\frac1{\pm2i}$ .

$\hspace{8mm}$

Note that the integrals along the vertical segments vanish at $\infty$. 

The integral along the upper rectangular contour is  the integral in question: $\int_{-\infty}^\infty\frac{\sech(n\pi x)}{x^2+1}\mathrm{d}x$, minus the Principal Value integral along the red path: $\color{#C00000}{\int_{-\infty+i}^{\infty+i}\frac{\sech(n\pi x)}{x^2+1}\mathrm{d}x}$, minus $\pi i$ times the residue at $x=i$: $\color{#00A000}{\pi i\times(-1)^{n}\frac1{2i}=(-1)^{n}\frac\pi2}$. This is also $2\pi i$ times the sum of the residues inside the contour: $\color{#0000FF}{\sum\limits_{k=0}^{n-1}\frac{(-1)^k}{n}\raise{6pt}{\frac2{1-\left(\frac{2k+1}{2n}\right)^2}}}$ .

The integral along the upper rectangular contour is  the integral in question: $\int_{-\infty}^\infty\frac{\sech(n\pi x)}{x^2+1}\mathrm{d}x$, minus the Principal Value integral along the red path: $\color{#C00000}{\int_{-\infty-i}^{\infty-i}\frac{\sech(n\pi x)}{1+x^2}\mathrm{d}x}$, plus $\pi i$ times the residue at $x=-i$: $\color{#00A000}{\pi i\times-(-1)^{n}\frac1{2i}=-(-1)^{n}\frac\pi2}$. This is also $-2\pi i$ times the sum of the residues inside the contour: $\color{#0000FF}{\sum\limits_{k=0}^{n-1}\frac{(-1)^k}{n}\raise{6pt}{\frac2{1-\left(\frac{2k+1}{2n}\right)^2}}}$ .

Putting these together gives
$$
\begin{align}
&\int_{-\infty}^\infty\frac{\sech(n\pi x)}{x^2+1}\mathrm{d}x\\
&=\frac12\left(
\color{#C00000}{(-1)^n\int_{-\infty}^\infty\frac{\sech(n\pi x)}{x^2+2ix}\mathrm{d}x}
+\color{#00A000}{(-1)^n\frac\pi2}
+\color{#0000FF}{\sum_{k=0}^{n-1}\frac{(-1)^k}{n}\frac2{1-\left(\frac{2k+1}{2n}\right)^2}}
\right)\\
&+\frac12\left(
\color{#C00000}{(-1)^n\int_{-\infty}^\infty\frac{\sech(n\pi x)}{x^2-2ix}\mathrm{d}x}
+\color{#00A000}{(-1)^n\frac\pi2}
+\color{#0000FF}{\sum_{k=0}^{n-1}\frac{(-1)^k}{n}\frac2{1-\left(\frac{2k+1}{2n}\right)^2}}
\right)\\
&=(-1)^n\int_{-\infty}^\infty\frac{\sech(n\pi x)}{x^2+4}\mathrm{d}x
+(-1)^n\frac\pi2
+8n\sum_{k=0}^{n-1}\frac{(-1)^k}{(2n)^2-(2k+1)^2}\\
&=\small(-1)^n\left(\frac12\int_{-\infty}^\infty\frac{\sech(2n\pi x)}{x^2+1}\mathrm{d}x
+\frac\pi2\right)
+2\sum_{k=0}^{n-1}(-1)^k\left(\frac1{2n+2k+1}+\frac1{2n-2k-1}\right)\\
&=\small(-1)^n\left(\frac12\int_{-\infty}^\infty\frac{\sech(2n\pi x)}{x^2+1}\mathrm{d}x
+\frac\pi2
-4\sum_{k=0}^{n-1}(-1)^k\frac1{2k+1}+2\sum_{k=0}^{2n-1}(-1)^k\frac1{2k+1}\right)\tag{1}
\end{align}
$$
Rearranging $(1)$ yields
$$
\begin{align}
&(-1)^n\int_{-\infty}^\infty\frac{\sech(n\pi x)}{x^2+1}\mathrm{d}x
+4\sum_{k=0}^{n-1}(-1)^k\frac1{2k+1}
-\pi\\
&=\frac12\left(
\int_{-\infty}^\infty\frac{\sech(2n\pi x)}{x^2+1}\mathrm{d}x
+4\sum_{k=0}^{2n-1}(-1)^k\frac1{2k+1}
-\pi
\right)\\[6pt]
&\to0\tag{2}
\end{align}
$$
Therefore,
$$
(-1)^n\int_{-\infty}^\infty\frac{\sech(n\pi x)}{x^2+1}\mathrm{d}x
=\pi-4\sum_{k=0}^{n-1}(-1)^k\frac1{2k+1}\tag{3}
$$
Now, applying $(3)$, with $n=4$, to the question:
$$
\begin{align}
\int_0^\infty\frac{\mathrm{d}x}{\left(e^{\pi x}+e^{-\pi x}\right)\left(16+x^2\right)}
&=\frac14\int_{-\infty}^\infty\frac{\mathrm{sech}(\pi x)\,\mathrm{d}x}{16+x^2}\\
&=\frac1{16}\int_{-\infty}^\infty\frac{\mathrm{sech}(4\pi x)\,\mathrm{d}x}{1+x^2}\\
&=\frac\pi{16}-\frac14\left(1-\frac13+\frac15-\frac17\right)\\
&=\frac\pi{16}-\frac{19}{105}\tag{4}
\end{align}
$$