I am trying to evaluate the integral
$$\int_{0}^{\frac{\pi}{2}} \frac{\log(e^{ix}+e^{-ix})]-\log{2}}{e^{2ix}-1}e^{ix} \,dx$$
I am wondering if a complex variable substitution the likes of $iu=e^{ix}$, $\,du=e^{ix}\,dx$ is justifiable? In my mind. when $x=0, u=0$ and when $x=\pi/2, u=1$ which would make the integral $$-\int_{0}^{1} \frac{\log(iu-i/u)-\log(2)}{1+u^2}\,du$$
but it is not numerically equivalent. Is it possible to introduce a complex variable substitution to solve the integral, and if so how do I go about it?
With some rearranging the integral is equal to
$$\frac{1}{2i}\int_0^{\frac{\pi}{2}}\frac{\log\cos x}{\sin x}dx = \frac{1}{2i}\int_0^1\frac{\log t}{1-t^2}dt$$
by the substitution $t = \cos x$. Then expand the denominator as a geometric series
$$\sum_{n=0}^\infty \frac{1}{2i} \int_0^1 \log t \cdot t^{2n}dt=\sum_{n=0}^\infty \frac{-1}{2i(2n+1)^2} = \frac{i\pi^2}{16}$$
by integration by parts and then using the sum of the odd terms of the Basel problem.