How to evaluate $$ \displaystyle\int_0^{\pi/2} \log \left| \sin^2 x - a \right|\,dx $$ where $a\in[0,1]$ ?
I think of this problem as a generalization of the following proposition $$ \displaystyle\int_0^{\pi/2} \log \left(\sin x\right)\,dx =-\frac12\pi\log2 $$
My try
Put $$ I(a)=\displaystyle\int_0^{\pi/2} \log \left| \sin^2 x - a \right|\,dx $$ From the substitution $x \to \frac{\pi}{2}-x$ , we get $$ \displaystyle\int_0^{\pi/2} \log \left| \sin^2 x - a \right|\,dx = \displaystyle\int_0^{\pi/2} \log \left| \cos^2 x - a \right|\,dx $$ Thus $$ \displaystyle\int_0^{\pi/2} \log \left| \sin^2 x - a \right|\,dx = \displaystyle\int_0^{\pi/2} \log \left| \sin^2 x - (1-a) \right|\,dx $$ which means $$I(a)=I(1-a) \tag{1}$$
On the other hand, \begin{align} 2I(a) &= \displaystyle\int_0^{\pi/2} \log \left| (\sin^2 x - a)(\cos^2 x -a) \right|\,dx \\ &= \displaystyle\int_0^{\pi/2} \log \left| a^2-a+\sin^2 x \cos^2 x \right|\,dx \\ &= \displaystyle\int_0^{\pi/2} \log \left| 4(a^2-a)+\sin^2 (2x) \right|\,dx -\pi \log 2 \\ &= \frac{1}{2}\displaystyle\int_0^{\pi} \log \left| 4(a^2-a)+\sin^2 x \right|\,dx -\pi \log 2 \\ &= \displaystyle\int_0^{\pi/2} \log \left| 4(a^2-a)+\sin^2 x \right|\,dx -\pi \log 2 \\ &= \displaystyle\int_0^{\pi/2} \log \left| 1+4(a^2-a)-\sin^2 x \right|\,dx -\pi \log 2 \\ &= I((2a-1)^2) -\pi \log 2 \end{align} Thus $$ 2I(a)=I((2a-1)^2)-\pi \log 2 \tag{2} $$
Let $a=0$ we get the proposition mentioned above $\displaystyle\int_0^{\pi/2} \log \left(\sin x\right)\,dx =-\frac12\pi\log2.$
But how to move on ? Can we solve the problem only by $(1)$ and $(2)$? Or what other properties should we use to evaluate that?
Looking forward to your new solutions as well.
Thank you in advance!
Added:
As pointed out in the comments, it seems like that the integral is identical to $-\pi\log 2$.
From $(1)$ and $(2)$ we can also find many numbers such that $I(a)=-\pi\log 2$.