Evaluate $\int {2x\over x^2-1}dx$ My friend evaluated this before he went to bed: $$\int {2x\over x^2-1}dx$$
The answer was $\log(x^2-1)$.
I just can't figure out how that works. I know that $\int \frac1x dx = \log|x|$, so what just happened to $2x$?

$\frac{2x}{x^2-1}=\frac{(x+1)+(x-1)}{x^2-1}=\frac1{x-1}+\frac1{x+1}$

Alternatively, using Partial Fraction Decomposition, let $\frac{2x}{x^2-1}=\frac{(x+1)+(x-1)}{x^2-1}=\frac A{x+1}+\frac B{x-1}$ where $A,B$ are arbitrary constants.
So, $2x=(A+B)x+B-A$
Comparing the constant terms in either of the identity, $B-A=0\implies A=B$ 
Comparing the coefficients of $x,A+B=2\implies A=B=1$
So, $\frac{2x}{x^2-1}=\frac{(x+1)+(x-1)}{x^2-1}=\frac 1{x+1}+\frac 1{x-1}$
