<s>[INST] Prove that $\int_{-\infty}^{+\infty} \frac{1}{x^4+x^2+1}dx = \frac{\pi}{\sqrt{3}}$ Good evening everyone,
how can I prove that
$$\int_{-\infty}^{+\infty} \frac{1}{x^4+x^2+1}dx = \frac{\pi}{\sqrt{3}}\;?$$
Well, I know that $\displaystyle\frac{1}{x^4+x^2+1} $ is an even function and the interval $(-\infty,+\infty)$ is symmetric about zero, so
$$\int_{-\infty}^{+\infty} \frac{1}{x^4+x^2+1}dx = 2\int_0^\infty \frac{1}{x^4+x^2+1}dx.$$
Then I use the partial fraction:
$$2\int_0^\infty \frac{1}{x^4+x^2+1}dx= 2\int_0^\infty \left( \frac{1-x}{2(x^2-x+1)} + \frac{x+1}{2(x^2+x+1)} \right)dx.$$
So that's all. What's next step?
 [/INST] $$\int_{\mathbb{R}}\frac{dx}{x^4+x^2+1}=2\int_{0}^{+\infty}\frac{dx}{x^4+x^2+1} = 2\int_{0}^{1}\frac{dx}{x^4+x^2+1}+2\int_{0}^{1}\frac{x^2\,dx}{x^4+x^2+1}$$
so we just have to find:
$$ I=2\int_{0}^{1}\frac{1+x^2}{1+x^2+x^4}\,dx = 2\int_{0}^{1}\frac{1-x^4}{1-x^6}\,dx.$$
By expanding the integrand function as a geometric series we have:
$$ I = 2\sum_{n=0}^{+\infty}\left(\frac{1}{6n+1}-\frac{1}{6n+5}\right)=2\sum_{n=1}^{+\infty}\frac{\chi(n)}{n} $$
where $\chi(n)$ is the primitive non-principal Dirichlet character $\!\!\pmod{6}$. Since, by the residue theorem:
$$\frac{x^2+1}{x^4+x^2+1}=-\frac{i}{2\sqrt{3}}\left(\frac{1}{x-\omega}+\frac{1}{x-\omega^2}-\frac{1}{x-\omega^4}-\frac{1}{x-\omega^5}\right)$$
where $\omega=\exp\frac{2\pi i}{6}$, it follows that:
$$ I = \int_{0}^{1}\left(\frac{1}{1-x+x^2}+\frac{1}{1+x+x^2}\right)\,dx=\frac{2\pi}{3\sqrt{3}}+\frac{\pi}{3\sqrt{3}}=\color{red}{\frac{\pi}{\sqrt{3}}}. $$
As an alternative approach, we can just manipulate the series representation:
$$ I = 2\sum_{n\geq 0}\frac{4}{(6n+3)^2-4}=\frac{1}{9}\sum_{n\geq 0}\frac{8}{(2n+1)^2-\frac{4}{9}}\tag{1}$$
through the logarithmic derivative of the Weierstrass product for the cosine function:
$$ \cos z = \prod_{n\geq 0}\left(1-\frac{4z^2}{(2n+1)^2 \pi^2}\right), $$
$$ \tan z = \sum_{n\geq 0}\frac{8z}{(2n+1)^2 \pi^2 - 4z^2}$$
$$ \pi\tan(\pi z) = \sum_{n\geq 0}\frac{8z}{(2n+1)^2 - 4z^2}\tag{2}$$
from which it follows that:
$$ I = \frac{\pi}{3}\tan\frac{\pi}{3} = \frac{\pi}{\sqrt{3}}.\tag{3} $$
</s>