Perform the decomposition into partial fractions
#(x^2+1)/((2x+1)(x-1)(x+1))=A/(2x+1)+B/(x-1)+C/(x+1)#
#=(A(x-1)(x+1)+B(2x+1)(x+1)+C(2x+1)(x-1))/((2x+1)(x-1)(x+1))#
The denominators are the same, compare the numerators
#x^2+1=A(x-1)(x+1)+B(2x+1)(x+1)+C(2x+1)(x-1)#
Let #x=-1/2#, #=>#, #5/4=-3/4A#, #=>#, #A=-5/3#
Let #x=1#, #=>#, #2=6B#, #=>#, #B=1/3#
Let #x=-1#, #=>#, #2=2C#, #=>#, #C=1#
Therefore,
#(x^2+1)/((2x+1)(x-1)(x+1))=(-5/3)/(2x+1)+(1/3)/(x-1)+(1)/(x+1)#
#int((x^2+1)dx)/((2x+1)(x-1)(x+1))=int(-5/3dx)/(2x+1)+int(1/3dx)/(x-1)+int(1dx)/(x+1)#
#=-5/6ln(|2x+1|)+1/3ln(|x-1|)+ln(|x+1|)+C#