How to find exact value of integral $\int_{0}^{\infty} \frac{1}{\left(x^{4}-x^{2}+1\right)^{n}}dx$? When I first encountered the integral $\displaystyle \int_{0}^{\infty} \frac{1}{x^{4}-x^{2}+1} d x$, I am very reluctant to solve it by partial fractions and search for any easier methods.  Then I learnt a very useful trick to evaluate the integral.
Noting that
$$I(1):= \int_{0}^{\infty} \frac{d x}{x^{4}-x^{2}+1} \stackrel{x \mapsto \frac{1}{x}}{=} \int_{0}^{\infty} \frac{x^{2}}{x^{4}-x^{2}+1}
$$
Combining them yields
\begin{aligned}
I(1)&=\frac{1}{2} \int_{0}^{\infty} \frac{x^{2}+1}{x^{4}-x^{2}+1} d x\\&= \frac{1}{2}\int_{0}^{\infty} \frac{1+\frac{1}{x^{2}}}{x^{2}+\frac{1}{x^{2}}-1} d x \\
&= \frac{1}{2}\int_{0}^{\infty} \frac{d\left(x-\frac{1}{x}\right)}{\left(x-\frac{1}{x}\right)^{2}+1} \\
&= \frac{1}{2}\tan ^{-1}\left(x-\frac{1}{x}\right)_{0}^{\infty} \\
&= \frac{\pi}{2}
\end{aligned}
Later, I started to investigate the integrands with higher powers.
Similarly,
$$
I(2):= \int_{0}^{\infty} \frac{d x}{\left(x^{4}-x^{2}+1\right)^{2}} \stackrel{x \mapsto \frac{1}{x}}{=}\int_{0}^{\infty} \frac{x^{6}}{\left(x^{4}-x^{2}+1\right)^{2}} d x
$$
By division, we decomposed $x^6$ and obtain $$
\frac{x^{6}}{\left(x^{4}-x^{2}+1\right)^{2}}=\frac{x^{2}+1}{x^{4}-x^{2}+1}-\frac{1}{\left(x^{4}-x^{2}+1\right)^{2}}
$$$$
I(2)=\int_{0}^{\infty} \frac{x^{2}+1}{x^{4}-x^{2}+1} d x-\int_{0}^{\infty} \frac{1}{\left(x^{4}-x^{2}+1\right)^{2}}dx
$$
We can now conclude that $$I(2)=I(1)=\frac{\pi}{2} $$
My Question:
How about the integral $$\displaystyle I_{n}=\int_{0}^{\infty} \frac{d x}{\left(x^{4}-x^{2}+1\right)^{n}}$$ for any integer $n\geq 3$?

Glad to see there are several nice answers in various perspectives.  I am now going to give one more by inverse substitution followed by integration by parts.
Using $x \mapsto \frac{1}{x}$ yields
$$
I(m, n, r):=\int_{0}^{\infty} \frac{x^{r} d x}{\left(x^{m}+1\right)^{n}} \stackrel{x \mapsto \frac{1}{x}}{=} \int_{0}^{\infty} \frac{\frac{1}{x^{r}}}{\left(\frac{1}{x^{m}}+1\right)^{n}}\left(\frac{d x}{x^{2}}\right)
$$
Simplifying and then  performing integration by parts,
$$
\begin{aligned}
I(m, n, r) &=\int_{0}^{\infty} \frac{x^{m n-r-2}}{\left(1+x^{m}\right)^{n}} d x \\
&=-\frac{1}{m(n-1)} \int_{0}^{\infty} x^{(n-1)m-r-1} d\left(\frac{1}{\left(1+x^{m}\right)^{n-1}}\right) \\
&=\frac{m(n-1)-r-1}{m(n-1)} \int_{0}^{\infty} \frac{x^{m(n-1)-r-2}}{\left(1+x^{m}\right)^{n-1}} d x \\
&=\left(1-\frac{r+1}{m(n-1)}\right) I(m, n-1, r) \\
&\qquad\qquad  \vdots\\ &=\left(1-\frac{r+1}{m(n-1)}\right)\left(1-\frac{r+1}{m(n-2)}\right) \cdots\left(1-\frac{r+1}{m}\right) I\left(m,1,r\right) \\
&=\prod_{j=1}^{n-1}\left(1-\frac{r+1}{j m}\right)\int_{0}^{\infty} \frac{x^{r}}{x^{m}+1} d x
\end{aligned}
$$
Using the formula proved in my post
$$
\int_{0}^{\infty} \frac{x^{r}}{x^{m}+1} d x=\frac{\pi}{m} \csc \frac{(r+1) \pi}{m},
$$
by putting $r=2k$ and $m=6$, we can conclude
$$
\begin{aligned}
\int_{0}^{\infty} \frac{1}{\left(x^{4}-x^{2}+1\right)^{n}} d x 
=& \int_{0}^{\infty}\left(\frac{x^{2}+1}{x^{6}+1}\right)^{n} d x \\
=& \sum_{k=0}^{n}\left(\begin{array}{c}
n \\
k
\end{array}\right) \int_{0}^{\infty} \frac{x^{2 k}}{\left(1+x^{6}\right)^{n}} d x \\=& \boxed{\sum_{k=0}^{n}\left[\left(\begin{array}{c}
n \\
k
\end{array}\right) \frac{\pi}{6} \csc \frac{(2 k+1) \pi}{6} \prod_{j=1}^{n-1}\left(1-\frac{2 k+1}{6 j}\right)\right]}
\end{aligned}
$$
