<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] Yeah!
My first mathSE integration problem answer, in I don't remember how long.
$\displaystyle \frac{1}{x^2-1} = \frac{1}{2} 
\times \left[\frac{1}{x-1} - \frac{1}{x+1}\right].$
$\displaystyle \frac{x}{x^2-1} = \frac{1}{2} 
\times \left[\frac{x}{x-1} - \frac{x}{x+1}\right].$
This equals $\displaystyle 
\frac{1}{2} \left\{ \left[1 + \frac{1}{x-1}\right]
- \left[1 - \frac{1}{x+1}\right] \right\}.$
This equals $\displaystyle 
\frac{1}{2} \left[\frac{1}{x-1} + \frac{1}{x+1}\right].$
Therefore $$\int \frac{x}{x^2 - 1}~dx = \frac{1}{2} 
\left[ \log(x-1) + \log(x+1) \right].$$
Edit
Sad to say...
The shortcut is that
$\displaystyle \frac{d}{dx}\log(x^2 - 1) = \frac{2x}{x^2 - 1}.$
</s>