I wanted to practice using the Residue theorem to calculate integrals. I chose an integral of the form $$\int_{-\infty}^\infty\frac{x^n}{1+x^m}dx$$and then choose random numbers for $n$ and $m$, which happened to be $$\int_{-\infty}^\infty\frac{x^2}{1+x^8}dx$$I know there is a general formula for integrals of this form, which is $$\int_{-\infty}^\infty\frac{x^n}{1+x^m}dx=\frac{\pi}{m}\csc\left(\frac{\pi(n+1)}{m}\right)$$But let's forget about this right now. I used the Residue theorem and the semicircular contour to get that $$\int_{-\infty}^\infty\frac{x^2}{1+x^8}dx=\Re\left(\frac{\pi i}{4}\left(\frac{1}{e^{\frac{5\pi i}{8}}}+\frac{1}{e^{\frac{15\pi i}{8}}}+\frac{1}{e^{\frac{25\pi i}{8}}}+\frac{1}{e^{\frac{35\pi i}{8}}}\right)\right)$$
Is there any other ways to calculate this integral?