Evaluating the integral $\int_{-\infty}^\infty \frac {dx}{\cos x + \cosh x}$ Many recent questions have been asked here similar to this integral  
$$\int_{-\infty}^\infty \frac {dx}{\cos x + \cosh x} = 2.39587\dots$$
whose "closed form" I cannot seem to figure out.  I have tried contour integration, but the sum of the residues got rather nasty.
Can someone perhaps evaluate this integral?
 A: We have
\begin{align}
I & = \int_0^{\infty} \dfrac{dx}{\cos(x) + \cosh(x)}\\
& = \int_0^{\infty} \dfrac{\text{sech}(x)dx}{1 + \text{sech}(x)\cos(x)}\\
& = \sum_{k=0}^{\infty} (-1)^k\int_0^{\infty} \text{sech}^{k+1}(x) \cos^k(x) dx
\end{align}
where
\begin{align}
\int_0^{\infty} \text{sech}^{k+1}(x) \cos^k(x) dx & = 2^{k+1}\int_0^{\infty} \dfrac{\cos^k(x)}{\left(e^x + e^{-x}\right)^{k+1}} dx
\end{align}
Now we have
$$\int_0^{\infty} \dfrac{\cos^k(x)}{\left(e^x + e^{-x}\right)^{k+1}} dx = \int_0^{\infty} \dfrac{e^{-(k+1)x} \cos^k(x)}{(1+e^{-2x})^{k+1}} dx$$
Further,
$$\dfrac1{(1+e^{-2x})^{k+1}} = \sum_{l=0}^{\infty} \dbinom{k+l}{l}(-1)^l e^{-2lx}$$
Hence,
$$\int_0^{\infty} \dfrac{e^{-(k+1)x} \cos^k(x)}{(1+e^{-2x})^{k+1}} dx = \sum_{l=0}^{\infty} \dbinom{k+l}{l}(-1)^l \int_0^{\infty} e^{-(2l+k+1)x} \cos^k(x) dx$$
Hence,
\begin{align}
\int_0^{\infty} e^{-(2l+k+1)x} \cos^k(x) dx & = \int_0^{\infty} e^{-(2l+k+1)x}\left(\dfrac{e^{ix}+e^{-ix}}2 \right)^k dx\\
& = \dfrac1{2^k} \int_0^{\infty} \sum_{m=0}^k \dbinom{k}m e^{-(2l+k+1)x}e^{imx}e^{-i(k-m)x}dx\\
& = \dfrac1{2^k} \int_0^{\infty} \sum_{m=0}^k \dbinom{k}m e^{-(2l+k+1)x}e^{2imx-ikx}dx\\
& = \dfrac1{2^k} \sum_{m=0}^k \dfrac{\dbinom{k}m}{k+2l-2im+ik+1}
\end{align}
Hence,
$$I = 2 \sum_{k=0}^{\infty}(-1)^k \sum_{l=0}^{\infty}(-1)^l \dbinom{k+l}l \left(\sum_{m=0}^k \dfrac{\dbinom{k}m}{k+2l-2im+ik+1} \right)$$
The integral you are after is twice $I$ and hence
$$\color{blue}{4 \sum_{k=0}^{\infty}(-1)^k \sum_{l=0}^{\infty}(-1)^l \dbinom{k+l}l \left(\sum_{m=0}^k \dfrac{\dbinom{k}m}{k+2l-2im+ik+1} \right)}$$ You can truncate the two infinite sums (since both are alternating sums) to get arbitrary accuracy.
A: Simple computation yields
$$
\cos(z)+\cosh(z)=2\cos(\alpha z)\cosh(\alpha z)\tag{1}
$$
where $\alpha=\frac{1+i}{2}$. The zeros of $\cos(z)+\cosh(z)$ are at
$$
z_k^\pm=\left(k\pi+\frac\pi2\right)(1\pm i)\tag{2}
$$
and
$$
\operatorname*{Res}_{\ \ z=z_k^\pm}\frac1{\cos(z)+\cosh(z)}
=\frac{1\pm i}{2}(-1)^{k+1}\mathrm{sech}\left(k\pi+\frac\pi2\right)\tag{3}
$$
The residues in the upper half-plane are $z_k^+$ where $k\ge0$ and $z_k^-$ where $k\lt0$. Pairing the residues at $z_k^+$ and $z_{-k-1}^-$ yields the sum of the residues in the upper half-plane to be
$$
-i\sum_{k=0}^\infty(-1)^k\mathrm{sech}\left(k\pi+\frac\pi2\right)\tag{4}
$$
Therefore, we can use contour integration to get
$$
\begin{align}
\int_{-\infty}^\infty\frac{\mathrm{d}x}{\cos(x)+\cosh(x)}
&=2\pi\sum_{k=0}^\infty(-1)^k\mathrm{sech}\left(k\pi+\frac\pi2\right)\\[6pt]
&\doteq2.3958786339145620925\tag{5}
\end{align}
$$
A: OK, this is an especially tough integral.  Mathematica gives nothing analytical, nor could I find a form in Gradshteyn & Rhyzik that covered this integral.  That said, it is still worth looking into what can be done, and I think I have some sort of an advance over what I've seen so far.
Write the integral as
$$I = 4 \int_0^{\infty} dx \: \frac{e^{-x}}{1+2 e^{-x} \cos{x} + e^{-2 x}} $$
Substitute $y=e^{-x}$, $dy=-y dx$, $x=-\log{y}$ and get
$$I = 4 \int_0^1 \frac{dy}{1+2 y \cos{(\log{y})} + y^2}$$
This is still a tough integral, but maybe some of you recognize that the integrand is a generating function for the Chebyshev polynomial of the second kind $U_n(x)$.  That is, we may write
$$\frac{1}{1+2 y \cos{(\log{y})} + y^2} = \sum_{n=0}^{\infty} U_n(\cos{(\log{y})}) y^n$$
Now we have
$$I = 4 \int_0^1 dy \: \sum_{n=0}^{\infty}  y^n U_n(\cos{(\log{y})}) $$
I am not yet convinced that the order of summation and integration may be reversed.  (Upon doing so, the resulting series diverges as far as I can see, which is too bad because the results were coming out nice.)
