Fix $b \in \R$ and define:  :$\displaystyle \map I a = \int_0^\pi \map \ln {a + b \cos x} \rd x$ for $a \ge \size b$. We have:  {{begin-eqn}} {{eqn	| l = \map {I'} a 	| r = \frac \d {\d a} \int_0^\pi \map \ln {a + b \cos x} \rd x }} {{eqn	| r = \int_0^\pi \frac \partial {\partial a} \paren {\map \ln {a + b \cos x} } \rd x 	| c = Definite Integral of Partial Derivative }} {{eqn	| r = \int_0^\pi \frac 1 {a + b \cos x} \rd x 	| c = Derivative of Natural Logarithm }} {{eqn	| r = \frac 1 2 \int_0^{2 \pi} \frac 1 {a + b \cos x} \rd x 	| c = Definite Integral of Even Function }} {{eqn	| r = \frac \pi {\sqrt {a^2 - b^2} } 	| c = Definite Integral from $0$ to $2 \pi$ of $\dfrac 1 {a + b \cos x}$ }} {{end-eqn}} So, by Primitive of $\sqrt {x^2 - a^2}$: Logarithm Form:  :$\displaystyle \map I a = \pi \map \ln {a + \sqrt {a^2 - b^2} } + C$ for all $a \ge \size b$, for some $C \in \R$. We now split up depending on the sign of $b$.  If $b = 0$, then we have:  {{begin-eqn}} {{eqn	| l = \map I a 	| r = \pi \map \ln {a + \sqrt {a^2} } + C }} {{eqn	| r = \pi \map \ln {a + \size a} + C 	| c = {{Defof|Absolute Value/Definition 2|Absolute Value: Definition 2}} }} {{eqn	| r = \pi \map \ln {2 a} + C 	| c = since $a \ge 0$ }} {{end-eqn}} On the other hand:  {{begin-eqn}} {{eqn	| l = \map I a 	| r = \int_0^\pi \ln a \rd x }} {{eqn	| r = \pi \ln a 	| c = Primitive of Constant }} {{end-eqn}} so, by Sum of Logarithms: :$\pi \ln 2 + \pi \ln a + C = \pi \ln a$ so: :$C = -\pi \ln 2$ giving:  {{begin-eqn}} {{eqn	| l = \displaystyle \int_0^\pi \map \ln {a + b \cos x} \rd x  	| r = \pi \map \ln {a + \sqrt {a^2 - b^2} } - \pi \ln 2 }} {{eqn	| r = \pi \map \ln {\frac {a + \sqrt {a^2 - b^2} } 2} 	| c = Difference of Logarithms }} {{end-eqn}} in the case $b = 0$. Suppose that $b > 0$, then:  {{begin-eqn}} {{eqn	| l = \map I b 	| r = \pi \map \ln {b + \sqrt {b^2 - b^2} } + C }} {{eqn	| r = \pi \ln b + C }} {{end-eqn}} On the other hand: {{begin-eqn}} {{eqn	| l = \map I b 	| r = \int_0^\pi \map \ln {b + b \cos x} \rd x }} {{eqn	| r = \int_0^\pi \ln b \rd x + \int_0^\pi \map \ln {1 + \cos x} \rd x 	| c = Sum of Logarithms }} {{eqn	| r = \pi \ln b + \int_0^\pi \map \ln {2 \cos^2 \frac x 2} \rd x 	| c = Primitive of Constant, Double Angle Formulas: Cosine: Corollary 1 }} {{eqn	| r = \pi \ln b + \int_0^\pi \ln 2 \rd x + 2 \int_0^\pi \map \ln {\cos \frac x 2} \rd x 	| c = Sum of Logarithms, Logarithm of Power }} {{eqn	| r = \pi \ln b + \pi \ln 2 + 4 \int_0^{\frac \pi 2} \map \ln {\cos u} \rd u 	| c = substituting $u = \dfrac x 2$ }} {{eqn	| r = \pi \ln b + \pi \ln 2 - 2 \pi \ln 2 	| c = Definite Integral from $0$ to $\dfrac \pi 2$ of $\map \ln {\cos x}$ }} {{eqn	| r = \pi \ln b - \pi \ln 2 }} {{end-eqn}} giving:  :$C = -\pi \ln 2$ So we have:  :$\displaystyle \int_0^\pi \map \ln {a + b \cos x} \rd x = \pi \map \ln {\frac {a + \sqrt {a^2 - b^2} } 2}$ in the case $b > 0$ too. In the case $b < 0$ we have:  {{begin-eqn}} {{eqn	| l = \map I {\size b} 	| r = \pi \map \ln {\size b + \sqrt {\size b^2 - b^2} } + C }} {{eqn	| r = \pi \map \ln {\size b} + C }} {{end-eqn}} On the other hand: {{begin-eqn}} {{eqn	| l = \map I {\size b} 	| r = \int_0^\pi \map \ln {\size b + b \cos x} \rd x }} {{eqn	| r = \int_0^\pi \map \ln {\size b} \rd x + \int_0^\pi \map \ln {1 + \frac b {\size b} \cos x} \rd x 	| c = Sum of Logarithms }} {{eqn	| r = \pi \ln {\size b} + \int_0^\pi \map \ln {1 - \cos x} \rd x 	| c = since $\dfrac b {\size b} = -1$ for $b < 0$ and using Primitive of Constant }} {{eqn	| r = \pi \ln {\size b} + \int_0^\pi \map \ln {2 \sin^2 \frac x 2} \rd x 	| c = Double Angle Formulas: Cosine: Corollary 2 }} {{eqn	| r = \pi \ln \size b + \int_0^\pi \ln 2 \rd x + \int_0^\pi \map \ln {\sin^2 \frac x 2} \rd x 	| c = Sum of Logarithms }} {{eqn	| r = \pi \ln \size b + \pi \ln 2 + 2 \int_0^\pi \map \ln {\sin \frac x 2} \rd x 	| c = Primitive of Constant, Logarithm of Power }} {{eqn	| r = \pi \ln \size b + \pi \ln 2 + 4 \int_0^{\pi/2} \map \ln {\sin u} \rd u 	| c = substituting $u = \dfrac x 2$ }} {{eqn	| r = \pi \ln \size b + \pi \ln 2 - 2 \pi \ln 2 	| c = Definite Integral from $0$ to $\dfrac \pi 2$ of $\map \ln {\sin x}$ }} {{eqn	| r = \pi \ln \size b - \pi \ln 2 }} {{end-eqn}} We have in this case:  :$C = -\pi \ln 2$ So we have:  :$\displaystyle \int_0^\pi \map \ln {a + b \cos x} \rd x = \pi \map \ln {\frac {a + \sqrt {a^2 - b^2} } 2}$ in the case $b < 0$ too. We've covered all possible values for $b$ so we're done.  {{qed}}