Which methods to use to integrate $\int{\frac{x^4 + 1}{x^2 +1}}\, dx$ I have this integral to evaluate:
$$\int{\frac{x^4 + 1}{x^2 +1}}\, dx$$
I have tried substitution, trig identity and integration by parts but I'm just going round in circles. 
Can anyone explain the method I need to work this out?

HINT:
As $x^4-1=(x^2)^2-1=(x^2+1)(x^2-1),$
$$\frac{x^4 + 1}{x^2 +1}=\frac{x^4-1+2}{x^2 +1}=x^2-1+\frac2{x^2+1}$$
Generalization :
If the integrand is $$\frac{a_0+a_1x+a_2x^2+a_3x^3+\cdots}{ax^2+bx+c},$$
just divide to get the quotient of the form $b_0+b_1x+b_2x^2+\cdots$ which is easily integrable and the remaining part will be of the form  $\frac{px+q}{ax^2+bx+c}$
If $p=0$ check the $I_2$ below.
else we set $px+q=r\frac{d(ax^2+bx+c)}{dx}+ s=r(2ax)+rb+s$
Comparing the coefficients of $x,2ar=p\implies r=\frac p{2a}$
and Comparing the constants, $rb+s=q\implies s=q-rb=q-\frac{pb}{2a}$ 
$$\text{So, }\int \frac{px+q}{ax^2+bx+c} dx$$
$$=r \int \frac{d(ax^2+bx+c)}{dx}\frac1{ax^2+bx+c}dx+s\int\frac1{ax^2+bx+c}dx $$
$$=\frac p{2a}\int \frac{d(ax^2+bx+c)} {ax^2+bx+c}+\left(q-\frac{pb}{2a}\right)\int\frac1{ax^2+bx+c}dx $$
$$\text{Now, } \int \frac{d(ax^2+bx+c)} {ax^2+bx+c}=\ln|ax^2+bx+c|+C$$
$$\text{and } I_2=\int\frac1{ax^2+bx+c}dx =\int\frac{4a}{(2ax+b)^2+4ac-b^2}dx $$
If $4ac-b^2=0,$ put $2ax+b=u$ in $I_2$
If $4ac-b^2>0, 4ac-b^2=t^2$(say, ) $I_2=4a\int \frac{dx}{(2ax+b)^2+t^2}$ and put $2ax+u=t\tan\theta$
If $4ac-b^2<0, 4ac-b^2=-t^2$(say, ) $I_2=4a\int \frac{dx}{(2ax+b)^2-t^2}$ and put $2ax+u=t\sec\theta$
