# Why does the hard-looking integral $\int_{0}^{\infty}\frac{x\sin^2(x)}{\cosh(x)+\cos(x)}dx=1$?

I have to ask this question; most looking complicated definite integral yield not so nice closed form or irrational numbers or mixed of what ever ect.

Why is this particular hard looking integral gives a $1$ as an answer?

$$\int_{0}^{\infty}\frac{x\sin^2(x)}{\cosh(x)+\cos(x)}dx=1$$

• Maybe the following series can be useful: $$-\frac12 \frac{\sin x}{\cosh x+\cos x} = \sum_{n=0}^{\infty} (-1)^n e^{-n x} \sin(n x).$$ – nospoon May 24 '16 at 19:31
• Judicious remark @nospoon! – Olivier Oloa May 24 '16 at 20:03

We have the identity $$\frac{\sin\left(x\right)}{\cosh\left(ax\right)+\cos\left(x\right)}=2\sum_{n\geq1}\left(-1\right)^{n-1}\sin\left(nx\right)e^{-anx},\, a>0,\, x\geq0$$ so $$J=\int_{0}^{\infty}\frac{x\sin^{2}\left(x\right)}{\cosh\left(x\right)+\cos\left(x\right)}dx=2\sum_{n\geq1}\left(-1\right)^{n-1}\int_{0}^{\infty}x\sin\left(nx\right)\sin\left(x\right)e^{-nx}dx.$$ Now let us consider the integral. We note that $$I=\int_{0}^{\infty}x\sin\left(nx\right)\sin\left(x\right)e^{-nx}dx=-\frac{1}{4}\int_{0}^{\infty}xe^{-nx-inx-ix}dx+\frac{1}{4}\int_{0}^{\infty}xe^{-nx-inx+ix}dx$$ $$+\frac{1}{4}\int_{0}^{\infty}xe^{-nx+inx-ix}dx-\frac{1}{4}\int_{0}^{\infty}xe^{-nx+inx+ix}dx$$ and now we observe that $$-\frac{1}{4}\int_{0}^{\infty}xe^{-nx-inx-ix}dx=-\frac{1}{4}\int_{0}^{\infty}xe^{-x\left(n+in+i\right)}dx=-\frac{1}{4\left(n+in+i\right)^{2}}$$ and in a similar way we can compute the other integrals, hence $$I=\frac{1}{4}\left(-\frac{1}{\left(n+in+i\right)^{2}}+\frac{1}{\left(n+in-i\right)^{2}}+\frac{1}{\left(n-in+i\right)^{2}}-\frac{1}{\left(n-in-i\right)^{2}}\right)$$ $$=\frac{2n\left(4n^{4}+4n^{2}-1\right)}{\left(4n^{4}+1\right)^{2}}$$ then $$J=\sum_{n\geq1}\left(-1\right)^{n-1}\frac{4n\left(4n^{4}+4n^{2}-1\right)}{\left(4n^{4}+1\right)^{2}}$$ $$=\sum_{n\geq1}\left(-1\right)^{n-1}\left(\frac{2n-1}{\left(2n^{2}-2n+1\right)^{2}}+\frac{2n+1}{\left(2n^{2}+2n+1\right)^{2}}\right)$$ and note that we have a telescoping series since $$\frac{2n+1}{\left(2n^{2}+2n+1\right)^{2}}-\frac{2\left(n+1\right)-1}{\left(2\left(n+1\right)^{2}-2\left(n+1\right)+1\right)^{2}}=0$$ so $$\int_{0}^{\infty}\frac{x\sin^{2}\left(x\right)}{\cosh\left(x\right)+\cos\left(x\right)}dx=1.$$

• I plan to give a bounty to this answer as soon as possible, please send me a reminder if I forget it. – Jack D'Aurizio May 24 '16 at 20:10
• Thank you all for the great contribution. It is amazing combine knowledge can answer anything! – user339807 May 24 '16 at 22:21
• In the first line, $x$ should be positive, right? By the way, how did you derive this identity? – user37238 May 27 '16 at 10:42
• @user37238 It can be derived from the geometric series $$\sum_{k\geq1}(-1)^{k}e^{-axk}e^{ixk}$$ $$=-\frac{e^{-ax}e^{ix}}{1+e^{-ax}e^{ix}}.$$ It think the identity holds for $x \in \mathbb{R}.$ – Marco Cantarini May 27 '16 at 10:56
• @mickep Yes, you're right. Fixed, thank you. – Marco Cantarini May 27 '16 at 18:33

One may employ the generating function $$\frac{\sin x}{\cosh x+\cos x}=2\sum_{k=1}^\infty(-1)^{k-1}e^{-kx}\sin kx$$ and the classic result of $$\int_0^\infty x^{m-1}e^{-ax} \cos bx \ dx = \frac{\Gamma(m)}{(a^{2} + b^{2})^{m/2}}\cos\left(m\tan^{-1}\left(\frac{b}{a}\right)\right)$$ We then have \begin{align} \int_{0}^{\infty}\frac{x\sin^2 x}{\cosh x+\cos x}\ dx&=2\sum_{k=1}^\infty(-1)^{k-1}\int_{0}^{\infty}x\ e^{-kx}\sin x\sin kx\ dx\\[10pt] &=\sum_{k=1}^\infty(-1)^{k-1}\left[\int_{0}^{\infty}x\ e^{-kx}\cos(k-1)x\ dx-\int_{0}^{\infty}x\ e^{-kx}\cos(k+1)x\ dx\right]\\[10pt] &=\sum_{k=1}^\infty(-1)^{k-1}\left[ \frac{\cos\left(2\tan^{-1}\left(\frac{k-1}{k}\right)\right)}{k^{2}+(k-1)^2}-\frac{\cos\left(2\tan^{-1}\left(\frac{k+1}{k}\right)\right)}{k^{2}+(k+1)^2}\right]\\[10pt] &=1 \end{align} and the claim follows.

The latter expression is indeed a telescoping series as one may observe its partial sum equals $$\sum_{k=1}^n(-1)^{k-1}\left[ \frac{\cos\left(2\tan^{-1}\left(\frac{k-1}{k}\right)\right)}{k^{2}+(k-1)^2}-\frac{\cos\left(2\tan^{-1}\left(\frac{k+1}{k}\right)\right)}{k^{2}+(k+1)^2}\right]=1+\frac{\cos\left(2\tan^{-1}\left(\frac{n+1}{n}\right)\right)}{n^{2}+(n+1)^2}$$ Notice that $$\cos2a+\cos2b=2\cos(a-b)\cos(a+b)$$ and $$\tan^{-1}(x)+\tan^{-1}\left(\frac{1}{x}\right)=\frac{\pi}{2}\qquad,\qquad x>0$$

• I love your answers. I always give you a +1 – Von Neumann Oct 21 '16 at 22:43