Write the numerator of integrand as:
#x = 1/2(2x+1) -1/2#
and note that:
#d/dx (x^2+x+1) = 2x+1#
Then:
#int x/sqrt(x^2+x+1) dx = 1/2 int (2x+1)/sqrt(x^2+x+1)dx -1/2 int dx/sqrt(x^2+x+1)#
#int x/sqrt(x^2+x+1) dx = 1/2 int (d(x^2+x+1))/sqrt(x^2+x+1)dx -1/2 int dx/sqrt(x^2+x+1)#
#int x/sqrt(x^2+x+1) dx = sqrt(x^2+x+1) -1/2 int dx/sqrt(x^2+x+1)#
Solve now the resulting integral by completing the square at the denominator:
#1/2 int dx/sqrt(x^2+x+1) = 1/2 int dx/sqrt( (x+1/2)^2 +3/4)#
#1/2 int dx/sqrt(x^2+x+1) = int dx/sqrt( (2x+1)^2 +3)#
Substitute now:
#2x+1 = sqrt3 tant# with #t in (-pi/2,pi/2)#
#dx = sqrt3/2 sec^2 t dt#
to have:
#1/2 int dx/sqrt(x^2+x+1) = sqrt3/2 int (sec^2 t dt)/sqrt( 3tan^2t+3)#
#1/2 int dx/sqrt(x^2+x+1) = 1/2 int (sec^2 t dt)/sqrt( tan^2t+1)#
Use the trigonometric identity:
#tan^2t +1 = sec^2t#
and as for #t in (-pi/2,pi/2)# the secant is positive:
#sqrt(tan^2t +1) = sect#
Then:
#1/2 int dx/sqrt(x^2+x+1) = 1/2 int (sec^2 t dt)/sect#
#1/2 int dx/sqrt(x^2+x+1) = 1/2 int sec t dt#
#1/2 int dx/sqrt(x^2+x+1) = 1/2 ln abs (sect+tant) +C#
and undoing the substitution:
#1/2 int dx/sqrt(x^2+x+1) = 1/2 ln abs ((2x+1)/sqrt3 + sqrt( ( 2x+1)^2/3+1)) +C#
#1/2 int dx/sqrt(x^2+x+1) = 1/2 ln abs ((2x+1)+ sqrt( ( 2x+1)^2+3)) +C#
#1/2 int dx/sqrt(x^2+x+1) = 1/2 ln abs (2x+1+ 2sqrt( x^2+x+1) )+C#
Putting the partial solutions together:
#int x/sqrt(x^2+x+1) dx = sqrt(x^2+x+1) -1/2 ln abs (2x+1+ 2sqrt( x^2+x+1) )+C#