#int[(x^2+1)/(x^2-1)]dx#
= #int[(x^2-1+2)/(x^2-1)]dx#
= #int[1+2/(x^2-1)]dx#
= #x+int2/(x^2-1)dx#
As #(x^2-1)=(x+1)(x-1)#, let #2/((x+1)(x-1))hArrA/(x+1)+B/(x-1)# i.e.
#2/((x+1)(x-1))hArr(A(x-1)+B(x+1))/((x+1)(x-1))# or
#2/((x+1)(x-1))hArr((A+B)x-A+B)/((x+1)(x-1))#
i.e. #A+B=0# and #-A+B=2# and adding them we get #2B=2#
or #B=1# and #A=-1#. Hence
#int[(x^2+1)/(x^2-1)]dx=x+int[-1/(x+1)+1/(x-1)]dx#
= #x-ln(x+1)+ln(x-1)+c#