<s>[INST] 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.
 [/INST] 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.
</s>