An integral of a rational function with high degrees: Evaluate $\int_{-\infty}^{\infty}\frac{(x^4 + 1)^2}{x^{12} + 1}dx$. 
Calculate: $$\int_{-\infty}^{\infty}\frac{(x^4 + 1)^2}{x^{12} + 1}dx.$$

What I have tried is to divide both numerator and denominator with $x^4 + 1$ and then get two following integrals, because of parity of the integrand (nothing else worked for me): $$2\int_0^\infty \frac{x^4 + 1}{(x^4 - \sqrt3x^2 + 1)(x^4 + \sqrt3x^2 + 1)}dx = $$ $$ = \int_0^\infty \frac1{x^4 - \sqrt3x^2 + 1}dx + \int_0^\infty\frac1{x^4 + \sqrt3x^2 + 1}dx = $$ $$ = \int_0^\infty \frac1{(x^2 - \frac{\sqrt3}2)^2 + \frac14}dx + \int_0^\infty \frac1{(x^2 + \frac{\sqrt3}2)^2 + \frac14}dx.$$
I don't see what would be continuation of this. Any help is appreciated.
Thank you for any help. Appreciate it.
 A: 
Hint: For integrals of rational functions of even polynomials over the real line, the following substitution can come in handy:
$$\begin{align}
\mathcal{I}
&=\int_{-\infty}^{\infty}\mathrm{d}x\,\frac{\left(x^{4}+1\right)^{2}}{x^{12}+1}\\
&=\int_{-\infty}^{\infty}\mathrm{d}x\,\frac{\left(x^{4}+1\right)^{2}}{\left(x^{4}+1\right)\left(x^{8}-x^{4}+1\right)}\\
&=\int_{-\infty}^{\infty}\mathrm{d}x\,\frac{x^{4}+1}{x^{8}-x^{4}+1}\\
&=2\int_{0}^{\infty}\mathrm{d}x\,\frac{x^{4}+1}{x^{8}-x^{4}+1}\\
&=2\int_{0}^{\infty}\mathrm{d}x\,\frac{\left(x^{2}+x^{-2}\right)}{x^{2}\left(x^{4}+x^{-4}-1\right)}\\
&=2\int_{0}^{\infty}\mathrm{d}x\,\frac{\left(x^{2}+x^{-2}\right)}{\left(x^{4}+x^{-4}-1\right)};~~~\small{\left[x\mapsto\frac{1}{x}\right]}\\
&=\int_{0}^{\infty}\mathrm{d}x\,\frac{\left(x^{2}+x^{-2}\right)}{x^{2}\left(x^{4}+x^{-4}-1\right)}+\int_{0}^{\infty}\mathrm{d}x\,\frac{\left(x^{2}+x^{-2}\right)}{\left(x^{4}+x^{-4}-1\right)}\\
&=\int_{0}^{\infty}\mathrm{d}x\,\frac{x^{2}+1}{x^{2}}\cdot\frac{\left(x^{2}+x^{-2}\right)}{\left(x^{4}+x^{-4}-1\right)}\\
&=\int_{-\infty}^{\infty}\mathrm{d}y\,\frac{2\left(4y^{2}+2\right)}{\left(16y^{4}+16y^{2}+1\right)};~~~\small{\left[\frac{x^{-1}-x}{2}=y\iff x=\sqrt{y^{2}+1}-y\right]}.\\
\end{align}$$
Note that we have cut the degrees of the polynomials in half and still have all integer coefficients. This could be considered an advantage over the brute-force partial fraction method if you're looking to avoid messy factorizations.
A: Reduce the rational degrees with successive  substitutions as follows
$$\begin{align}
\int_{-\infty}^{\infty}\frac{(x^{4}+1)^{2}}{x^{12}+1}dx=&\ 2\int_{0}^{\infty}\frac{x^{4}+1}{x^{8}-x^{4}+1}\overset{x\to\frac1x}{dx}=\int_{0}^{\infty}\frac{(x^{4}+1)(x^2+1)}{x^{8}-x^{4}+1}
\overset{ x-\frac1x\to x}{ dx} \\
=& \ 2\int_0^\infty \frac{x^2+2}{x^4+4x^2+1} \overset{x\to\frac1x}{dx}= 3\int_{0}^{\infty}\frac{x^2+1}{x^4+4x^2+1}
\overset{x-\frac1x\to x}{ dx} \\
=&\ 6\int_0^\infty \frac1{x^2+6}dx
=\sqrt{\frac32}\pi
\end{align}$$
A: Hint: The difference of two squares $a^2-b^2$ can be factored as $(a-b)(a+b)$. A sum of two squares $a^2+b^2$ can be thought of as $a^2-(ib)^2$...
A: Any rational function can always be integrated by decomposing it into partial fractions. In this case this decomposition is particularly simple.
\begin{eqnarray}
\frac{1}{x^4-\sqrt{3} x^2+1} &=& \frac{1}{x^2-\theta_+} \cdot \frac{1}{\theta_+-\theta_-} + \frac{1}{x^2-\theta_-} \cdot \frac{1}{\theta_--\theta_+}\\
\frac{1}{x^4+\sqrt{3} x^2+1} &=& \frac{1}{x^2-\lambda_+} \cdot \frac{1}{\lambda_+-\lambda_-} + \frac{1}{x^2-\lambda_-} \cdot \frac{1}{\lambda_--\lambda_+} 
\end{eqnarray}
where $\theta_\pm=(\sqrt{3}\pm \imath)/2$ and $\lambda_\pm=(-\sqrt{3}\pm \imath)/2$.
Therefore 
\begin{eqnarray}
\int\limits_0^\infty \frac{dx}{x^4-\sqrt{3} x^2+1}&=& \frac{\pi}{\imath} \frac{1}{\sqrt{\frac{-\sqrt{3}-\imath}{2}}}\\
\int\limits_0^\infty \frac{dx}{x^4+\sqrt{3} x^2+1}&=& \frac{\pi}{\imath} \frac{1}{\sqrt{\frac{+\sqrt{3}-\imath}{2}}}
\end{eqnarray}
Now by using simple complex analysis we get the final result:
\begin{equation}
\int\limits_{-\infty}^\infty \frac{(x^4+1)^2}{x^{12}+1} dx = \sqrt{\frac{3}{2}}\pi
\end{equation}
A: More a comment than an answer:
According to Wolfy,
the indefinite integrals
involve arctan and
complex values.
But the definite integrals
come out like this:
$\int_0^∞ \dfrac{dx}{x^4 - \sqrt{3} x^2 + 1}  
= \frac12 \sqrt{2 + \sqrt{3}} π≈3.0345
$
and
$\int_0^∞ \dfrac{dx}{x^4 + \sqrt{3} x^2 + 1} dx = \dfrac{π}{2 \sqrt{2 + \sqrt{3}}}
≈0.8131
$
