Evaluate the integral $$ \int_0^{\infty} \frac{\cosh(ax)}{\cosh(x)}\,dx, $$ where $|a|<1$.
Consider the closed loop integral of $\displaystyle\frac{e^{az}}{\cosh(z)}$ where the contour $C$ is $y=0, y=\pi, x=-R$, and $x=R$.
So far I have found that $$\displaystyle\int_C \frac{e^{az}}{\cosh(z)}\,dz=2\pi e^{\frac{\pi i a}{2}}$$ by the residue theorem. Not sure how to compare this to the first part where we are integrating from $0$ to infinity.
I give to you a different approach, not using residue calculus. In case you only wanted a solution using complex analysis, tell me and I will delete my answer.
We write $$ \begin{aligned} \frac{\cosh ax}{\cosh x}&=\frac{e^{(a-1)x}+e^{(-(a+1)x}}{1+e^{-2x}}\\ &=\sum_{k=0}^{+\infty}(-1)^k\bigl(e^{(a-1-2k)x}+e^{-(a+1+2k)x}\bigr) \end{aligned} $$ and then integrate term-wise, to find that $$ \int_0^{+\infty}\frac{\cosh ax}{\cosh x}\,dx=\sum_{k=0}^{+\infty}(-1)^k\Bigl(\frac{1}{1-a+2k}+\frac{1}{1+a+2k}\Bigr). $$ Now, as it happens there is a nice series expansion of the secant function looking very much like this (see for example the series expansion here), $$ \sec z=2\sum_{k=0}^{+\infty}(-1)^k\Bigl(\frac{1}{\pi-2z+2k\pi}+\frac{1}{\pi+2z+2k\pi}\Bigr). $$ In particular, with $z=a\pi/2$, $$ \sec\Bigl(\frac{a\pi}{2}\Bigr)=\frac{2}{\pi}\sum_{k=0}^{+\infty}(-1)^k\Bigl(\frac{1}{1+-a+2k}+\frac{1}{1+a+2k}\Bigr). $$
Hence $$ \int_0^{+\infty}\frac{\cosh ax}{\cosh x}\,dx=\frac{\pi}{2}\sec\Bigl(\frac{a\pi}{2}\Bigr). $$