Trigonometric irrational integral I've tried to solve the following integral:
$$ \int \frac{\sin{x}}{\cos{x}\sqrt{\cos^2{x}+\cos{x}+1}} dx $$
But I don't know what do do after the following substitution:
$$ u=\cos{x} $$
$$ -\int \frac{1}{u\sqrt{u^2+u+1}} du $$
Could you help me? Thanks in advance!
 A: \begin{aligned}\int{\frac{\mathrm{d}u}{u\sqrt{u^{2}+u+1}}}&=\int{\frac{\mathrm{d}u}{u\sqrt{\left(u+\frac{1}{2}\right)^{2}+\frac{3}{4}}}}\\ &=\int{\frac{\frac{2}{\sqrt{3}}\,\mathrm{d}u}{u\sqrt{1+\left(\frac{2u+1}{\sqrt{3}}\right)^{2}}}}\\ &=2\int{\frac{\mathrm{d}y}{\left(\sqrt{3}y-1\right)\sqrt{1+y^{2}}}}\\ &=2\int{\frac{\mathrm{d}\varphi}{\sqrt{3}\sinh{\varphi}-1}}\end{aligned}
Can you continue from here ?
A: Substitute $u+\frac12=\frac{\sqrt3}2\tan t$
\begin{aligned}
&\int{\frac{1}{u\sqrt{u^{2}+u+1}}}du\\
=& -\int{\frac{1}{\cos(t+\frac\pi3)}}dt
= -\int\frac{d\left[\sin(t+\frac\pi3) \right]}{1-\sin^2(t+\frac\pi3) }\\
=&\ \frac12\ln\frac{1-\sin(t+\frac\pi3)}{1+\sin(t+\frac\pi3)}
= \frac12\ln \frac{\sqrt{u^{2}+u+1}-\frac12u-1}{\sqrt{u^{2}+u+1}+\frac12u+1} \\
\end{aligned}
A: Continuing from your $u$-integral, substitute
$$t = \frac{\sqrt{u^2+u+1}-1}u \implies u = \frac{2t-1}{1-t^2} \implies du = \frac{2(t^2-t+1)}{(1-t^2)^2} \, dt$$
so that
$$- \int \frac{du}{u\sqrt{u^2+u+1}} = - \int \frac{1-t^2}{(2t-1)\left(\frac{2t^2-t}{1-t^2}+1\right)} \, \frac{2(t^2-t+1)}{(1-t^2)^2} \,dt = -2 \int \frac{dt}{2t-1}$$
