# Evaluate $\int _0 ^{\infty} \frac {\cos x}{1+x^n}dx$

To evaluate$\int _0 ^{\infty} \frac {\cos x}{1+x^n}dx$, take $f(z)=\frac{e^{iz}}{1+z^n}$ and choose cantour $\gamma=\gamma_1+\gamma_2-\gamma_3$ while
$\gamma_1(t)=t\quad(0\leq t \leq R)$
$\gamma_2(t)= Re^{i\theta}\quad(0\leq \theta \leq \frac {2\pi} n)$
$\gamma_3(t) = te^{2\pi i/n}\quad(0\leq t\leq R)$
so that there is only one simple pole $w=e^{\pi i/n}$ inside the $\gamma$.

by residue theorem, $$\int_\gamma f(z)dz = 2\pi i \frac {e^{ie^{w}}} {nw^{n-1}}$$ On the other hand, $\gamma_2$ part tends to zero. $$\left|\int_{\gamma_2} f(z)dz\right| \leq \frac{2\pi}n \frac {e^{-R\sin \theta}}{R^n-1}\to0\quad\text{as}\quad R\to\infty$$
therefore, we have $$(1-e^{\frac {2\pi i}n}) \int _0 ^\infty \frac {e^{ix}}{1+x^n} dx=2\pi i \frac {e^{ie^{w}}} {nw^{n-1}}$$
simplifying the relation, $$\int _0 ^\infty \frac {e^{ix}}{1+x^n} dx=\frac{e^{i\cos\frac \pi n}}{n(\sin\frac\pi n) e^{sin\frac\pi n}}$$
I finally got the relation $$\int _0 ^{\infty} \frac {\cos x}{1+x^n}dx=\frac{\pi\cos(\cos\frac\pi n)}{n(\sin\frac\pi n)e^{sin\frac\pi n}}$$ However, this doesn't work. I've checked every calculation several times. but I can't find which part is wrong.

• There is not one simple pole. – Von Neumann Jan 6 '18 at 20:09
• The residue at $w$ is $$\frac{e^{iw}}{nw^{n-1}} = -\frac{w}{n}e^{iw}\,.$$ You applied one exponential too many. – Daniel Fischer Jan 6 '18 at 20:20
• Also, the relation between $f(z)$ on $\gamma_1$ and on $\gamma_3$ is more complicated. – Daniel Fischer Jan 6 '18 at 20:25
• Indeed, as @DanielFischer notes, you can't extract the integral you're looking for with this unless you can turn the integral along $\gamma_3$ in terms of the original. I decided to deal it out and you can't quite get what you want, but it's close(ish). – DaveNine Jan 13 '18 at 3:08