Let, #I=int(x^4+3x+1)/(x^2+x+1)dx.#
We notice that the given Integrand is an Improper Rational
Function, (i.e., the degree of the Nr. poly. is more than that of the
Dr. poly.); so, our first task is to make it Proper. This is usually
done by Long Division, but we proceed as under :
#because, x^4+3x+1=x^2(x^2+x+1)-x(x^2+x+1)+4x+1,#
#:. (x^4+3x+1)/(x^2+x+1)=x^2-x+(4x+1)/(x^2+x+1).#
#rArr I=int{x^2-x+(4x+1)/(x^2+x+1)}dx,#
#=x^3/3-x^2/2+int(4x+1)/(x^2+x+1)dx.#
Here, #d/dx(x^2+x+1)=2x+1," so, we take "4x+1=2(2x+1)-1,# and get,
#I=x^3/3-x^2/2+int{2(2x+1)-1}/(x^2+x+1)dx,#
#=x^3/3-x^2/2+2int{d/dx(x^2+x+1)}/(x^2+x+1)dx-int1/(x^2+x+1)dx,#
#=x^3/3-x^2/2+2ln(x^2+x+1)-int1/{(x^2+x+1/4)+3/4}dx,#
#=x^3/3-x^2/2+2ln(x^2+x+1)-int1/{(x+1/2)^2+(sqrt3/2)^2dx,#
#=x^3/3-x^2/2+2ln(x^2+x+1)-1/(sqrt3/2)arc tan{(x+1/2)/(sqrt3/2)},#
#:. I=x^3/3-x^2/2+2ln(x^2+x+1)-2/sqrt3arc tan((2x+1)/sqrt3)+C.#
Enjoy Maths.!