Solution:
Key idea: A proper rational function whose denominator factorises can be split into partial fractions: a linear factor (x−p) gets x−pA, a repeated factor (x−p)2 gets x−pA+(x−p)2B, and an irreducible quadratic gets quadraticBx+C. Each piece then integrates using ∫x−pdx=log∣x−p∣+C.
Step 1 — Set up the partial fractions.
The factor (x+1)2 is repeated, so it needs both x+1A and (x+1)2B.
(x+1)2(x+2)x2+x+1=x+1A+(x+1)2B+x+2C
x2+x+1=A(x+1)(x+2)+B(x+2)+C(x+1)2
Step 2 — Find B and C.
Putting x=−1 removes the A and C terms; putting x=−2 removes the A and B terms.
x=−1:1x=−2:3=B=C
Step 3 — Find A.
Comparing the coefficients of x2 on both sides gives A+C=1.
A+3A=1=−2
Step 4 — Integrate.
We use ∫(x+1)2dx=−x+11 for the B term.
∫(x+1)2(x+2)x2+x+1dx=−2log∣x+1∣−x+11+3log∣x+2∣+C
Note: The answer printed in the textbook has −x+21 for the middle term, a misprint. The repeated factor is x+1, and ∫(x+1)2dx=−x+11.
Therefore, ∫(x+1)2(x+2)x2+x+1dx=−2log∣x+1∣−x+11+3log∣x+2∣+C.