1

Show that $$\int ^{\infty}_{-\infty} \frac{\cos x}{e^x+e^{-x}}dx=\frac{\pi}{e^\frac{\pi}{2}+e^{-\frac{\pi}{2}}}.$$

How do we solve this? Since given function is even, it follows that $$ \int ^{\infty}_{-\infty} \frac{\cos x}{e^x+e^{-x}}dx= 2\int ^{\infty}_{0} \frac{\cos x}{e^x+e^{-x}}dx,$$ but I can't go for further.

  • there are many ways to do this integral, i like residue theorem the most (rectangular contour with width $\pi i$). – tired May 06 '17 at 08:18
  • http://advancedintegrals.com/2017/03/contour-integration-for-a-rational-function-of-cos-and-cosh/ – Zaid Alyafeai May 06 '17 at 09:04
  • 1
    In general, $$\int_0^\infty\frac{\cos(ax)}{\cosh^{2n}x}~dx ~=~ \frac\pi2~\text{csch}\bigg(a~\frac\pi2\bigg)~\frac{a}{\Gamma(2n)} ~\prod_{k=1}^{n-1}\Big(a^2+(2k)^2\Big)$$ and $$\int_0^\infty\frac{\cos(ax)}{\cosh^{2n+1}x}~dx ~=~ \frac\pi2~\text{sech}\bigg(a~\frac\pi2\bigg)~\frac1{(2n)!} ~\prod_{k=0}^{n-1}\Big(a^2+(2k+1)^2\Big).$$ – Lucian Sep 01 '17 at 00:50

2 Answers2

3

Hint. We have that $$\int ^{\infty}_{-\infty} \frac{\cos x}{e^x+e^{-x}} dx=2\int ^{\infty}_{0} \frac{\cos x}{e^x+e^{-x}}dx= 2\mbox{Re}\left(\int ^{\infty}_{0} \frac{e^{(i-1)x}}{1+e^{-2x}}dx\right)\\=2\mbox{Re}\left(\int ^{\infty}_{0} e^{(i-1)x}\sum_{k\geq 0}(-1)^ke^{-2kx}dx\right).$$ P.S. For a Residue Theorem approach, see How to evaluate these integrals by hand

Robert Z
  • 147,345
1

$$ \begin{aligned} \int_{-\infty}^{\infty} \frac{\cos x}{e^x+e^{-x}} d x = & 2 \operatorname{Re} \int_0^{\infty} \frac{e^{-x} \cdot e^{i x}}{1+e^{-2 x}} d x \\ = & 2 \operatorname{Re} \sum_{n=0}^{\infty} \int_0^{\infty} e^{(i-1-2 n) x} d x \\ = & 2 \operatorname{Re} \sum_{n=0}^{\infty} \left(-1\right)^n\left[\frac{e^{(i-1-2 n) x}}{i-1-2 n}\right]_0^{\infty} \\ = & 2 \operatorname{Re} \sum_{n=0}^{\infty} \frac{(-1)^n}{2 n+1-i} \\ = & 2 \operatorname{Re}\sum_{n=0}^{\infty} \frac{(-1)^n(2 n+1+i)}{(2 n+1)^2+1} \\ = & 2 \sum_{n=0}^{\infty} \frac{(-1)^n(2 n+1)}{(2 n+1)^2+1} \\ = & \frac{\pi}{2} \operatorname{sech}\left(\frac{\pi}{2}\right) \end{aligned} $$

Lai
  • 31,615