<s>[INST] Assistance with solving the integral Can you give me an idea how to handle this integral?
$\int_{0}^{2\pi} (1+\cos{x})\sqrt{3+\cos{x}}\,dx$
 [/INST] Since $1 - \cos(x) = 2 \sin^2\left(\frac{x}{2} \right) $ then
\begin{align}
\int_{0}^{2\pi} (1+\cos{x})\sqrt{3+\cos{x}}\, \mathrm{d}x & \overset{u= x -\pi}{=} 2\int_{0}^{\pi}2 \sin^2\left(\frac{u}{2} \right) \sqrt{2+2\sin^2\left(\frac{u}{2} \right)}\, \mathrm{d}u \\
& \overset{t = \frac{u}{2}}{=} 8 \sqrt{2} \int_0^{\frac{\pi}{2}} \sin^2(t) \sqrt{1 + \sin^2(t)}\, \mathrm{d}t\\
\end{align}
And from this answer we know
$$
\int_0^{\frac{\pi}{2}} \sin^2\theta \sqrt{1-k^2\sin^2 \theta}\, \mathrm{d}\theta = \frac{(1-k^2)K(k)-(1-2k^2)E(k)}{3k^2}
$$
So with $k=i$ you get
$$
\int_{0}^{2\pi} (1+\cos{x})\sqrt{3+\cos{x}}\, \mathrm{d}x  =8 \sqrt{2} E(i) - \frac{16 \sqrt{2}}{3} K(i)
$$
</s>