Consider, I=∫x+3(x−1)(x2+1)dx
x+3(x−1)(x2+1)=Ax−1+Bx+Cx2+1
⇒x+3=A(x2+1)+(Bx+C)(x−1)
⇒x+3=(A+B)x2+(C−B)x+(A−C)
⇒A+B=0
and C−B=1
and A−C=3
Solving these equations we get-
A=2,B=−2,C=−1
∫x+3(x−1)(x2+1)dx
=∫2x−1dx−∫2x+1x2+1dx
=2ln|x−1|−∫2xx2+1dx−∫1x2+1dx
Let z=x2+1+⇒dx=2xdx
⇒∫2xdxx2+1=dzz=lnz=ln(x2+1)
Hence integration becomes-
I=2ln|x−1|−ln(x2+1)−tan−1x+c