Answer
$$\arctan x + \frac{1}{2}\ln \left( {{x^2} + 2} \right) + C$$
Work Step by Step
$$\eqalign{
& \int {\frac{{{x^3} + {x^2} + x + 2}}{{\left( {{x^2} + 1} \right)\left( {{x^2} + 2} \right)}}} dx \cr
& {\text{The partial fraction decomposition of the integrand is}} \cr
& \frac{{{x^3} + {x^2} + x + 2}}{{\left( {{x^2} + 1} \right)\left( {{x^2} + 3} \right)}} = \frac{{Ax + B}}{{{x^2} + 1}} + \frac{{Cx + D}}{{{x^2} + 2}} \cr
& {\text{Multiplying by }}\left( {{x^2} + 1} \right)\left( {{x^2} + 2} \right){\text{ yields}} \cr
& {x^3} + {x^2} + x + 2 = \left( {Ax + B} \right)\left( {{x^2} + 2} \right) + \left( {Cx + D} \right)\left( {{x^2} + 1} \right) \cr
& {x^3} + {x^2} + x + 2 = A{x^3} + 2Ax + B{x^2} + 2B + C{x^3} + Cx + D{x^2} + D \cr
& {\text{Collecting like powers of }}x{\text{, this becomes}} \cr
& {x^3} + {x^2} + x + 2 = \left( {A{x^3} + C{x^3}} \right) + \left( {B{x^2} + D{x^2}} \right) + \left( {2Ax + Cx} \right) + 2B + D \cr
& {\text{Equating corresponding coefficients yields the following system }} \cr
& {\text{of linear equations}} \cr
& \,\,\,\,\,\,\,\,\,\,\,\,\,A + C = 1 \cr
& \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,B + D = 1 \cr
& \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,2A + C = 1 \cr
& \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,2B + D = 2 \cr
& {\text{Solving the system of linear equations by a calculator we obtain}} \cr
& \,\,\,A = 0,\,\,\,B = 1,\,\,\,C = 1,\,\,\,D = 0 \cr
& \cr
& {\text{Then}}{\text{, the integrand can be written as}} \cr
& \frac{{{x^3} + {x^2} + x + 2}}{{\left( {{x^2} + 1} \right)\left( {{x^2} + 3} \right)}} = \frac{1}{{{x^2} + 1}} + \frac{x}{{{x^2} + 2}} \cr
& \int {\frac{{{x^3} + {x^2} + x + 2}}{{\left( {{x^2} + 1} \right)\left( {{x^2} + 3} \right)}}} = \int {\left( {\frac{1}{{{x^2} + 1}} + \frac{x}{{{x^2} + 2}}} \right)} dx \cr
& {\text{Integrating}} \cr
& = \arctan x + \frac{1}{2}\ln \left( {{x^2} + 2} \right) + C \cr} $$