#intln(x^2+x+1)dx#
apply Integration by Parts
#u=ln(x^2+x+1)#
#du=(2x+1)/(x^2+x+1)dx#
#dv=dx#
#v=x#
#intln(x^2+x+1)dx=xln(x^2+x+1)-int(x(2x+1))/(x^2+x+1)dx#
#rarr##(1)#
Let #I=int(x(2x+1))/(x^2+x+1)dx=#
simplify
#int(2x^2+x)/(x^2+x+1)dx#=#int(x^2+x+1)/(x^2+x+1)dx+int(x^2-1)/(x^2+x+1)dx#
#=x+int(x^2-1)/(x^2+x+1)dx#
let #r=int(x^2-1)/(x^2+x+1)dx#
completing the square of the denominator :
#r=int(x^2-1)/((x+1/2)^2+3/4)dx#
apply trigonometric substitution
#x+1/2=sqrt(3)/2tantheta#
#dx=sqrt(3)/2sec^2theta*d(theta)#
#x^2=3/4tan^2theta-sqrt(3)/2tantheta+1/4#
substitute
#int(x^2-1)/((x+1/2)^2+3/4)dx=int((3/4tan^2theta-sqrt(3)/2tantheta+1/4)-1)/(3/4tan^2theta+3/4)sqrt(3)/2sec^2thetad(theta)#
simplify where #tan^2theta+1=sec^2theta#
#4/3*sqrt(3)/2int(3/4tan^2theta-sqrt(3)/2tantheta-3/4)d(theta)#
simplify again using the relation #tan^2theta+1=sec^2theta#
#2/sqrt3int(3/4sec^2theta-sqrt3/2tantheta-3/2)d(theta)#=#sqrt3/2tantheta+lncostheta-sqrt3theta+C#
reverse the trigonometric substitution
#theta=tan^-1(2/sqrt(3)(x+1/2))#
so,
#r=int(x^2-1)/(x^2+x+1)dx#=#(x+1/2)+lncostan^-1(2/sqrt(3)(x+1/2))-sqrt3tan^-1(2/sqrt(3)(x+1/2))+C#
substituting in #I#:
#I=x+(x+1/2)+lncostan^-1(2/sqrt(3)(x+1/2))-sqrt3tan^-1(2/sqrt(3)(x+1/2))+C#
and substituting with the value of I in (1)
your final integration result will be:
#intln(x^2+x+1)dx#=#xln(x^2+x+1)-x-(x+1/2)-lncostan^-1(2/sqrt(3)(x+1/2))+sqrt3tan^-1(2/sqrt(3)(x+1/2))+C#