TITLE: Evaluation of $ \int_{0}^{\pi}\ln(5-4\cos x)\,dx$
QUESTION [6 upvotes]: Evaluation of $\displaystyle \int_{0}^{\pi}\ln(5-4\cos x)dx = \int_{0}^{\pi}\ln(5+4\cos x)dx$

$\bf{My\; Try::}$ Let $\displaystyle I(a,b) = \int_{0}^{\pi}\ln(a+b\cos x)dx$
Then $$\frac{d}{db}(a,b) = \frac{d}{db}\left[\int_{0}^{\pi}\ln(a+b\cos x)dx\right]db$$
So $$I'(a,b) = \int_{0}^{\pi}\frac{\cos x}{a+b\cos x}dx = \frac{1}{b}\int_{0}^{\pi}\frac{(a+b\cos x)-a}{a+b\cos x}dx$$
So we get $$I'(a,b) = \frac{\pi}{b}-\frac{a}{b}\int_{0}^{\pi}\frac{1}{a+\cos x}dx$$
Using half angle formula $\displaystyle \tan x = \frac{1-\tan^2 x/2}{1+\tan^2 x/2}$
so we get $$I'(a,b) = \frac{\pi}{b}-\frac{a}{b}\int_{0}^{\pi}\frac{\sec^2 x/2}{(a+b)+(a-b)\tan^2 x/2}dx$$
Now Put $\tan x/2= t\; $ Then $\displaystyle \sec^2 \frac{x}{2}dx = 2dt$
So we get $$I'(a,b) = \frac{\pi}{b}-\int_{0}^{\infty}\frac{1}{(a+b)+(a-b)t^2}=\frac{\pi}{b}-\frac{a\pi}{2b\sqrt{a^2-b^2}}$$
So we get $$I(a,b) = \pi\ln|b|-\frac{\pi a}{2}\left[-\frac{\ln|b^2-a^2|+2\ln |b|}{2a^2}\right]$$
So we put $a = 5$ and $b=4$
We get $$I(5,4) = \pi\cdot \ln (5)-\frac{\pi}{2}\left[\frac{-\ln(9)+2\ln(5)}{2\cdot 5}\right]$$
So We get $$I(5,4) = \left[\frac{18\ln(5)+\ln(9)}{20}\right]\cdot \pi$$
I did not understand where i have done mistake, Help me
Thanks

REPLY [2 votes]: This approach seems really good, but the first mistake was in
$$\int_0^{\pi}\frac1{a+b\cos x}dx=\frac1a\int_0^{\pi}\frac1{1+e\cos x}dx$$
Where $e=\frac ba$. If you used the eccentric anomaly at this point,
$$\sin E=\frac{\sqrt{1-e^2}\sin x}{1+e\cos x}$$
So that $$dE=\frac{\sqrt{1-e^2}}{1+e\cos x}dx$$
You would get
$$\int_0^{\pi}\frac1{a+b\cos x}dx=\frac1a\int_0^{\pi}\frac{dE}{\sqrt{1-e^2}}=\frac{\pi}{\sqrt{a^2-b^2}}$$
So you were off by a factor of $2$ at this point. Next, if we let $b=a\sin\theta$, then
$$\begin{align}\int\frac{db}{b\sqrt{a^2-b^2}}&=\frac1a\int\csc\theta\,d\theta=-\frac1a\ln\left|\csc\theta+\cot\theta\right|+C_1(a)\\
&=-\frac1a\ln\left(\frac ab+\frac{\sqrt{a^2-b^2}}b\right)+C_1(a)\\
&=-\frac1a\ln\left(a+\sqrt{a^2-b^2}\right)+\frac1a\ln b+C_1(a)\end{align}$$
So you would arrive at
$$I(a,b)=\pi\ln\left(a+\sqrt{a^2-b^2}\right)+C(a)$$
At $b=0$ we get $\pi\ln a=\pi\ln2a+C(a)$ so $C(a)=-\pi\ln2$. Then
$$I(5,4)=\pi\ln8-\pi\ln2=\pi\ln4$$
Numerical quadrature confirms this result.