TITLE: Evaluating $\int_0^{\frac{\pi}{2}}\ln\left(\frac{\ln^2\sin\theta}{\pi^2+\ln^2\sin\theta}\right)\,\frac{\ln\cos\theta}{\tan\theta}\,d\theta$
QUESTION [47 upvotes]: Prove
$$\int_0^{\frac{\pi}{2}}\ln\left(\frac{\ln^2\sin\theta}{\pi^2+\ln^2\sin\theta}\right)\,\frac{\ln\cos\theta}{\tan\theta}\,d\theta = \frac{\pi^2}{4}$$

REPLY [25 votes]: Here's a solution using complex analysis. As other people have shown, the integral is equivalent to:
$$I=\frac{1}{2}\int_0^\infty\log\bigg(\frac{x^2}{x^2+\pi^2}\bigg)\log(1-e^{-2x})dx$$
I'll integrate the function:
$$f(z)=\log z \log(1-e^{-2z})$$ 
On this contour:

I'll spare you the gory details of showing that for $\epsilon \rightarrow 0$ and $R \rightarrow \infty$ the integrals on $\gamma_2$, $\gamma_4$ and $\gamma_6$ vanish. We are left with:
$$\int_0^\infty \log x\log(1-e^{-2x})dx +\int_\infty^0\log(x+i\pi)\log(1-e^{-2x})dx+i\int_\pi^0\log (iy) \log(1-e^{-2iy})dy=0$$
I'll call the sum of the first two integrals $I_1$ and the last one $I_2$. For $I_1$ we have:
$$I_1=\int_0^\infty \log\bigg(\frac{x}{\sqrt{x^2+\pi^2}}\bigg)\log(1-e^{-2x})dx-i\int_0^\infty \arg(x+i\pi)\log(1-e^{-2x})dx$$
Of which, we can see, the real part is very interesting. Now, for $I_2$ we have
$$I_2=-i\int_0^\pi\log(iy)\log(1-e^{-2iy})dy=-i\int_0^\pi \bigg[\log y+i\frac{\pi}{2}\bigg]\bigg[\log(2-2\cos 2y)+i \arg (1-e^{-2iy})\bigg]dy$$
Of which we are interested in the real part, which is:
$$\Re I_2=\frac{\pi}{2}\int_0^\pi \log(2-2\cos 2y)dy + \int_0^\pi \log y \arg (1-e^{-2iy})dy=J_1+J_2$$ 
Let's evaluate the first one. 
$$J_1=\frac{\pi}{2}\int_0^\pi \log(2-2\cos 2y)dy=\frac{\pi}{2}\int_0^\pi \log(4\sin^2 y)dy=0$$
The last line follows from the well known integral of $\log(\sin x)$. Let's evaluate $J_2$. 
$$1-e^{-2iy}=1-\cos (2y) + i \sin (2y)= 2 \sin^2 y + 2i \sin y \cos y=2 \sin y(\sin y +i \cos y)=2i \sin y e^{-iy}$$
We can now see that, up to unimportant costants, the multiplication by $2i\sin y$ is a rotation by $\pi/2$, so in terms of argument it's equivalent to a multiplication by $e^{i\pi/2}$. So:
$$\arg(1-e^{-2iy})=\arg (e^{i(\pi/2-y)})=\frac{\pi}{2}-y$$
So $J_2$ becomes:
$$J_2=\int_0^\pi \log y\frac{\pi}{2}dy-\int_0^{\pi}y\log y dy=-\frac{\pi^2}{4}$$
The last line follows from elementary integration techniques. Putting everything together we have:
$$\Re I_1=-\Re I_2$$
$$\int_0^\infty \log\bigg(\frac{x}{\sqrt{x^2+\pi^2}}\bigg)\log(1-e^{-2x})dx = \frac{\pi^2}{4} $$
So, multiplying by $2$ and remembering the original $1/2$ we have: 
$$I=\frac{\pi^2}{4}$$
As desired.