Stuck on Liebniz Integration Technique This is a problem from the textbook Advanced Calculus by Edwin Wilson from Chapter 11 (page 281-288). The problem asks,
Evaluate by any means the following: $$\int_0^{\frac{\pi}{2}} \frac{ln(1 + \cos{a}\cos{x})}{\cos{x}} \, dx$$
I think I'm on the right track... but I'm getting stuck. I have the following:
\begin{align*}
\phi(a) &= \int_0^\frac{\pi}{2}\, \, \, \frac{\ln(1 + \cos{a}\cos{x})}{\cos{x}} \, dx\\
\\
\\
\implies \phi'(a) &= \int_0^\frac{\pi}{2}\, \, \,\frac{1}{\cos{x}} \cdot \frac{\partial}{\partial a}\ln(1 + \cos{a}\cos{x}) \, dx\\
&= \int_0^\frac{\pi}{2}\, \, \, \frac{1}{\cos{x}} \cdot \left [ \frac{1}{1 + \cos{a}\cos{x}} \cdot \cos{x}(-\sin{a}) \right ] \, dx\\
&= \int_0^\frac{\pi}{2}\, \, \,\frac{-\sin{a}}{1+\cos{a}\cos{x}} \, dx\\
\\
\\
\implies \phi'(a) &= -\sin{a} \cdot \int_0^\frac{\pi}{2}\, \, \,\frac{1}{1 + \cos{a}\cos{x}} \, dx
\\
\\
&\\
\end{align*}
Here, I've seen the suggestion to use the substitution $t = \tan\left({\frac{x}{2}}\right)$, and I make some headway but then I get stuck... I see that with this substitution we get $\cos{x} = \dfrac{1 - t^2}{1+t^2}$ and $dx = \dfrac{2}{1 + t^2} dt$, and the bounds change to $t = 0$ and $t = 1$. Substituting some things in..
\begin{align*}
\phi'(a) &= -\sin{a} \int_0^\frac{\pi}{2} \frac{1}{1 + \cos{a}\cos{x}} \, dx\\
\\
&= -\sin{a} \int_{t=0}^{t=1} \frac{1}{1 + \cos{a} \cdot \left(\frac{1 - t^2}{1 + t^2} \right )} \cdot \left (\frac{2}{1 + t^2} \right ) dt\\
\\
&=-2\sin{a} \int_0^1 \frac{1}{\left(1 + t^2 \right) \cdot \left (1 + \frac{1-t^2}{1+t^2} \cdot \cos{a} \right )} \, \, dt\\
\\
&= -2\sin{a} \int_0^1 \frac{1}{(1 + t^2) + \left[(1 - t^2) \cos{a}\right]} \, dt
\end{align*}
And this is where I get stuck. Any assistance would be great!

Let $\alpha := \cos(a)$ and $\beta := \sqrt{1-\alpha}$ and $\gamma := \sqrt{1+\alpha}$. (The latter two are well defined since $\cos(a) \in [-1,1]$.) Then the integral of concern is, just with some factorizations,
$$\mathcal{I}:= \int_0^1 \frac{1}{1+t^2 +\alpha - \alpha t^2} \, \mathrm{d}t
= \int_0^1 \frac{1}{t^2 \beta^2 + \gamma^2} \, \mathrm{d}t$$
Factor out a $\gamma^2$:
$$\mathcal{I}:= \frac{1}{\gamma^2} \int_0^1 \frac{1}{1+(\beta t/\gamma)^2} \, \mathrm{d}t$$
From here, the solution is simply a further, obvious $u$-substitution and then the arctangent derivative. You may also have to do a little extra casework in the event $\gamma$ or $\beta$ or both are $0$.
