TITLE: Evaluating $\int_{0}^{\pi}\ln (1+b\cos x)\ \text{d}x$, $b$ is a parameter
QUESTION [5 upvotes]: Evaluating $\int_{0}^{\pi}\ln (1+b\cos x)\ \text{d}x$ where $b$ is a parameter
I've tried Integration by parts which yield $$\int_{0}^{\pi}\ln (1+b\cos x)\ \text{d}x=\pi\ln(1-b)+b\int_{0}^{\pi}{x\sin x\over 1+b\cos x}\text{d}x$$ I cannot figure out what do next.
I also tried using Leibniz integral rule by putting $I(b)=\int_{0}^{\pi}\ln (1+b\cos x)\ \text{d}x$ to form a differential equation.
$${\text{d}I(b)\over \text{d}b}=\int_{0}^{\pi}{\cos x\over 1+b\cos x}\text{d}x$$ but I'm not able to solve the integral on right.
I've looked similar questions like this one Evaluating $\int_{0}^{\pi}\ln (1+\cos x)\, dx$ to no avail. Also I'm high school student so I don't understand advanced calculus stuff yet.

REPLY [2 votes]: Since $$\mathcal{I}=\int_0^{\pi}\ln(1+b\cos x)dx =\int_0^{\frac{\pi}{2}}\ln(1-b^2\cos^2 x)dx$$ See Flexin Marin and  for all  $b\in\mathbb(0,1)$ we notice $-1< b\cos x <1$ we use the series for $\ln(1-x)$, giving us. $$\mathcal{I}=-\sum_{p=1}^{\infty}\frac{1}{p}\int_0^{\frac{\pi}{\color{red}{2}}}b^{2p}\cos^{2p}x dx$$Latter integral we have Wallis integral which  further reduces to $$\mathcal{I}=-\frac{\pi}{2}\sum_{p=1}^{\infty}\frac{ b^{2p}}{2^{2p}p}{2n\choose n}$$ Since the generating function of central binomial coefficients is given as $$\sum_{p=0}^{\infty}{2p\choose p}x^p=\frac{1}{\sqrt{1-4x}}, \; \; |p|< 1/4$$  Divide by $x$ and hence on integrating from  $ 0$ to $\frac{b^2}{4}$ we have $$\sum_{p=1}^{\infty}\frac{b^{2p}}{2^{2p}}{2p\choose p}=\int_0^{-\frac{b^2}{4}}\left(\frac{1}{x\sqrt{1-4x}}-\frac{1}{x}\right)dx=-2\log\left(1+\sqrt{1-4x}\right)\Bigg|_0^{\frac{b^2}{4}}=2\left(\log 2-\log(1+\sqrt{1-b^2})\right)$$ hence $$\mathcal{I}={\pi}\log\left(\frac{1+\sqrt{1-b^2}}{2}\right)$$