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 — Factorise the denominator by grouping.
We group the first two and the last two terms; both groups contain 1+x.
1+x+x2+x3=(1+x)+x2(1+x)=(1+x)(1+x2)
Step 2 — Set up the partial fractions.
The factor 1+x2 cannot be factorised over the reals, so it gets a numerator Bx+C.
(1+x)(1+x2)1=1+xA+1+x2Bx+C
1=A(1+x2)+(Bx+C)(1+x)
Step 3 — Find A, B and C.
Putting x=−1 gives A; comparing the constant terms gives C, and comparing the x2 terms gives B.
x=−1:1Aconstants:A+CCx2 terms:A+BB=2A=21=1=21=0=−21
Step 4 — Integrate each piece.
We use ∫1+x2xdx=21log(1+x2) and ∫1+x2dx=tan−1x.
I=21∫1+xdx−21∫1+x2xdx+21∫1+x2dx=21log∣1+x∣−41log(1+x2)+21tan−1x+C
Therefore, ∫1+x+x2+x3dx=21log∣1+x∣−41log(1+x2)+21tan−1x+C, for x=−1.