While trying to answer this question, I wondered whether there could be a way to:
(A) Find the closed form of the generalization of integrals $I$ and $J$, that is
$$I_n=\int_{-\infty}^{+\infty}\frac{dx}{x^{4n}+x^{2n}+1}$$
(B) Prove my own conjecture that
$$\lim_{n \to \infty}I_n = 2$$
Is there a clean way to do these?
EDIT: I have managed to find a closed form for the poles of the integrand that lie in the upper half-plane, which would be the ones lying within the usual semicircular contour:
$$\omega^+_n(j)=\exp\left(i\frac{\pi}{4n}\big(2j-1-(-1)^n\big)\right) \qquad 1 \leq j \leq 2n, \quad j \in \mathbb{N}$$
My integral would become
$$\def\res{\mathop{\text{Res}}} \begin{align} \oint_\Gamma \frac{dz}{z^{4n}+z^{2n}+1}&=\lim_{R\to\infty} \int_{-R}^{+R}\frac{dx}{x^{4n}+x^{2n}+1}+\lim_{R\to\infty}iR\int_{0}^{\pi}\frac{e^{i\theta}d\theta}{R^{4n}e^{i\theta4n}+R^{2n}e^{i\theta2n}+1} \\ &=2\pi i \sum_{j=1}^{2n} \res_{z=\omega^+_n(j)} \left(\frac{1}{z^{4n}+z^{2n}+1}\right) \end{align}$$ The limit of the integral in $\theta$ is $0$, as one would expect, so my question reduces to:
Is there a way to express $$\sum_{j=1}^{2n}\res_{z=\omega^+_n(j)} \left(\frac{1}{z^{4n}+z^{2n}+1}\right)$$ in terms of $n$ and $j$?
The answers to (A) and (B) above should follow from this in a relatively straightforward way.
This exercise is so much easier when you simply get rid of the $n$'s in the denominator, i.e., through a substitution $x=u^{1/(2 n)}$.
Write
$$I_n = 2 \int_0^{\infty} \frac{dx}{x^{4 n}+x^{2 n}+1} = \frac1n \int_0^{\infty} du \,\frac{ u^{-(2 n-1)/(2 n)}}{u^2+u+1} $$
Now consider the following contour integral
$$\oint_C dz \frac{z^a}{z^2+z+1} $$
where $a=-(2 n-1)/(2 n)$ and $C$ is a keyhole contour of outer radius $R$ and inner radius $\epsilon$ about the positive real axis. Letting $R \to \infty$ and $\epsilon \to 0$, the contour integral is equal to
$$\left (1-e^{i 2 \pi a} \right ) \int_0^{\infty} dx \frac{x^a}{x^2+x+1} $$
By the residue theorem, the contour integral is also equal to
$$i 2 \pi \left (\frac{e^{i 2 \pi a/3}}{i \sqrt{3}} + \frac{e^{i 4 \pi a/3}}{-i \sqrt{3}} \right ) $$
Thus,
$$\int_0^{\infty} dx \frac{x^a}{x^2+x+1} = \frac{2 \pi}{\sqrt{3}} \frac{\displaystyle\sin{\left (\frac{\pi a}{3} \right )}}{\sin{(\pi a)}} = \frac{\displaystyle\pi \sin{\left (\frac{a \pi}{3} \right )}}{\sin{(a \pi)} \sin{\left (\frac{\pi}{3} \right )}} $$
Now, letting $a=1/(2 n)-1$, we find that
and, indeed,
$$\lim_{n \to \infty} I_n = 2$$