The question is to compute a definite integral below. I have expressed it as a series expansion in powers of $r$ by expanding the integrand in a series and integrating term by term. Then I input the series into Mathematica and Mathematica returned the neat closed form expression in the last line.
I do not understand how this last closed form expression is obtained. Could anybody enlighten me on that? Thanks. \begin{eqnarray} \int\limits_0^{2 \pi} \log\left( 1+r \sin(\phi)\right) d \phi = \\ \sum\limits_{n=1}^\infty \frac{(-1)^{n+1}}{n} r^n \left(1+(-1)^n\right) \frac{\Gamma(1/2) \Gamma(\frac{1+n}{2})}{\Gamma(1+\frac{n}{2})}=\\ 2 \pi \log\left[\frac{1}{2} \left(1+\sqrt{1-r^2}\right)\right] \end{eqnarray}