TITLE: How do you integrate the reciprocal of square root of cosine?
QUESTION [7 upvotes]: I encountered this integral in physics and got stuck. 
$$\int_{0}^{\Large\frac{\pi}{2}} \dfrac{d\theta}{\sqrt{\cos \theta}}.$$

REPLY [8 votes]: Another approach:
Consider Beta function
$$
\text{B}(x,y)=2\int_0^{\Large\frac\pi2}(\sin\theta)^{2x-1}(\cos\theta)^{2y-1}\ d\theta=\frac{\Gamma(x)\cdot\Gamma(y)}{\Gamma(x+y)}.
$$
Rewrite
$$
\int_0^{\Large\frac\pi2}\frac{d\theta}{\sqrt{\cos\theta}}=\frac12\cdot2\int_0^{\Large\frac\pi2}\cos^{\Large-\frac12}\theta\ d\theta,
$$
then
\begin{align}
\int_0^{\Large\frac\pi2}\frac{d\theta}{\sqrt{\cos\theta}}&=\frac12\cdot\frac{\Gamma\left(\dfrac12\right)\cdot\Gamma\left(\dfrac14\right)}{\Gamma\left(\dfrac34\right)}\\
&=\frac12\cdot\frac{\sqrt{\pi}\cdot\Gamma^2\left(\dfrac14\right)}{\Gamma\left(\dfrac34\right)\cdot\Gamma\left(\dfrac14\right)}\tag1\\
&=\frac{\sqrt{\pi}}2\cdot\frac{\Gamma^2\left(\dfrac14\right)}{\dfrac{\pi}{\sin\dfrac\pi4}}\tag2\\
&=\color{blue}{\frac{\Gamma^2\left(\dfrac14\right)}{2\sqrt{2\pi}}\approx2.62205755}.
\end{align}

Note :
$\color{red}{(1)}\ \ $ $\Gamma\left(\dfrac12\right)=\sqrt\pi$ and multiply by $\frac{\Gamma\left(\dfrac14\right)}{\Gamma\left(\dfrac14\right)}$
$\color{red}{(2)}\ \ $ Euler's reflection formula for the Gamma function: $\Gamma(z)\cdot\Gamma(1-z)=\dfrac{\pi}{\sin\pi z}$.