TITLE: Is there a way to integrate $ \int_{0}^{2\pi}\frac{(\cos (t/2))^2 \sqrt{1+\sin t}}{(1+\sin t+K)^{3/2}}\,d t$ by hand?
QUESTION [7 upvotes]: I came across the following integral
$$
\int_{0}^{2\pi}\frac{(\cos (t/2))^2 \sqrt{1+\sin t}}{(1+\sin t+K)^{3/2}}\,d t\tag1
$$
where $K>0$ is a constant. I don't see a way to handle this integral, however Wolfram Mathematica gives an exact answer for it symbolic computation, so it must be a way to solve it. With the change of variable $e^{it}=z$ I get
$$
\begin{align*}
(\cos (t/2))^2&=\frac1{4}(z^{1/2}+z^{-1/2})^2=\frac1{4}(z+z^{-1}+2)=\frac{(z+1)^2}{4z}\\
\sqrt{1+\sin t}&=\left(1+\frac{z-z^{-1}}{2i}\right)^{1/2}=\frac {z+i}{(2iz)^{1/2}}\\
(1+K+\sin t)^{3/2}&=\left(K+\frac{(z+i)^2}{2iz}\right)^{3/2}\\
dz&=d(e^{it})=ie^{it}dt\implies dt=-iz^{-1}dz
\end{align*}\tag2
$$
Therefore
$$
\mathrm{(1)}=\frac1{2}\oint (z+1)^2(z+i)z^{-1}(2izK+(z+i)^2)^{-3/2}\,d z\tag3 
$$
However $(2izK+(z+i)^2)^{-3/2}$ is not analytic in a neighborhood of zero, so I cannot use residue theorem here. Someone have some idea to try to tackle this?

REPLY [11 votes]: The integral evaluates to
$$
I=\int_{0}^{2\pi}\frac{\cos^2\frac t2\sqrt{1+\sin t}}{(1+\sin t+K)^{3/2}}\,d t=\frac{2\sqrt2}{\sqrt {K} (K+2)}
$$
as shown below. Substitute $t=2y+\frac\pi2$
\begin{align}
I &= 2\sqrt2 \int_{-\frac\pi4}^{\frac{3\pi}4}
\frac{\cos^2(y+\frac\pi4)|\cos y|}{(2\cos^2y+K)^{3/2}} dy\\
&= 2\sqrt2 \left( \int_{-\frac\pi4}^{\frac{\pi}2}-\int_{\frac\pi2}^{\frac{3\pi}4}\right)
\frac{\cos^2(y+\frac\pi4)\cos y}{(2\cos^2y+K)^{3/2}} dy\\
 &=\sqrt2 \left( \int_{-\frac\pi4}^{\frac{\pi}2}-\int_{\frac\pi2}^{\frac{3\pi}4}\right)
\frac{\cos y -2\cos^2y\sin y}{(2\cos^2y+K)^{3/2}} dy\\
 &=\sqrt2 \left( \int_{-\frac\pi4}^{\frac{\pi}2}-\int_{\frac\pi2}^{\frac{3\pi}4}\right)
\frac{\cos y }{(2\cos^2y+K)^{3/2}} dy \\
 &=\sqrt2 \int_{-\frac\pi2}^{\frac{\pi}2}
\frac{\cos y }{(2\cos^2y+K)^{3/2}} dy = \frac{2\sqrt2}{\sqrt {K} (K+2)}
\end{align}