Evaluating $\int_0^{\pi /2} \frac{ \log (1+\cos a \cos x)}{\cos x} dx$ The question is to evaluate $$\int_0^{\pi /2} \frac{ \log (1+\cos a \cos x)}{\cos x} dx$$
I tried using leibnitz rule
$$F'(a)=\int_0^{\pi /2} \frac{ -\sin a}{(1+\cos a \cos x)}dx$$ Now I used the substitution $\tan(x/2)=t$ to get $$-2 \sin a \int_0^1 \frac{ dt}{1+t^2 +\cos a (1-t^2)} $$ which can be rewritten as 
$$-2\frac{\sin a} {1- \cos a}\int_0^{1} \frac{ dt}{t^2 +\frac{1+ \cos a}{1-\cos a}} $$ which evaluates to $-a$.i am not sure where I went wrong.Any ideas?

Hint: 
Put $b= \sqrt{\frac{1+ \cos a}{1-\cos a} }$
Then, 
$$\int_0^{1} \frac{ dt}{t^2 +\frac{1+ \cos a}{1-\cos a}}  =\int_0^{1} \frac{ dt}{t^2 +b^2} = \frac1b\arctan{\frac{t}{b}}\bigg|_{t=0}^{t=1}= \frac1b\arctan{\frac{1}{b}} $$
Therefore, $$ F'(a) =-2\frac{\sin a} {\sqrt{(1-\cos a)(1+ \cos a)}}  \arctan{\left(\sqrt{\frac{1- \cos a}{1+\cos a} }\right)} \\= -2\frac{\sin a} {|\sin a|}  \arctan{\left(\sqrt{\frac{1- \cos a}{1+\cos a} }\right)}$$
That is  $$ F'(a)= \color{blue}{ -2\frac{\sin a} {|\sin a|}  \arctan{\left(\sqrt{\frac{1- \cos a}{1+\cos a} }\right)}}$$
