Integral with inverse trigonometric function How do I integrate $$\int \cot^{-1}\sqrt{x^2+x+1}\ dx$$
I don't understand how to proceed?
I did try the question using integration by parts, but it didn’t help.
 A: If $f(t)=\operatorname{arccot}t$, then
$$
f'(t)=-\frac{1}{1+t^2}
$$
so after integration by parts you get
$$
x\operatorname{arccot}\sqrt{x^2+x+1}+
\int x\frac{1}{x^2+x+2}\frac{2x+1}{2\sqrt{x^2+x+1}}\,dx
$$
For the remaining integral, consider the curve $y=\sqrt{x^2+x+1}$, that's a branch of $x^2-y^2+x+1=0$. This is a hyperbola, which can be put in normal form by completing the square:
$$
\left(x+\frac{1}{2}\right)^2-y^2+\frac{3}{4}=0
$$
or
$$
-\frac{(x+1/2)^2}{(\sqrt{3}/2)^2}+\frac{y^2}{(\sqrt{3}/2)^2}=1
$$
The correct substitution is thus
$$
y=\frac{\sqrt{3}}{2}\cosh u
\qquad
x=\frac{\sqrt{3}}{2}\sinh u-\frac{1}{2}
$$
that will bring the function into a rational function of $e^u$, which is essentially elementary: set $e^u=v$ and use partial fractions.
A: A solution without using hyperbolic functions
Integration by parts gives 
$$x\cot^{-1}\left( \sqrt{x^2+x+1} \right)+\frac{1}{2}\int \frac{x(2x+1)}{\sqrt{x^2+x+1}(x^2+x+2)}\,dx$$
i can split the integrated on the right as
$$
\begin{align}
  & =2\int{\frac{1}{\sqrt{{{x}^{2}}+x+1}}dx}-\int{\frac{1+2x}{2\sqrt{{{x}^{2}}+x+1}\left( {{x}^{2}}+x+2 \right)}dx}-\frac{7}{2}\int{\frac{1}{\sqrt{1+x+{{x}^{2}}}\left( {{x}^{2}}+x+2 \right)}dx} \\ 
 & =2A-B-\frac{7}{2}C \\ 
\end{align}
$$
to calculate $A$  notice that ${{x}^{2}}+x+1={{\left( x+\frac{1}{2} \right)}^{2}}+{{\left( \frac{\sqrt{3}}{2} \right)}^{2}}$ and using $x+\frac{1}{2}=\frac{\sqrt{3}}{2}u$
$$A=\int{\frac{1}{\sqrt{{{u}^{2}}+1}}du}=\ln \left( u+\sqrt{{{u}^{2}}+1} \right)=\ln \left( \frac{2x+1}{\sqrt{3}}+\sqrt{{{\left( \frac{2x+1}{\sqrt{3}} \right)}^{2}}+1} \right)$$
that’s because i accept the fact that  ${{\left( \ln \left( u+\sqrt{{{u}^{2}}+1} \right) \right)}^{\prime }}=\frac{1}{\sqrt{{{u}^{2}}+1}}$
for $B$ we have
$$\frac{1+2x}{2\sqrt{1+x+{{x}^{2}}}\left( 2+x+{{x}^{2}} \right)}=\frac{{{\left( \sqrt{1+x+{{x}^{2}}} \right)}^{\prime }}}{\left( 1+{{\left( \sqrt{1+x+{{x}^{2}}} \right)}^{2}} \right)}\Rightarrow B={{\tan }^{-1}}\left( \sqrt{1+x+{{x}^{2}}} \right)$$
for $C$ use $u=\frac{2x+1}{\sqrt{{{x}^{2}}+x+1}}$ hence $du=\frac{3}{2{{\left( \sqrt{{{x}^{2}}+x+1} \right)}^{3}}}dx$ also 
$${{u}^{2}}-7=\frac{4{{x}^{2}}+4x+1}{{{x}^{2}}+x+1}-\frac{7{{x}^{2}}+7x+7}{{{x}^{2}}+x+1}=\frac{-3{{x}^{2}}-3x-6}{{{x}^{2}}+x+1}=-3\left( \frac{{{x}^{2}}+x+2}{{{x}^{2}}+x+1} \right)$$
$$\begin{align}
  & C=\frac{2}{3}\int{\frac{1}{\sqrt{{{x}^{2}}+x+1}\left( {{x}^{2}}+x+2 \right)}{{\left( \sqrt{{{x}^{2}}+x+1} \right)}^{3}}du} \\ 
 & \quad =\frac{2}{3}\int{\frac{{{x}^{2}}+x+1}{{{x}^{2}}+x+2}du} \\ 
 & \quad =-2\int{\frac{1}{{{u}^{2}}-7}du}=\frac{1}{\sqrt{7}}\ln \left( \frac{\sqrt{7}+u}{\sqrt{7}-u} \right)=\frac{1}{\sqrt{7}}\ln \left( \frac{\sqrt{7}+\frac{2x+1}{\sqrt{{{x}^{2}}+x+1}}}{\sqrt{7}-\frac{2x+1}{\sqrt{{{x}^{2}}+x+1}}} \right) \\ 
\end{align}$$
finally,
$$
\int \cot^{-1}\left( \sqrt{x^2+x+1} \right) \, dx=x\cot^{-1}\left( \sqrt{{{x}^{2}}+x+1} \right)+\ln \left( \frac{2x+1}{\sqrt{3}}+\sqrt{{{\left( \frac{2x+1}{\sqrt{3}} \right)}^{2}}+1} \right)-\frac{1}{2}{{\tan }^{-1}}\left( \sqrt{1+x+{{x}^{2}}} \right)-\frac{\sqrt{7}}{4}\ln \left( \frac{\sqrt{7}+\frac{2x+1}{\sqrt{{{x}^{2}}+x+1}}}{\sqrt{7}-\frac{2x+1}{\sqrt{{{x}^{2}}+x+1}}} \right)
$$
