<s>[INST] Transformation to $\log\left(\frac a2\cos x\right)$ 
Question: How does$$T=-\int\limits_{\tfrac {\pi}2}^{-\tfrac {\pi}2}dx\,\frac {\log\left(\tfrac {a^2}4\cos^2x\right)}{\sqrt{\tfrac {a^2}4\cos^2x}}\left(\frac a2\cos x\right)=4\int\limits_0^{\tfrac {\pi}2}dx\,\log\left(\frac a2\cos x\right)\tag1$$

I was evaluating an integral, namely$$I=\int\limits_0^adx\,\frac {\log x}{\sqrt{ax-x^2}}$$And I'm having trouble seeing how to get from the left-hand side to the right-hand side. Doesn't the denominator and numerator cancel to leave you with$$T=-\int\limits_{\tfrac {\pi}2}^{-\tfrac {\pi}2}dx\,\log\left(\frac {a^2}4\cos^2x\right)=-2\int\limits_{\tfrac {\pi}2}^{-\tfrac {\pi}2}dx\,\log\left(\frac a2\cos x\right)$$But I don't see how that can be substituted to get the second expression of $(1)$. What kind of substitution should be made to make the transformation from where I left off to $(1)$?
 [/INST] First, $\cos(x)\ge 0$ and is even for $x\in[-\pi/2,\pi/2]$.  Hence, $\sqrt{\cos^2(x)}=\cos(x)$.  If $a>0$, then $\sqrt{a^2}=a$.  Therefore,
$$\frac{\log\left(\frac{a^2}{4}\cos^2(x)\right)\left(\frac a2\cos(x)\right)}{\sqrt{\frac{a^2}{4}\cos^2(x)}}=\frac{\log\left(\left(\frac{a\cos(x)}{2}\right)^2\right)\left(\frac a2\cos(x)\right)}{\frac a2\cos(x)}=2\log\left(\frac{a\cos(x)}{2}\right)$$
Finally, exploiting the evenness of the cosine function, we find 
$$\begin{align}
\int_{-\pi/2}^{\pi/2}\frac{\log\left(\frac{a^2}{4}\cos^2(x)\right)\left(\frac a2\cos(x)\right)}{\sqrt{\frac{a^2}{4}\cos^2(x)}}\,dx&=\int_{-\pi/2}^{\pi/2}2\log\left(\frac{a\cos(x)}{2}\right)\,dx\\\\
&=4\int_0^{\pi/2}\log\left(\frac{a\cos(x)}{2}\right)\,dx
\end{align}$$
as expected!
</s>