Let x2+x+1(x+1)2(x+2)=A(x+1)+B(x+1)2+C(x+2) ............. (1)
⇒x2+x+1=A(x+1)(x+2)+B(x+2)+C(x2+2x+1)
⇒x2+x+1=A(x2+3x+2)+B(x+2)+C(x2+2x+1)
⇒x2+x+1=(A+C)x2+(3A+B+2C)x+(2A+2B+C)
Equating the coefficients of x2,x,and constant term, we obtain
A+C=1
3A+B+2C=1
2A+2B+C=1
On solving these equations, we obtain
A=2,B=1, and C=3
From equation (1), we obtain
x2+x+1(x+1)2(x+2)=−2(x+1)+3(x+2)+1(x+1)2
∫x2+x+1(x+1)2(x+2)dx=−2∫1x+1dx+3∫1(x+2)dx+∫1(x+1)2dx
=−2log|x+1|+3log|x+2|−1(x+1)+C