Indefinite Integration

Evaluate $\displaystyle\int \dfrac{x^6 + 2}{x^2 + 1} dx$


Let $I = \displaystyle\int \dfrac{x^6 + 1}{x^2 + 2} dx$

i.e. $I = \displaystyle\int \dfrac{x^6 + 1}{x^2 + 1} dx \;\; + \;\; \displaystyle\int \dfrac{1}{x^2 + 1} dx$

i.e. $I = I_1 + I_2$ where $I_1 = \displaystyle\int \dfrac{x^6 + 1}{x^2 + 1} dx$ and $I_2 = \displaystyle\int \dfrac{1}{x^2 + 1} dx$

Now, $\dfrac{x^6 + 1}{x^2 + 1} = \dfrac{\left(x^2 + 1\right) \left(x^4 - x^2 + 1\right)}{x^2 + 1} = x^4 - x^2 + 1$

$\therefore$ $I_1 = \int \left(x^4 - x^2 + 1\right) dx$

i.e. $I_1 = \int x^4 dx - \int x^2 dx + \int dx$

$\therefore$ $I = \int x^4 dx - \int x^2 dx + \int dx + \displaystyle\int \dfrac{1}{x^2 + 1} dx$

i.e. $I = \dfrac{x^5}{5} - \dfrac{x^3}{3} + x + \tan^{-1} x + c$