I'm trying to find the primitive to this function $\int \text{arccot}(x+{1\over x})\,dx$. I have used partial integration $\int fg = Fg - \int Fg'$ to solve it but I get the wrong answer:
I substituted $t=(x+{1\over x})$ and made the math but my answer $$x\text{ arccot}\left(x+{1\over x}\right) - \arctan\left({x\over x^2+1}\right)+C$$ is not correct.
With integration by parts, you get $$ x\operatorname{arccot}\left(x+\frac{1}{x}\right) +\int x\frac{1}{1+(x+1/x)^2}\left(1-\frac{1}{x^2}\right)\,dx $$ and the remaining integral is, after simplifications, $$ \int\frac{x^2-1}{x(x^4+3x^2+1)}\,dx $$ which just takes patience. The denominator factors as $$ x(x^2+\alpha)(x^2+\beta), \qquad \alpha=\frac{3-\sqrt{5}}{2},\ \beta=\frac{3+\sqrt{5}}{2} $$ and partial fractions allow us to write $$ \frac{x^2-1}{x(x^4+3x^2+1)}= \frac{A}{x}+\frac{Bx+C}{x^2+\alpha}+\frac{Dx+E}{x^2+\beta} $$ None of the remaining steps is difficult.