Solve Integration 
$$I = \int\frac{2\sin x+\sin 2x}{(\cos x-1)\sqrt{\cos x+\cos^2x+\cos^3x}}dx$$

I have tried for this question to solve it first I tried to separate the numerator but that doesn't work then i tried for substituting the value in the denominator but still I am not able to convert the whole function in terms of the substituted variable function. So please help me out to solve this problem.

First, use the double angle identity $\sin2x = 2\sin x \cos x$ to get that
$$I = \int\frac{2\sin x + \sin 2x}{(\cos x - 1)\sqrt{\cos x + \cos^2 x + \cos^3 x}}dx$$ $$ = \int \frac{(1+\cos x)(-2\sin x)dx}{(1-\cos x)\sqrt{\cos x + \cos^2 x + \cos^3 x}}$$
Now the tricky part is deciding what substitution to choose. Using the substitution $$\frac{1+\cos x}{1-\cos x} = t\implies \cos x = 1 - \frac{2}{t+1}\implies -\sin x dx = \frac{2}{(t+1)^2}dt$$
we can simplify the integral. @ClaudeLeibovici caught my error in the original simplification of my substitution. The correct simplification is 
$$I = \int \frac{4t}{\sqrt{3t^4-2t^2-1}}dt$$
Complete the square on the inside of the square root:
$$I =\frac{2}{\sqrt{3}} \int \frac{2t}{\sqrt{(t^2-\frac{1}{3})^2-\frac{4}{9}}}dt$$
Now let $$t^2 = \frac{2}{3}\cosh \tau +\frac{1}{3}\implies 2tdt = \frac{2}{3}\sinh \tau d\tau$$ which gives us the integral
$$\frac{2}{\sqrt{3}} \int \frac{\frac{2}{3}\sinh \tau}{\sqrt{\frac{4}{9}\sinh^2\tau}}d\tau = \frac{2}{\sqrt{3}} \int d\tau = \frac{2}{\sqrt{3}}\tau$$
leaving us with an answer of 
$$I = \frac{2}{\sqrt{3}} \cosh^{-1}\left(\frac{3t^2-1}{2}\right)+C$$
Plugging back in for $x$ and utilizing $1-\cos x = 2\sin^2\left(\frac{x}{2}\right)$ we get our final answer:
$$I = \frac{2}{\sqrt{3}} \cosh^{-1}\left(\frac{1+4\cos(x)+\cos^2(x)}{4\sin^4\left(\frac{x}{2}\right)}\right)+C$$
