How to find $\int_0^{2\pi}\log(\alpha+\beta\cos(x))\mathrm{d}x$ Is there a closed-form formula for the following integral
$$
\int_0^{2\pi}\log(\alpha+\beta\cos(x))\mathrm{d}x
$$
where $\alpha$ and $\beta$ are constants which assure that $\alpha+\beta\cos(x)>0$ for any $x\in[0,2\pi]$.
 A: $$I-2\pi\ln(\alpha)=\int_0^{2\pi}\ln(1+s\cos(x))dx=-\int_0^{2\pi}\sum_{k=1}^\infty\frac{(-s)^k\cos^k(x)}kdx\\
=-\pi\sum_{k=1}^\infty\frac1{k4^k}\binom{2k}ks^{2k},$$ where $s=\frac\beta\alpha$, $|s|<1$.
A: $$I(\alpha,\,\beta)=\int_0^{2\pi}\ln(\alpha+\beta\cos x)\mathrm dx.\tag1$$ We have $\alpha>\beta\geq0$. Since from (1) 
$$\frac{\partial I}{\partial\alpha}=\int_0^{2\pi}\frac{1}{\alpha+\beta\cos x}\mathrm dx=\frac{2\pi}{\sqrt{\alpha^2-\beta^2}}$$
we can integrate with respect to $\alpha$
$$I(\alpha,\beta)=2\pi\ln\left(\alpha+\sqrt{\alpha^2-\beta^2}\right)+C(\beta)\tag 2$$
Now using (1) again
$$\frac{\partial I}{\partial\beta}=\int_0^{2\pi}\frac{\cos x}{\alpha+\beta\cos x}\mathrm dx=\frac{2\pi}\beta\frac{-\alpha+\sqrt{\alpha^2-\beta^2}}{\sqrt{\alpha^2-\beta^2}}=\frac{-2\pi\beta}{\sqrt{\alpha^2-\beta^2}\left(\alpha+\sqrt{\alpha^2-\beta^2}\right)}$$
on the one hand, and derivating (2) with respect to $\beta$
$$\frac{\partial I}{\partial\beta}=\frac{-2\pi\beta}{\sqrt{\alpha^2-\beta^2}\left(\alpha+\sqrt{\alpha^2-\beta^2}\right)}+C'(\beta)$$
we conclude that $C'(\beta)=0$. Now we use the value $I(\alpha,0)=2\pi\ln \alpha=2\pi\ln(2\alpha)+C(0)$ so we get
$$I(\alpha,\beta)=2\pi\ln\left(\alpha+\sqrt{\alpha^2-\beta^2}\right)-2\pi
\ln2.$$
Note
To compute the integral, I used the exponential decomposition of $\cos$
$$\frac{\partial I}{\partial\alpha}=
  \int_0^{2\pi}\frac{1}{\alpha+\beta\cos x}\mathrm dx=
  \int_0^{2\pi}\frac{2\mathrm e^{\mathrm ix}}{2\alpha\mathrm e^{\mathrm ix}+\beta\mathrm e^{2\mathrm ix}+\beta}\mathrm dx$$
The I wrote this integral as a contour integral
$$\frac{\partial I}{\partial\alpha}=-2\mathrm i\oint_{\mathcal C(0,1)}\frac{\mathrm dz}{\beta z^2+2\alpha z+\beta}.$$
Since $$\beta z^2+2\alpha z+\beta=\beta\left(z+\frac{\alpha+\sqrt{\alpha^2-\beta^2}}{\beta}\right)\left(z+\frac{\alpha-\sqrt{\alpha^2-\beta^2}}{\beta}\right)=\beta(z-z_+)(z-z_-)$$
one can use the residue theorem. There is only one residue inside the unit disc (because $z_+z_-=1$), at $z_-= -(\alpha-\sqrt{\alpha^2-\beta^2})/\beta$ and the result is 
$$\frac{\partial I}{\partial\alpha}=-2\mathrm i\frac{2\pi \mathrm i}{\beta(z_--z_+)}=\frac{2\pi}{\sqrt{\alpha^2-\beta^2}}.$$
The integral $\frac{\partial I}{\partial\beta}$ is obtained in the same way,
we get 
$$\frac{\partial I}{\partial\beta}=-\mathrm i\oint_{\mathcal C(0,1)}\frac{z+z^{-1}}{\beta z^2+2\alpha z+\beta}\mathrm dz=-\mathrm i\frac{2\pi\mathrm i(z_-+z_-^{-1})}{\beta(z_--z_+)}-\mathrm i\frac{2\pi\mathrm i}\beta=\frac{2\pi}{\beta}\frac{-\alpha+\sqrt{\alpha^2-\beta^2}}{\sqrt{\alpha^2-\beta^2}}$$
beacuse there is a second pole at $z=0$. 
A: Let's try the famous Feynman's trick!
Let $I(\beta)$ be your integral. Then$$I'(\beta)=\int^{2\pi}_0 \frac{\cos x }{\alpha+\beta\cos x}\mathrm{d} x. $$
Using the $t$-substitution $t=\tan x/2$, we will get 
$$I'(\beta)=\frac {2\pi} {\beta} -\frac{2\alpha\pi}{\beta\sqrt{\alpha^2-\beta^2}}.$$
Integrating it, $$I(\beta)=2\pi\log\beta+2\pi\alpha\operatorname{sech}^{-1}\frac{\beta}{\alpha}+C.$$
