<s>[INST] How would one go about solving $\int_{0}^{\pi/2} \sqrt{\cos(x)} dx$? Why does the gamma function show up in the answer? Wolfram Alpha says the answer is $\sqrt{\frac{2}{\pi}} \Gamma(\frac{3}{4})^2$, but that just seems so strange. How does an integral with finite bounds relate to a function where one of the bounds is infinity? How would you go about solving this? Any and all help is greatly appreciated!
 [/INST] Substituting $u=\sqrt{\cos(x)}$ and $v=u^4$ gives
$$ \int_0^{\pi/2}\sqrt{\cos(x)}dx=\int_0^1\frac{2u^2}{\sqrt{1-u^4}}du=\frac{1}{2}\int_0^1\frac{v^{-1/4}}{\sqrt{1-v}}dv=\frac{1}{2}\beta\left(\frac{3}{4},\frac{1}{2}\right)=\frac{\Gamma\left(\frac{3}{4}\right)\Gamma\left(\frac{1}{2}\right)}{2\Gamma\left(\frac{5}{4}\right)} $$
But $\Gamma\left(\frac{1}{2}\right)=\sqrt{\pi}$ and $\Gamma\left(\frac{5}{4}\right)\Gamma\left(\frac{3}{4}\right)=\frac{\Gamma\left(\frac{3}{2}\right)}{\sqrt{2}}=\frac{1}{2}\sqrt{\frac{\pi}{2}}$ because of $\Gamma(s)\Gamma\left(s+\frac{1}{2}\right)=2^{1-2s}\Gamma(2s)$ so that
$$ \int_0^{\pi/2}\sqrt{\cos(x)}dx=\sqrt{\frac{2}{\pi}}\Gamma^2\left(\frac{3}{4}\right)$$
</s>