<s>[INST] 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$ $$\int \frac{\sin^3\frac\theta 2}{\cos\frac\theta2 \sqrt{\cos^3\theta + \cos^2\theta + \cos\theta}} d\theta$$
My Attempt:
$$I = \int \frac{\sin^2\frac\theta2\cdot\sin\frac\theta2\cos\frac\theta2}{\cos^2\frac\theta2 \sqrt{\cos^3\theta + \cos^2\theta + \cos\theta}} 
d\theta \\ = \frac12 \int \frac{(1-\cos\theta)\sin\theta}{(1+\cos\theta)\sqrt{\cos^3\theta + \cos^2\theta + \cos\theta}} 
d\theta$$
$$\text{let }\cos\theta = t \implies -\sin\theta d\theta = dt$$
$$I = \frac12 \int \frac{t-1}{(t+1) \sqrt{ t^3+t^2+t } } dt $$
I am not sure how to proceed further from here. Any hints/solutions on how to resolve the cubic expression under the square root?
 [/INST] 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$
</s>