∫ln(x2+x+1)dx
apply Integration by Parts
u=ln(x2+x+1)
du=2x+1x2+x+1dx
dv=dx
v=x
∫ln(x2+x+1)dx=xln(x2+x+1)−∫x(2x+1)x2+x+1dx
→(1)
Let I=∫x(2x+1)x2+x+1dx=
simplify
∫2x2+xx2+x+1dx=∫x2+x+1x2+x+1dx+∫x2−1x2+x+1dx
=x+∫x2−1x2+x+1dx
let r=∫x2−1x2+x+1dx
completing the square of the denominator :
r=∫x2−1(x+12)2+34dx
apply trigonometric substitution
x+12=√32tanθ
dx=√32sec2θ⋅d(θ)
x2=34tan2θ−√32tanθ+14
substitute
∫x2−1(x+12)2+34dx=∫(34tan2θ−√32tanθ+14)−134tan2θ+34√32sec2θd(θ)
simplify where tan2θ+1=sec2θ
43⋅√32∫(34tan2θ−√32tanθ−34)d(θ)
simplify again using the relation tan2θ+1=sec2θ
2√3∫(34sec2θ−√32tanθ−32)d(θ)=√32tanθ+lncosθ−√3θ+C
reverse the trigonometric substitution
θ=tan−1(2√3(x+12))
so,
r=∫x2−1x2+x+1dx=(x+12)+lncostan−1(2√3(x+12))−√3tan−1(2√3(x+12))+C
substituting in I:
I=x+(x+12)+lncostan−1(2√3(x+12))−√3tan−1(2√3(x+12))+C
and substituting with the value of I in (1)
your final integration result will be:
∫ln(x2+x+1)dx=xln(x2+x+1)−x−(x+12)−lncostan−1(2√3(x+12))+√3tan−1(2√3(x+12))+C