<s>[INST] Integration of $\frac{1}{1+x^2+x^4+\cdots +x^{2m}}$ Please calculate $$A_m=\int _{-\infty}^{\infty}\frac{dx}{1+x^2+x^4+\cdots +x^{2m}}$$
My idea is $$A_m=\int \frac{1-x^2}{1-x^{2m+2}}\: dx$$ so I tried to use residue theorem to upper half circle with radius $R$.
But, I cannot calculate it.
 [/INST] Let $\gamma$ be the upper half circle $C$ with radius $R$ centered at $0$ and the segment from $A=(-R,0)$ to $B=(R,0)$. Clearly, inside $\gamma$, the function $f(z)=\frac{z^2-1}{z^{2m+2}-1}$ has $m$ poles $z=\omega_k\equiv=e^{\frac{\pi i k}{m+1}}=\omega_1^k$, $k=1,2,\cdots,m$ and on $AB$, $f(x)$ has two removable singular points $-1$ and $1$. For large $R$, using $\omega_k^{2m+2}=1$ and
$$ \frac{1+e^{ix}}{1-e^{ix}}=i\cot(\frac x2),$$
one has
\begin{eqnarray}
\int_\gamma f(z)\: dz&=&2\pi i\sum_{k=1}^m\text{Res}(f(z),z=\omega_k)\\
&=&2\pi i\sum_{k=1}^m\frac{\omega_k^2-1}{(2m+2)\omega_k^{2m+1}}\\
&=&\frac{\pi i}{m+1}\sum_{k=1}^m\bigg[\omega_k^{-2m+1}-\omega_k^{-2m-1}\bigg]\\
&=&\frac{\pi i}{m+1}\sum_{k=1}^m\bigg[\omega_k^{3}-\omega_k\bigg]\\
&=&\frac{\pi i}{m+1}\sum_{k=1}^m\bigg[\omega_1^{3k}-\omega_1^k\bigg]\\
&=&\frac{\pi i}{m+1}\bigg[\omega_1^3\frac{1-\omega_1^{3m}}{1-\omega_1^3}-\omega_1\frac{1-\omega_1^{m}}{1-\omega_1}\bigg]\\
&=&\frac{\pi i}{m+1}\bigg[\frac{1+\omega_1^{3}}{1-\omega_1^3}-\frac{1+\omega_1}{1-\omega_1}\bigg]\\
&=&-\frac{\pi i}{m+1}\bigg[\cot(\frac{3\pi}{2(m+1)})-\cot(\frac{\pi}{2(m+1)})\bigg].
\end{eqnarray}
On $C$,
$$\bigg|\int_C \frac{z^2-1}{z^{2m+2}-1}\: dz\bigg|\le\int_C \bigg|\frac{z^2-1}{z^{2m+2}-1}\bigg|\: |dz|\le \int_C\frac{|z|^2+1}{|z|^{2m+2}-1}\: |dz|=\frac{R^2+1}{R^{2m+2}-1}2\pi R\to 0$$
as $R\to\infty$. On $AB$
$$ \int_{-R}^Rf(z)dz=\int_{-R}^Rf(x)dx\to\int_{-\infty}^\infty f(\infty)dx $$
as $R\to\infty$.
Thus
$$\int _{-\infty}^{\infty}f(x)dx=-\frac{\pi}{m+1}\bigg[\cot(\frac{3\pi}{2(m+1)})-\cot(\frac{\pi}{2(m+1)})\bigg].$$
</s>