$$ \int_0^{\frac\pi{2}}\frac {\cos\left((1-2n)\arcsin\left(\frac{\sin(\theta)}{\sqrt 2}\right)\right)}{\sqrt{1-\frac{\sin^2 \theta}{2}}}d\theta $$

Crazy Integral

Question

$$\int_0^{\frac\pi{2}}\frac {\cos\left((1-2n)\arcsin\left(\frac{\sin(\theta)}{\sqrt 2}\right)\right)}{\sqrt{(1-\frac{\sin^2 \theta}{2})}}d\theta$$

I tried using some sort of substitutions but I think this must have some other way to solve and gave me another different integral and gamma functions and all, which now I'm uncertain if it's my cup of tea!

Answer

$$\begin{align*} \int_0^{\frac\pi{2}}\frac {\cos\left((1-2n)\arcsin\left(\frac{\sin(\theta)}{\sqrt 2}\right)\right)}{\sqrt{(1-\frac{\sin^2 \theta}{2})}}d\theta & = \frac{\pi}{2}{_2F_1}{(1-n, n;1;\frac 1{2})}\\ & = \frac {\pi}{2}\frac {\sqrt \pi}{\Gamma(1-\frac n{2})\Gamma(\frac 1{2} + \frac n{2})}\\ & = \frac {\pi}{2}P_{-n}(1-2x)|_{x = \frac 1{2}}\\ \end{align*}$$


In reply to the comment:

$$\left|\int_0^{\sin^{-1}\sqrt x} \frac {\cos\left((1-2n)\phi\right)}{\sqrt{(x-\sin^2\phi)}}d\phi = \frac {\pi}{2}{_2F_1}(1-n,n;1;x)\right|_{x = \frac 1{2}}$$


Another way to look at the solution

$$(1-y^2)^{-1/2}\cos(2n\sin^{-1} y) ={_2F_1}(\frac 1{2}+n, \frac 1{2}-n;\frac 1{2};y^2)$$

$(y, 2n) ≡ (\sqrt x \sin \theta, 1-2n)$ & integrating w.r.t $\theta$ over $(0, \pi/2)$