Integrating rational functions. $\int\frac{x^2-3x+1}{x^4-x^2+1}\mathrm{d}x$ Is there really another way of solving this problem $$\int\frac{x^2-3x+1}{x^4-x^2+1}\mathrm{d}x$$
avoiding partial fractions decomposition? I have tried the partial fractions decomposition, but it is not serving me right.
 A: The integral can be split into two pieces:
$$\begin{aligned}
\int {\frac{x}{{{x^4} - {x^2} + 1}}dx}  &= \frac{1}{2}\int {\frac{1}{{{u^2} - u + 1}}du}  \\
&= \frac{1}{{\sqrt 3 }}\arctan \left( {\frac{{2u - 1}}{{\sqrt 3 }}} \right) + C \\&= \frac{1}{{\sqrt 3 }}\arctan \left( {\frac{{2{x^2} - 1}}{{\sqrt 3 }}} \right) + C
\end{aligned}$$
where $u=x^2$, and
$$\int {\frac{{{x^2} + 1}}{{{x^4} - {x^2} + 1}}dx}  = \int {\frac{{1 + \frac{1}{{{x^2}}}}}{{{x^2} + \frac{1}{{{x^2}}} - 1}}dx}  = \int {\frac{{d(x - \frac{1}{x})}}{{{{(x - \frac{1}{x})}^2} + 1}}dx}  = \arctan (x - \frac{1}{x}) + C$$
Therefore
$$\begin{aligned}
\int {\frac{{{x^2} - 3x + 1}}{{{x^4} - {x^2} + 1}}dx}  &= \arctan (x - \frac{1}{x}) - 3\left[ {\frac{1}{{\sqrt 3 }}\arctan \left( {\frac{{2{x^2} - 1}}{{\sqrt 3 }}} \right)} \right] + C \\
&=
 \arctan (x - \frac{1}{x}) - \sqrt 3 \arctan \left( {\frac{{2{x^2} - 1}}{{\sqrt 3 }}} \right) + C
\end{aligned}$$
A: We have that $$\int\frac{x^2-3x+1}{(x^2-\sqrt{3}x+1)(x^2+\sqrt{3}x+1)}dx=\\=\int\frac{x^2-\sqrt{3}x+1}{(x^2-\sqrt3{x}+1)(x^2+\sqrt3{x}+1)}-\int\frac{(3-\sqrt{3})x}{x^4-x^2+1}=\\\int\frac{dx}{x^2+\sqrt{3}x+1}-\frac{3-\sqrt{3}}{2}\int\frac{2x}{x^4-x^2+1}dx$$
Now putting $u=x^2$ for the second integral
$$\int\frac{dx}{(x+\frac{\sqrt{3}}{2})^2+\frac{1}{4}}-\frac{3-\sqrt{3}}{2}\int\frac{du}{(u-\frac{1}{2})^2+\frac{3}{4}}$$
Those two integrals can be made into $\arctan$ form I'll leave it to you.
