Calculate $I_m = \int_{-\infty}^\infty \frac{dx}{1+x+x^2+\cdots+x^{2m}}$ using complex variables I have come as far as deducing that the denominator can be written as a geometric series. Hence, for $m=2$,
\begin{align*}
\int_{-\infty}^\infty \frac{1-x}{1-x^5} dx &= 2 \pi i ( B_1 + B_2 ) - \int_{C_R} \frac{1-z}{1-z^5} dz \\
&= 2 \pi i \left( \frac{1 - \exp(i \frac{2 \pi}{5})}{-5 \exp(i\frac{8 \pi}{5})} + \frac{1 - \exp(i \frac{4 \pi}{5})}{-5 \exp(i\frac{16 \pi}{5})} \right) - 0\\
&\overset{*}{=} \frac{\pi}{5} \cot\left( \frac{\pi}{10} \right) \sec \left( \frac{\pi}{5} \right).
\end{align*}
where $B_1$ and $B_2$ denote the residues in the upper-half plane.
However, I can't work out why the equality $\overset{*}{=}$ should hold. I'm sure it's the result of some clever manipulation but I've been staring at it for a while without much progress. Is my solution wrong?

There seems to be a tiny error in the last step, otherwise your solution is perfect.
You have that
\begin{align}
2\pi i \left(\frac{1-e^{i2\pi/5}}{-5e^{i8\pi/5}}+ \frac{1-e^{i4\pi/5}}{-5e^{i16\pi/5}} \right)
& = -\frac{2\pi i}{5}\left(e^{-i8\pi/5} - e^{-i6\pi/5} + e^{-i16\pi/5} - e^{-i12\pi/5}\right)\\
& = -\frac{2\pi i}{5}\left(e^{i2\pi/5} - e^{i4\pi/5} + e^{i4\pi/5} - e^{-i2\pi/5}\right)\\
& = \frac{4\pi}{5}\frac{e^{i2\pi/5} - e^{-i2\pi/5}}{2i}\\
& = \frac{4\pi}{5} \sin\left(\frac{2\pi}5\right).
\end{align}
