I'm trying to self-study calculus of variation, and while solving a physics problem of cycloid motion I have encountered an integral I don't know how to fully solve. I know from the textbook the final answer should be $\pi \sqrt\frac{a}{g}$ but I get nowhere near:
$$t = \sqrt{\frac{a}{g}} \int_{\theta_0}^{\pi} \sqrt{\frac{1-\cos\theta}{\cos\theta_0 - \cos\theta}} \, \mathrm{d}\theta $$
I changed variable to $\theta = \pi -2\alpha$:
$$t = \sqrt{\frac{a}{g}} \int_{\frac{\pi-\theta_0}{2}}^{0} \sqrt{\frac{1+\cos(2\alpha)}{\cos\theta_0 + \cos(2\alpha)}} \, (-2\mathrm{d}\alpha)$$
Now using $\cos(2\alpha) = 2\cos^2\alpha -1$ and $\cos(2\alpha) = 1-2\sin^2\alpha$ I got:
$$t = \sqrt{\frac{a}{g}} \int_{\frac{\pi-\theta_0}{2}}^{0} \frac{\cos\alpha}{\sqrt{\cos\theta_0 + 1 - 2\sin^2\alpha }} \, (-2\mathrm{d}\alpha)$$
Now I changed variable $u = \sin\alpha$:
$$t = -2\sqrt{\frac{a}{g}} \int_{\sin\left(\frac{\pi-\theta_0}{2}\right)}^{0} \frac{\mathrm{d}u}{\sqrt{\cos\theta_0 + 1 - 2u^2 }}$$
Trying to get an $\operatorname{arcosh}$ won't help me I guess, How do I proceed? Thanks alot!
Without checking all the details, your steps seem correct.
Now, the integral at the very end is of the form $$\int\frac{1}{\sqrt{a^2-b^2x^2}}\,dx$$ which you can compute via a simple substitution using the tabulated integral $$\int\frac{1}{\sqrt{1-x^2}}\,dx=\arcsin(x)+C$$