TITLE: How do you evaluate the integral $\int\frac{x^2-1}{(x^4+3 x^2+1) \tan^{-1}\left(\frac{x^2+1}{x}\right)}\,dx$?
QUESTION [5 upvotes]: i'm required to evaluate this integral. I've tried factorizing but it doesn't lead me to anywhere. 
$$\int\frac{x^2-1}{(x^4+3 x^2+1) \tan^{-1}\left(\frac{x^2+1}{x}\right)}\,dx$$
I've also tried letting $u = \frac{x^2+1}{x}$, $du/dx$ gets me $1-\frac{1}{x^2}$ but it doesn't seem to be working either.
Hope to receive some advise/ solutions on how to start tackling the question

REPLY [4 votes]: Notice, substitute $\text{u}=\text{f}\left(\text{x}\right)$ and $\text{d}\text{u}=\text{f}\space'\left(\text{x}\right)\space\text{d}\text{x}$:
$$\int\frac{\text{f}\space'\left(\text{x}\right)}{\text{f}\left(\text{x}\right)}\space\text{d}\text{x}=\int\frac{1}{\text{u}}\space\text{d}\text{u}=\ln\left|\text{u}\right|+\text{C}=\ln\left|\text{f}\left(\text{x}\right)\right|+\text{C}$$
Now, when:
$$\text{f}\left(\text{x}\right)=\arctan\left\{x+\frac{1}{x}\right\}$$
And:
$$\text{f}\space'\left(\text{x}\right)=\frac{x^2-1}{x^4+3x^2+1}$$

So, when you want to prove the result:
$$\int\frac{\frac{x^2-1}{x^4+3x^2+1}}{\arctan\left\{x+\frac{1}{x}\right\}}\space\text{d}\text{x}=\int\frac{x^2-1}{\left(x^4+3x^2+1\right)\arctan\left\{x+\frac{1}{x}\right\}}\space\text{d}\text{x}=\ln\left|\arctan\left\{x+\frac{1}{x}\right\}\right|+\text{C}$$