Solution
Using polynomial division,
x2−1x3+x+1=x+x2−12x+1
Since
x2−1=(x+1)(x−1),
let
(x+1)(x−1)2x+1=x+1A+x−1B
Multiplying by (x+1)(x−1),
2x+1=A(x−1)+B(x+1)
Putting x=−1,
−1=−2A
Therefore,
A=21
Putting x=1,
3=2B
Therefore,
B=23
Hence,
x2−1x3+x+1=x+2(x+1)1+2(x−1)3
Integrating,
∫x2−1x3+x+1dx=2x2+21log∣x+1∣+23log∣x−1∣+C