<s>[INST] Evaluating $\int\frac{x^4+1}{x^6+1}dx$ I have problem with this integral:
$$\int\dfrac{x^4+1}{x^6+1}dx$$
I guess it is easy, but I was trying for quite a long time and the only thing I got is headache.
Thanks for help 
 [/INST] $\bf{My\; Solution:: }$ Let $$\displaystyle I = \int\frac{x^4+1}{x^6+1}dx = \int \frac{(x^2+1)^2-2x^2}{(x^2+1)\cdot (x^4-x^2+1)}dx$$
$$\displaystyle I  = \int\frac{x^2+1}{x^4-x^2+1}dx-2\int\frac{x^2}{(x^3)^2+1}dx = \int\frac{\left(1+\frac{1}{x^2}\right)}{\left(x-\frac{1}{x}\right)^2+1}dx-\frac{2}{3}\int\frac{3x^2}{(x^3)^2+1}dx$$
For First Integral put $$\displaystyle \left(x-\frac{1}{x}\right)=t\;\;,$$ Then $$\left(1+\frac{1}{x^2}\right)dx =dt$$
And for Second Integral Put $$x^3=u\;\;, 3x^2dx=du$$
So We Get $$\displaystyle I = \int\frac{x^4+1}{x^6+1}dx = \tan^{-1}\left(x-\frac{1}{x}\right)-\frac{2}{3}\tan^{-1}(x^3)+\mathcal{C}$$
</s>