Evaluating $\int_{0}^{\pi}\ln (1+b\cos x)\ \text{d}x$, $b$ is a parameter 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.
 A: \begin{align*}
\frac{\mathrm{d} I(b)}{\mathrm{d} b}=\int_{0}^{\pi}{\cos x\over 1+b\cos x}\; \mathrm{d}x &= \frac{1}{b}\int_0^{\pi} \frac{ 1+b \cos{x}-1}{1+b\cos{x}} \; \mathrm{d}x \\
&= \frac{\pi}{b}-\frac{1}{b} \int_0^{\pi} \frac{1}{1+b \cos{x}} \; \mathrm{d}x\\
&= \frac{\pi}{b}-\frac{2}{b} \int_0^{\infty} \frac{1}{(t^2+1)+b(1-t^2)} \; \mathrm{d}t \tag{1}\\
&= \frac{\pi}{b}-\frac{2}{b} \int_0^{\infty} \frac{1}{(1-b)t^2+(1+b)} \; \mathrm{d}t\\
&= \frac{\pi}{b}-\frac{2}{b} \left(\frac{\pi}{2\sqrt{1-b^2}}\right) \\
&= \frac{\pi}{b}- \frac{\pi}{b\sqrt{1-b^2}} \\
I(b) &= \int \frac{\pi}{b}- \frac{\pi}{b\sqrt{1-b^2}} \; \mathrm{d}b \\
&= \pi \ln|b| + \pi \operatorname{artanh}{\left(\sqrt{1-b^2}\right)}+C \\ I(1)&=-\pi \ln{2} \implies C=-\pi \ln{2}\\
I(b) &= \pi \ln|b| + \pi \operatorname{artanh}{\left(\sqrt{1-b^2}\right)}-\pi \ln{2} \\ 
&= \pi \ln\bigg|\frac{b}{2}\bigg| -\frac{\pi}{2} \ln\left(1-\sqrt{1-b^2}\right)+\frac{\pi}{2}\ln \left(1+\sqrt{1-b^2}\right) \\ 
&= \boxed{\pi \ln\left(\frac{1+\sqrt{1-b^2}}{2}\right)}
\end{align*}
Additionally, note that $-1<b<1$.
$(1):$ Weierstrass substitution
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
$\ds{\bbox[5px,#ffd]{}}$

\begin{align}
&\bbox[5px,#ffd]{\left.\int_{0}^{\pi}
\ln\pars{1 + b\cos\pars{x}}\,\dd x
\,\right\vert_{\ b\ \in\ \pars{-1,1}}}
\\[5mm] = &\
\int_{0}^{\pi/2}\ln\pars{1 + b\cos\pars{x}}\,\dd x
\\[2mm] + &\
\int_{-\pi/2}^{0}\ln\pars{1 - b\cos\pars{x}}\,\dd x
\\[5mm] = &\
\int_{0}^{\pi/2}\ln\pars{1 - b^{2}\cos^{2}\pars{x}}\,\dd x
\\[5mm] = &\
\int_{0}^{\pi/2}\int_{0}^{b^{2}}
{-\cos^{2}\pars{x} \over 1 - y\cos^{2}\pars{x}}\,\dd y\,\dd x
\\[5mm] = &\
\int_{0}^{b^{2}}\int_{0}^{\pi/2}\bracks{%
1 - {1 \over 1 - y\cos^{2}\pars{x}}}\dd x\,{\dd y \over y}
\\[5mm] = &\
\int_{0}^{b^{2}}\bracks{%
{\pi \over 2} - \int_{0}^{\pi/2}{\sec^{2}\pars{x} \over
\sec^{2}\pars{x} - y}\,\dd x}{\dd y \over y}
\\[5mm] = &\
\int_{0}^{b^{2}}\bracks{%
{\pi \over 2} - \int_{0}^{\pi/2}{\sec^{2}\pars{x} \over
\tan^{2}\pars{x} + 1 - y}\,\dd x}{\dd y \over y}
\\[5mm] = &\
\int_{0}^{b^{2}}\left\{%
{\pi \over 2}\right.
\\ & \left.- {1 \over \root{1 - y}}\int_{0}^{\pi/2}\!\!\!\!\!\!\!
{\sec^{2}\pars{x}/\root{1 - y} \over
\bracks{\tan\pars{x}/\root{1 - y}}^{2} + 1}\,\dd x\right\}
{\dd y \over y}
\\[5mm] = &\
{\pi \over 2}
\int_{0}^{b^{2}}
\pars{{1 \over y} - {1 \over y\root{1 - y}}}
\dd y
\\[5mm] & \stackrel{y\ =\ 1 - t^{2}}{=}\,\,\,
\pi\int_{1}^{\root{1 - b^{2}}}
{\dd t \over t + 1}
\\[5mm] = &\
\bbx{\pi\ln\pars{1 + \root{1 - b^{2}} \over 2}} \\ &
\end{align}
A: 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)$$
