Integrating $\displaystyle\int \frac{1+x^2}{1+x^4}dx$

One may write $$ \int \dfrac{1+x^2}{1+x^4}dx=\int \dfrac{1+\frac1{x^2}}{\frac1{x^2}+x^2}dx=\int \dfrac{\left(x-\frac1x\right)'}{\left(x-\frac1x\right)^2+2}\:dx $$ then one may conclude easily.


Hint: $$\int\frac{1+x^{2}}{1+x^{4}}dx=\frac{1}{2}\int\left(\frac{1}{x^{2}+\sqrt{2}x+1}+\frac{1}{x^{2}-\sqrt{2}x+1}\right)dx$$ $$=\frac{1}{2}\int\left(\frac{1}{\left(x+\frac{1}{\sqrt{2}}\right)^{2}+\frac{1}{2}}+\frac{1}{\left(x-\frac{1}{\sqrt{2}}\right)^{2}+\frac{1}{2}}\right)dx.$$


Roots can be complex as well.

$x^4+1=0 \Leftrightarrow x \in \{e^{i k \pi / 4} \ ,\ k \in \{1,3,5,7 \} \}$.

You have 4 complex roots which are all different; hence, using denominator factorization and partial fractions as you mentioned should do the trick.


$$\sin^2 x =\frac{1}{2}{(1- \cos2x)}$$ $$\cos^2 x =\frac{1}{2}{(1+\cos2x)}$$ $$\sin^4 x + \cos ^4 x =\frac{1}{4}\left[(1- \cos2x)^2 +(1+ \cos2x)^2 \right] =\frac{1}{2}((1+ \cos^2 2x)$$ $$\implies 2 \int \frac{dx}{1+ \cos^2 2x}$$ $$= 2 \int \frac{\sec^2 2x}{\sec^2 2x+ 1}{dx}$$ $$t= \tan2x$$ $$\implies 2 \int \frac{dt}{2 + t^2}$$ $$\frac{1}{\sqrt2} \tan^{-1} \left(\frac{t}{\sqrt2}\right)$$


A more general approach would be to identify that we have a quotient of polynomials and realize we can do factorization and partial fraction decomposition. @Salem is on this track but does not mention how very general it is. It will work on any fraction of polynomials $$\frac{P(x)}{Q(x)} = \sum_{\forall i} \frac{P_i(x)}{Q_i(x)}$$ where for complex numbers and real polynomials these $P_i$ and $Q_i$ are ensured to be of maximum degree 2 and have real roots. So we are sure to get away with really nice terms to integrate once we have done the decomposition.