<s>[INST] $\int\frac{1+x^2}{x^4+3x^3+3x^2-3x+1}dx$ $$\int\frac{1+x^2}{x^4+3x^3+3x^2-3x+1}dx$$
I tried to solve it.
$$\int\frac{1+x^2}{x^4+3x^3+3x^2-3x+1}dx=\int\frac{1+x^2}{(x^2+1)^2+3x^3+x^2-3x+1}dx=\int\frac{1+x^2}{(x^2+1)^2+3x(x^2-1)+x^2+1}dx$$
But this does not seem to be solving.Please help.
 [/INST] Don't take this answer too seriously, but I could not resist. I leave details to you to fill in.
First, you factor the denominator into second degree factors, as
$$
\begin{aligned}
x^4+3x^3+3x^2-3x+1&=\bigl(x^2+\frac{1}{2} \sqrt{7+2 \sqrt{37}} x+\frac{3 x}{2}+\frac{1}{4} \sqrt{46+10 \sqrt{37}}+\frac{\sqrt{37}}{4}+\frac{5}{4}\bigr)\\
&\qquad\times\bigl(x^2-\frac{1}{2} \sqrt{7+2 \sqrt{37}} x+\frac{3 x}{2}-\frac{1}{4} \sqrt{46+10 \sqrt{37}}+\frac{\sqrt{37}}{4}+\frac{5}{4}\bigr)
\end{aligned}
$$
Then, do a partial fraction decomposition. The ansatz is
$$
\begin{aligned}
\frac{x^2+1}{x^4+3x^3+3x^2-3x+1}&=\frac{ax+b}{x^2+\frac{1}{2} \sqrt{7+2 \sqrt{37}} x+\frac{3 x}{2}+\frac{1}{4} \sqrt{46+10 \sqrt{37}}+\frac{\sqrt{37}}{4}+\frac{5}{4}}\\
&\qquad+\frac{cx+d}{x^2-\frac{1}{2} \sqrt{7+2 \sqrt{37}} x+\frac{3 x}{2}-\frac{1}{4} \sqrt{46+10 \sqrt{37}}+\frac{\sqrt{37}}{4}+\frac{5}{4}}.
\end{aligned}
$$
A direct calculation shows that $a=c=0$ and
$$
b=\frac{1}{2}+\sqrt{\frac{\sqrt{37}}{22}-\frac{7}{44}}
\quad
\text{and}
\quad
d=\frac{1}{2}-\sqrt{\frac{\sqrt{37}}{22}-\frac{7}{44}}.
$$
What you then have to do is the usual completing the square in the denominator, and you will get some horrible arctans. I leave that to you.
</s>