<s>[INST] A rational function integration Evaluate $$\int \frac{3x^2+1}{(x^2-1)^3}dx$$ I tried breaking the numerator in terms of the denominator but it didn't help much. I also tried a few substitutions buy most of them were useless. Please give some hints. Thanks.
 [/INST] Let $$I = \int\frac{3x^2+1}{(x^2-1)^3}dx = \int\frac{3x^2+1}{x^{\frac{3}{2}}\left(x^{\frac{3}{2}}-x^{-\frac{1}{2}}\right)^3}dx$$
So $$I = \int\frac{3x^{\frac{1}{2}}+x^{-\frac{3}{2}}}{\left(x^{\frac{3}{2}}-x^{-\frac{1}{2}}\right)^3}dx\;,$$ Now Put $\left(x^{\frac{3}{2}}-x^{-\frac{1}{2}}\right)=t\;,$ Then $\left(3x^{\frac{1}{2}}+x^{-\frac{3}{2}}\right)dx = 2dt$
So we get $$I = 2\int t^{-3}dt = -\frac{1}{t^2}+\mathcal{C} = -\frac{x}{(x^2-1)^2}+\mathcal{C}$$
</s>