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

  1. Although I think this approach will result in the correct answer I feel that a contour method will be so much easier, any idea ?
  2. Maybe there is an easier method considering the nice closed form ?

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

enter image description here

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)$$


$$I=\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$$

$$I=\int_{-\infty}^{\infty}\frac{1}{(4x+\pi+2i\pi)(4x+\pi-2i\pi) }\frac{\cosh\left(x+\frac{\pi}{4} \right)}{\cosh^3(x)}dx$$

$$I=\frac{-i}{16\pi}\int_{-\infty}^{\infty}\left(\frac{1}{x+\frac{\pi}{4}-\frac{i\pi}{2} }-\frac{1}{x+\frac{\pi}{4}+\frac{i\pi}{2}}\right)\frac{\cosh\left(x+\frac{\pi}{4} \right)}{\cosh^3(x)}dx$$ Make the substitution $x+\pi/4 \to x$ $$I=\frac{-i}{16\pi}\int_{-\infty}^{\infty}\left(\frac{1}{x-\frac{i\pi}{2} }-\frac{1}{x+\frac{i\pi}{2}}\right)\frac{\cosh\left(x \right)}{\cosh^3(x-\pi/4)}dx$$
We now split into two integrals and investigate each $$I_1=\int_{-\infty}^{\infty}\frac{1}{x+\frac{i\pi}{2}}\frac{\cosh\left(x \right)}{\cosh^3(x-\pi/4)}dx$$ Let $x+\frac{i\pi}{2} \to x$

$$\color{red}{I_1=\int_{\frac{i\pi}{2}-\infty}^{\frac{i\pi}{2}+\infty}\frac{\sinh(x)}{x\cosh^3(π/4 - x)} dx}$$


$$I_2=\int_{-\infty}^{\infty}\frac{1}{x-\frac{i\pi}{2}}\frac{\cosh\left(x \right)}{\cosh^3(x-\pi/4)}dx$$

Let $x-\frac{i\pi}{2} \to x$

$$\color{red}{I_2=\int_{-\frac{i\pi}{2}-\infty}^{-\frac{i\pi}{2}+\infty}\frac{\sinh(x)}{x\cosh^3(π/4 - x)} dx}$$


We now need to calculate $I_2 - I_1$ and multiply the result by $\frac{-i}{16}$, but I am stumped. There are clear symmetries in $I_1$ and $I_2$, as only the domain of integration changes; the function inside the integral stays the same. If anyone has any suggestions, I will gladly take them.