How do I evaluate this integral? I tried partial fractions; my answer involved $\ln$, and I don't know if I'm right $$\int \left(\frac{x^2+1}{x^2-1}\right)\,dx$$
I tried partial fraction and my answer was all "ln" I dont know if I'm right
My answer looks like this
$$\frac{1}{2}\ln\left(\frac{x-1}{x+1}\right) + C$$
 A: Hint: $$\int\frac{x^2+1}{x^2-1}dx \equiv \underbrace{\int \frac{x^2+1}{(x+1)(x-1)} dx \equiv  \int \left[1+\frac{1}{x-1}-\frac{1}{x+1} \right]dx}_{\text{partial fractions: try it yourself!}}=??$$
A: Your integral can be written as follows:
$$I = \int \frac{x^2 + 1 - 1 + 1}{x^2 - 1} \, \mathrm{d} x,$$ which is equivalent to:
$$I = \int \left(1 + \frac{2}{x^2 - 1} \right)\, \mathrm{d} x = \int \left(1 + \frac{A}{x -  1} + \frac{B}{x+1} \right)\, \mathrm{d} x.$$
Can you solve for $A$ and $B$?
Cheers!
A: $\int \left(\frac{x^2+1}{x^2-1}\right)\,dx=\int( 1+\frac2{x^2-1})dx=x+\ln\left(\frac{x-1}{x+1}\right) + C$
A: You're really close. But before you can apply partial fractions the numerator has to have degree less than the denominator, which is not the case here. In order to fix that, you have to do polynomial long division, like so: $$
\require{enclose}
\begin{array}{rll}
   1\phantom{0000} &&  \\[-3pt]
   x^2-1 \enclose{longdiv}{x^2+1}\kern-.2ex \\[-3pt]
      \underline{x^2-1} &&  \\[-3pt]
      2 &&  \\[-3pt]
  \end{array}
$$
So you get 1 with a remainder of 2, and that gives you $$\frac{x^2+1}{x^2-1}=1+\frac2{x^2-1}$$
Now you are ready to apply partial fractions, as we have the numerator of degree less than the denominator. Like so: $$\frac2{x^2-1}=\frac A{x-1}+\frac B{x+1}=\frac1{x-1}-\frac1{x+1} $$
where A and B turn out to be 1 and -1, respectively.
We can then plug this back into the integral:
$$\int \frac{x^2+1}{x^2-1}dx=\int \left( \frac1{x-1}-\frac1{x+1}+1 \right)dx$$
which becomes $$ln\left(\frac{x-1}{x+1}\right)+x+C$$
