Evaluate the integral $\int \frac{x^2 + 1}{x^4 + x^2 +1} dx$ Evaluate the integral $\int \frac{x^2 + 1}{x^4 + x^2 +1} dx$
The book hint is:
Take $u = x- (1/x)$ but still I do not understand why this hint works, could anyone explain to me the intuition behind this hint?
The book answer is:

 

 A: *

*Take $x^2$ common out from numerator and denominator. Then your fraction becomes $$\frac{1+\frac{1}{x^2}}{x^{2}+\frac{1}{x^2}+1}$$ Now write $x^{2}+\frac{1}{x^2} = (x-\frac{1}{x})^{2}+2$
A: It turns out that we must compute the integral in the following way:
$$I=\int\frac{x^2+1}{x^4+x^2+1}\mathrm{d}x$$
$$I=\int\frac{x^2+1}{(x^2-x+1)(x^2+x+1)}\mathrm{d}x$$
After a fraction decomposition, 
$$I=\frac12\int\frac{\mathrm{d}x}{x^2+x+1}+\frac12\int\frac{\mathrm{d}x}{x^2-x+1}$$
Now we focus on 
$$I_1=\int\frac{\mathrm{d}x}{x^2+x+1}$$
Completing the square in the denominator produces 
$$I_1=\int\frac{\mathrm{d}x}{(x+\frac12)^2+\frac34}$$
Then the substitution $u=\frac1{\sqrt{3}}(2x+1)$ gives 
$$I_1=\frac2{\sqrt{3}}\int\frac{\mathrm{d}u}{u^2+1}$$
$$I_1=\frac2{\sqrt{3}}\arctan\frac{2x+1}{\sqrt{3}}$$
Similarly, 
$$I_2=\int\frac{\mathrm{d}x}{x^2-x+1}$$
$$I_2=\int\frac{\mathrm{d}x}{(x-\frac12)^2+\frac34}$$
And the substitution $u=x-\frac12$ carries us to 
$$I_2=\frac2{\sqrt{3}}\arctan\frac{2x-1}{\sqrt{3}}$$
Plugging in:
$$I=\frac1{\sqrt{3}}\bigg(\arctan\frac{2x+1}{\sqrt{3}}+\arctan\frac{2x-1}{\sqrt{3}}\bigg)+C$$
Which is confusing, because nowhere did we use the suggested substitution. Furthermore, using the suggested substitution produces 
$$I=\int\frac{\mathrm{d}u}{u^2+3}$$
Which is easily shown to be 
$$I=\frac1{\sqrt{3}}\arctan\frac{x^2+1}{x\sqrt{3}}$$
But apparently that is incorrect. I am really unsure how this is the case. Try asking your teacher.
