Evaluate the indefinite integral $\int \frac{\sin^3\frac\theta 2}{\cos\frac\theta2 \sqrt{\cos^3\theta + \cos^2\theta + \cos\theta}} d\theta$

Use $s = \frac{t-1}{t+1} \implies t = \frac{1+s}{1-s}$

$$I = \frac{1}{2}\int \frac{2s}{\sqrt{3-2s^2-s^4}}\:ds = \frac{1}{2}\int\frac{2s}{\sqrt{4-(s^2+1)^2}}\:ds = \frac{1}{2}\sin^{-1}\left(\frac{s^2+1}{2}\right)$$

Then keep reversing the substitutions

$$I = \frac{1}{2}\sin^{-1}\left(\frac{\left(\frac{t-1}{t+1}\right)^2+1}{2}\right) = \frac{1}{2}\sin^{-1}\left(\frac{t^2+1}{(t+1)^2}\right)$$

$$\implies I = \frac{1}{2}\sin^{-1}\left[\frac{1}{4}\sec^4\left(\frac{\theta}{2}\right)-\tan^2\left(\frac{\theta}{2}\right)\right]+C$$


Set $\sqrt t=y,t=y^2,dt=2y\ dy$

$$I =\int\dfrac{(y^2-1)2y}{(y^2+1)y\sqrt{y^2(y^4+y^2+1)}}dy$$

$$=2\int\dfrac{1-1/y^2}{(y+1/y)\sqrt{y^2+1+1/y^2}}dy$$

Set $\int(1-1/y^2)dy =z$

Then $\sqrt{z^2+1}=u\implies z^2+1=u^2$