<s>[INST] Integrate: $\frac{x^2+x-1}{x^2-1}$ with respect to $x$ Ok so here is where I am up to:
I can find some similarity with the numerator and denominator and managed to reduce to the following:
$\int\frac{x^2+x-1}{x^2-1}dx = \int\frac{x^2-1}{x^2-1}+\frac{x}{x^2-1}dx$
$=\int1+\frac{x}{x^2-1}dx.$
I tried to reduce it further by factoring out an $(x-1)$ but did not get anywhere after that.
Is there any other way to transpose this into a simpler format so I can integrate it?
 [/INST] $\int x^2 + x - 1\over x^2 - 1$ dx = $\int ({x^2 - 1\over x^2 - 1} + {x\over x^2 - 1})$dx
= $\int 1 dx + \int {x\over x^2 - 1}$ dx
Let $x^2 - 1$ = t  $\implies$ 2x dx = dt
= x + $\int {dt\over 2t}$
= x + ${1\over 2} \int {1\over t}$ dt       
since, integration of ${1\over x}$ = log x
= x + ${1\over 2}$ log t + C
Substituting the value of t here, we get
= x + $log(x^2 - 1)\over 2$ + C
</s>