<s>[INST] An integral of rational function with third power of cosine hyperbolic function Prove

$$\int_{-\infty}^{\infty}\frac{1}{(5 \pi^2 + 8 \pi x + 16x^2)
 }\frac{\cosh\left(x+\frac{\pi}{4} \right)}{\cosh^3(x)}dx =
 \frac{2}{\pi^3}\left(\pi \cosh\left(\frac{\pi}{4} \right)-4\sinh\left(
 \frac{\pi}{4}\right) \right)$$


Attempt
Note that 
$$\cosh\left( x+\frac{\pi}{4}\right) = \cosh(x)\cosh\left(\frac{\pi}{4} \right)+\sinh(x)\sinh\left( \frac{\pi}{4}\right)$$
Then the integral could be rewritten as 
$$I = \cosh\left(\frac{\pi}{4} \right)\int_{-\infty}^{\infty}\frac{\mathrm{sech} ^2(x)}{(5 \pi^2 + 8 \pi x + 16x^2) }dx\\+\sinh\left(\frac{\pi}{4} \right)\int_{-\infty}^{\infty}\frac{\sinh(x)}{(5 \pi^2 + 8 \pi x + 16x^2) \cosh(x)^3}dx$$
You can then integrate by part the second integral 
$$\int^{\infty}_{-\infty}\left[\frac{\cosh\left(\frac{\pi}{4} \right)}{(5 \pi^2 + 8 \pi x + 16x^2)}-\frac{ 4\sinh\left( \frac{\pi}{4}\right)(\pi+ 4 x)}{(5 \pi^2 + 8 \pi x + 16 x^2)^2}\right]\mathrm{sech}^2(x)\,dx $$
Integrating again 
$$I=-\int^{\infty}_{-\infty}\left[\frac{(8 (4 x + \pi) (32 x + 8 \pi) \sinh(\pi/4))}{(16 x^2 + 8 \pi x + 5 \pi^2)^3} - \frac{(16 \sinh(\pi/4)}{(16 x^2 + 8 \pi x + 5 \pi^2)^2}\\ - \frac{((32 x + 8 \pi) \cosh(\pi/4)}{(16 x^2 + 8 \pi x + 5 \pi^2)^2} \right]\tanh(x)\,dx$$
Note that 
$$\tanh(x) = 8  \sum_{k=1}^\infty \frac{x}{(1 - 2 k)^2 \pi^2 + 4 x^2}$$
Consider $R(x)$ a rational function then 
$$\int^{\infty}_{-\infty}R(x) \tanh(x) = 8  \sum_{k=1}^\infty \int^{\infty}_{-\infty}R(x)\frac{x}{(1 - 2 k)^2 \pi^2 + 4 x^2} \,dx$$
Any integral of that form could be found (I think) using the residue theorem then the resulting sum can be evaluated using the Digamma function. 

Question


*

*Although I think this approach will result in the correct answer I feel that a contour method will be so much easier, any idea ? 

*Maybe there is an easier method considering the nice closed form ? 

 [/INST] Brevan Ellefsen answer was an inspiration for me to solve it using Contour integration,
Consider 
$$f(z) = \frac{\sinh(z)}{z \sinh^3(z-\pi/4)}$$
If we integrate around a contour of height $\pi$ and strech it to infinity we get 

By taking $T \to \infty $
$$\color{red}{\int^{i\pi/2+\infty}_{-i\pi/2+\infty}f(x)\,dx}+\color{blue}{\int^{i\pi/2-\infty}_{i\pi/2+\infty}f(x)\,dx}+\color{red}{\int^{-i\pi/2-\infty}_{i\pi/2-\infty}f(x)\,dx}+ \color{blue}{\int^{-i\pi/2+\infty}_{-i\pi/2-\infty}f(x)\,dx} = 2\pi i \mathrm{Res}(f,\frac{\pi}{4})$$
Consider 
$$\color{blue}{\int^{-i\pi/2+\infty}_{-i\pi/2-\infty}\frac{\sinh(x)}{x \sinh^3(x-\pi/4)}\,dx}$$
Let $x = -\pi/2i+\pi/4+y$ 
$$-\int^{\infty}_{-\infty}\frac{1}{-i\pi/2+\pi/4+y}\frac{\cosh(\pi/4+y)}{ \cosh^3(y)}\,dy$$

Similarly we have for 
$$\color{blue}{\int^{i\pi/2-\infty}_{i\pi/2+\infty}\frac{\sinh(x)}{x \sinh^3(x-\pi/4)}\,dx}$$
By letting $x =i\pi/2+\pi/4+ y$
$$\int^{\infty}_{-\infty}\frac{1}{i\pi/2+\pi/4+y}\frac{\cosh(\pi/4+y)}{ \cosh^3(y)}\,dy$$

The other integrals go to 0 hence 
$$-16 \pi i\int^{\infty}_{-\infty} \frac{1}{(5 \pi^2 + 8 \pi y + 16y^2)
 }\frac{\cosh\left(y+\frac{\pi}{4} \right)}{\cosh^3(y)}dy =2\pi i \mathrm{Res}(f,\frac{\pi}{4})$$
Calculating the residue we have 
$$-16 \pi i\int^{\infty}_{-\infty} \frac{1}{(5 \pi^2 + 8 \pi y + 16y^2)
 }\frac{\cosh\left(y+\frac{\pi}{4} \right)}{\cosh^3(y)}dy = 2\pi i\frac{-(16 (π \cosh(π/4) - 4 \sinh(π/4))}{π^3}$$
Which reduces to our result

$$ \int^{\infty}_{-\infty} \frac{1}{(5 \pi^2 + 8 \pi y + 16y^2) 
 }\frac{\cosh\left(y+\frac{\pi}{4}
 \right)}{\cosh^3(y)}dy=\frac{2}{\pi^3}\left(\pi
 \cosh\left(\frac{\pi}{4} \right)-4\sinh\left(  \frac{\pi}{4}\right)
 \right)$$

</s>