The problem is : Evaluate the integral $$\int_{0}^{\infty} \frac{1}{(1+x^2)\cosh{(ax)}}dx$$
I have tried expand $\frac{1}{\cosh{ax}}$ and give the result in the following way:
First, note that $$\frac{1}{\cosh{(ax)}}=\frac{2e^{-ax}}{e^{-2ax}+1}=\sum_{n=0}^{\infty}2(-1)^n e^{-(2n+1)ax}$$ Secondly, we consider $f(a)=\int_{0}^{\infty} \frac{e^{ax}}{1+x^2}dx$
Some calculation results in $f''(a)+f(a)=\int_{0}^{\infty}e^{ax}dx=-\frac{1}{a}$
We substitute $f(a)=u(a)e^{ia}$ into former result and thus $ (u'(a) e^{2ia})'=-\frac{e^{ia}}{a}.$
Let $E(a)=\int_{0}^{a} \frac{e^{it}}{t}dt=\mbox{Ei}(ia)$ where $\mbox{Ei}(x)$ is the Exponential integral then $$u'(a)= -e^{-2ia} E(a)+c_1 e^{-2ia}.$$
Hence \begin{align*}u(a) &=\frac{1}{2i} e^{-2ia}E(a) - \frac{1}{2i}\int_{0}^{a} \frac{e^{-it}}{t}dt-\frac{1}{2i}c_1 e^{-2ia} +c_2 \\ &=\frac{1}{2i} e^{-2ia}E(a) -\frac{1}{2i}E(-a)-\frac{1}{2i}c_1 e^{-2ia} +c_2\end{align*} We conclude that $$ f(a)=\frac{e^{-ia} \mbox{Ei}(ia)-e^{ia}\mbox{Ei}(-ia)}{2i}+c_1 e^{-ia}+c_2 e^{ia}$$
But I got stuck here, I cannot figure out $c_1$ as well as $c_2$. Also, even $c_1$ and $c_2$ are known, I cannot use the summation to get result for the original question.
Is there other way to tackle this problem? Or can I modify my method to make it feasible to get the desired result? Thanks for your attention!
This integral may be evaluated using residue theory. Consider the integral
$$\oint_C \frac{dz}{(1+z^2) \cosh{a z}}$$
where $C$ is a semicircle of radius $R$ in the upper half plane. As $R \to \infty$, the integral about the semicircle vanishes, and we are left with the original integral equaling $i 2 \pi$ time the sum of the residues of the poles of the integrand within $C$. In this case, the poles within $C$ lie at $z_n = i (n+1/2) \pi/a$ for all $n \in \mathbb{N} \cup \{0\}$, and at $z_+ = i$. Evaluating the residues at these poles (which may be accomplished when the integrand is of the form $p(z)/q(z)$ using the formula $p(z_0)/q'(z_0)$ for a pole at $z=z_0$), we find that
$$\int_{-\infty}^{\infty} \frac{dx}{(1+x^2) \cosh{a x}} = \frac{\pi}{\cos{a}} - \frac{2 \pi}{a} \sum_{n=0}^{\infty} \frac{(-1)^n}{(n+1/2)^2 \pi^2/a^2 - 1}$$
The sum unfortunately takes the form of a pair of Lerch transcendents
$$\begin{align}\frac{2 \pi}{a} \sum_{n=0}^{\infty} \frac{(-1)^n}{(n+1/2)^2 \pi^2/a^2 - 1} &= \frac{\pi}{a} \sum_{n=0}^{\infty} (-1)^n \left (\frac{1}{(n+1/2)\pi/a-1}-\frac{1}{(n+1/2)\pi/a+1} \right)\\&= \sum_{n=0}^{\infty} (-1)^n \left (\frac{1}{n+\frac12-\frac{a}{\pi}}-\frac{1}{n+\frac12+\frac{a}{\pi}} \right) \\ &= \Phi\left(-1,1,\frac12-\frac{a}{\pi}\right)-\Phi\left(-1,1,\frac12+\frac{a}{\pi}\right)\end{align}$$
Therefore
$$\int_0^{\infty} \frac{dx}{(1+x^2) \cosh{a x}} = \frac{\pi}{2\cos{a}} - \frac12 \left[\Phi\left(-1,1,\frac12-\frac{a}{\pi}\right)-\Phi\left(-1,1,\frac12+\frac{a}{\pi}\right) \right ]$$
It should be noted that $a \ne (k+1/2) \pi$ for some $k \in \mathbb{Z}$.
ADDENDUM
I should note that, in response to @GrahamHesketh's query, the result above may be shown to be equal to a difference between two digamma functions as follows:
$$\int_0^{\infty} \frac{dx}{(1+x^2) \cosh{a x}} = \frac12 \left [ \psi\left(\frac{3}{4}+\frac{a}{2 \pi} \right)-\psi\left(\frac{1}{4}+\frac{a}{2 \pi} \right) \right ]$$
This may be accomplished by noting that
$$\frac{\pi}{\cos{a}} = \sum_{n=-\infty}^{\infty} (-1)^n \frac{1}{n+\frac12-\frac{a}{\pi}} = \sum_{n=0}^{\infty} (-1)^n \left (\frac{1}{n+\frac12-\frac{a}{\pi}}+\frac{1}{n+\frac12+\frac{a}{\pi}} \right) $$
$$\psi\left(\frac{1}{4}+\frac{a}{2 \pi} \right) = \sum_{n=0}^{\infty}\left (\frac{1}{n+1}- \frac{1}{n+\frac12 \left (\frac12+\frac{a}{\pi}\right)}\right )$$
$$\psi\left(\frac{3}{4}+\frac{a}{2 \pi} \right) = \sum_{n=0}^{\infty} \left ( \frac{1}{n+1}-\frac{1}{n+1-\frac12 \left (\frac12-\frac{a}{\pi}\right)}\right )$$
To establish equality, note that the result I posted above boils down to
$$\frac{\pi}{\cos{a}} - \sum_{n=0}^{\infty} (-1)^n \left (\frac{1}{n+\frac12-\frac{a}{\pi}}-\frac{1}{n+\frac12+\frac{a}{\pi}} \right) = 2 \sum_{n=0}^{\infty} \frac{(-1)^n}{n+\frac12+\frac{a}{\pi}}$$
Equality between the above sum and the difference between the two $\psi$ terms is established by comparing the summands term by term.