A problem about parametric integral How to solve the following integral.
$I(\theta) = \int_0^{\pi}\ln(1+\theta \cos x)dx$ where $|\theta|<1$

I shall find the integral by Feynman’s Technique Integration on a particular integral
$\displaystyle I(a)=\int_{0}^{\pi} \ln (a \cos x+1) d x,\tag*{} $
where $-1\leq a \leq 1.$
$\displaystyle \begin{aligned}I^{\prime}(a) &=\int_{0}^{\pi} \frac{\cos x}{a \cos x+1} d x, \\&=\frac{1}{a} \int_{0}^{\pi} \frac{(a \cos x+1)-1}{a \cos x+1} d x \\&=\frac{\pi}{a}-\frac{1}{a} \int_{0}^{\pi} \frac{d x}{a \cos x+1} \\&\stackrel{t=\tan \frac{x}{2}}{=} \frac{\pi}{a}-\frac{1}{a} \int_{0}^{\infty} \frac{1}{1+\frac{a\left(1-t^{2}\right)}{1+t^{2}}} \cdot \frac{2 d t}{1+t^{2}} \\&=\frac{\pi}{a}-\frac{2}{a} \int_{0}^{\infty} \frac{d t}{(1-a) t^{2}+(1+a)} \\&=\frac{\pi}{a}-\frac{2}{a \sqrt{1-a^{2}}} \tan^{-1}\left[\frac{\sqrt{1-a} t}{\sqrt{1+a}}\right]_{0}^{\infty} \\&=\frac{\pi}{a}-\frac{\pi}{a \sqrt{1-a^{2}}}\end{aligned}\tag*{} $
Integrating both sides w.r.t. $a$ yields
\begin{aligned}\int I^{\prime}(a) d a &=\pi\int\left(\frac{1}{a}-\frac{1}{a \sqrt{1-a^{2}}}\right) da \\& \stackrel{a=\sin \theta}{=} \pi\int\left(\frac{1}{\sin \theta}-\frac{1}{\sin \theta \cos \theta}\right) \cos \theta d \theta \\&=\pi\int \frac{\cos \theta-1}{\sin \theta} d \theta\\&I(a) =\pi \int \frac{-\sin ^{2} \theta}{\sin \theta(\cos \theta+1)} d \theta\\&=\pi \ln (1+\cos \theta) +C\end{aligned}
Putting $a=0$ gives $C=-\pi\ln 2$ and hence
$$
\boxed{\int_{0}^{\pi} \ln (a \cos x+1) d x =\pi \ln \left[1+\cos \left(\sin ^{-1} a\right)\right]= \pi \ln \left(\frac{1+\sqrt{1-a^{2}}}{2}  \right)}
$$
