Integrating $\int \frac{x^2+1}{x(x^2-1)}$ How would I integrate the following.
$$\int \frac{x^2+1}{x(x^2-1)}$$
I have done the following.
$$\frac{x^2}{(x)(x+1)(x-1)}$$
$$\frac{A}{x}+\frac{B}{x+1}+\frac{C}{x-1}$$
I then did $\quad \displaystyle A(x^2-1)+B(x-1)+C(x+1)=x^2+1$
Then $\quad Ax^2-1A+Bx-1B+Cx+C=x^2+1$
Grouping I get  $$Ax^2=x^2,\quad A=1, \quad C=1,\quad Bx+Cx=0, \quad B=-1$$
Then plug back in
$$\int\frac{1}{x}-\frac{1}{x+1}+\frac{1}{x-1}$$
But I am not sure if I did it correctly.

A simpler solution is to note that you can calculate 
$$\int \frac{x^2-1}{x(x^2-1)} \mbox{and} \int \frac{3x^2-1}{x(x^2-1)}$$
Now 
$$x^2+1=(3x^2-1)-2(x^2-1)$$
Thus, your integral is
$$\int \frac{3x^2-1}{x^3-x}- 2\int \frac{x^2-1}{x(x^2-1)}$$
