<s>[INST] Evaluate using differentiation under the sign of integration: $\int_{0}^{\pi} \frac {\ln (1+a\cos (x))}{\cos (x)} dx$ Evaluate by using the rule of differentiation under the sign of integration $\int_{0}^{\pi} \dfrac {\ln (1+a\cos (x))}{\cos (x)} \textrm {dx}$.
My Attempt:
Given integral is $\int_{0}^{\pi} \dfrac {\ln(1+a\cos (x))}{\cos (x)}$. Here $a$ is the parameter so let
$$F(a)=\int_{0}^{\pi} \dfrac {\ln (1+a\cos (x))}{\cos (x)} \textrm {dx}$$
Differentiating both sides w.r.t $a$
$$\dfrac {dF(a)}{da} = \dfrac {d}{da} \int_{0}^{\pi} \dfrac {\ln (1+a\cos (x))}{\cos (x)} \textrm {dx}$$
By Leibnitz Theorem:
$$\dfrac {dF(a)}{da} = \int_{0}^{\pi} \dfrac {1}{1+a\cos (x)} \times \dfrac {1}{\cos (x)} \times \cos (x) 
 \textrm {dx}$$
$$\dfrac {dF(a)}{da}=\int_{0}^{\pi} \dfrac {dx}{1+a\cos (x)} \textrm {dx}$$
Now writing $\cos (x)= \dfrac {1-\tan^{2} (\dfrac {x}{2})}{1+\tan^2 (\dfrac {x}{2})}$ and proceeding with integration becomes quite cumbersome to carry on. Is there any way to simplify with some easy steps?
 [/INST] Let $a^2<1$ 
$$I(a)=\int_{0}^{\pi} \frac{\ln 1+ a \cos x)}{\cos x} dx~~~~(*)$$
D.w.r.t.$a$ on both sides, to get
$$\frac{dI}{da}=\int_{0}^{\pi} \frac{\cos x}{(1+a\cos x)\cos x} dx=\int_{0}^{\pi} \frac{dx}{1+a \cos x}=J(a)~~~~(1)$$
Use $$\int_{0}^{a} f(x) dx=\int_{0}^{a} f(a-x) dx~~~(2)$$
Then $$J(a)=\int_{0}^{\pi} \frac{dx}{1-a \cos x}~~~(3)$$Adding (1) and (3), we get
$$2J(a)=2\int_{0}^{\pi} \frac{dx}{1-a^2\cos^2x}= 4 \int_{0}^{\pi/2} \frac{dx}{1-a^2 \cos^2x}=4\int_{0}^{\pi/2} \frac{\sec^2 x dx}{\tan^2 x+(1-a^2)}.$$
Let $\tan x=u$, then
$$2\frac{dI}{da}=4 \int \frac{du}{u^2+(\sqrt{1-a^2})^2}=\frac{4}{\sqrt{1-a^2}}
\tan^{-1}(u/\sqrt{1-a^2})|_{0}^{\infty}=\frac{2\pi}{\sqrt{1-a^2}}$$
So $$\frac{dI}{da}=\frac{\pi}{\sqrt{1-a^2}} \implies I(a) =\pi \int \frac{da}{\sqrt{1-a^2}}+C \implies I(a)= \sin^{-1}{a}+C \implies I(0)=C$$
From (*), we have $I(0)=0 \implies C=0$. Hence
$$I=\pi \sin^{-1} a, ~a^2<1.$$
</s>