# 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 ?
• Nice integral by the way! – Yuriy S Feb 18 '17 at 15:28
• @YuriyS, that closed form caught my eye. – Zaid Alyafeai Feb 18 '17 at 15:30
• The polynomial has roots $$x=-\frac{\pi}{4} \pm \frac{i \pi}{2}$$ Not sure if it helps, but they seem to be pretty enough – Yuriy S Feb 18 '17 at 15:40
• Also, you could probably just use partial fraction at the end since the roots are so nice (see Yuriy's comment). This would avoid contour integration entirely (though you would be factoring over the complex numbers). – Brevan Ellefsen Feb 18 '17 at 16:03
• Perhaps also worth noting that your answer is equivalent to $$\frac{2}{\pi^3}\bigg((\pi/2 - 4) e^x + (\pi/2+4) e^{-x}\bigg)$$ – Brevan Ellefsen Feb 18 '17 at 16:07

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

• Beautiful proof, +1 from me for sure!! Glad I could serve as some form of inspiration :) – Brevan Ellefsen Feb 19 '17 at 2:47
• Is a generalization possible? – MathGod Mar 11 '17 at 20:25
• @IshanSingh, what kind of generalization. – Zaid Alyafeai Mar 11 '17 at 21:12
• @ZaidAlyafeai Replacing the $\pi$ with a constant $a$? – MathGod Mar 12 '17 at 10:04
• @IshanSingh, maybe to some extent we can. – Zaid Alyafeai Mar 13 '17 at 3:10

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

• That's very promising, if we integrate the proper function around a rectangle of height $\pi$ and stretch it to infinity we might get the result. – Zaid Alyafeai Feb 19 '17 at 1:08
• @ZaidAlyafeai I must admit that I am still in High School and I haven't read enough about contour integration to go further. Your idea sounds interesting, though I'm afraid you would probably do better with the idea than I would. On the other hand, I may have come up with a method to do this with real analysis, which I am decent with. I likely have time to come back to this today, but perhaps tomorrow or the next day. – Brevan Ellefsen Feb 19 '17 at 1:20
• I've one question though! how come the cosh^3 term didn't change when you made the substitution at the end ? – Zaid Alyafeai Feb 19 '17 at 1:28
• @ZaidAlyafeai good question! I'll explain that step a little better in a few hours when I get a computer. Stuck on mobile at the moment, so MathJax is difficult. – Brevan Ellefsen Feb 19 '17 at 1:45
• Thanks, I was able to solve it using contour integration. – Zaid Alyafeai Feb 19 '17 at 2:33