TITLE: Looking for closed-forms of $\int_0^{\pi/4}\ln^2(\sin x)\,dx$ and $\int_0^{\pi/4}\ln^2(\cos x)\,dx$
QUESTION [35 upvotes]: A few days ago, I posted the following problems
Prove that
\begin{equation}
\int_0^{\pi/2}\ln^2(\cos x)\,dx=\frac{\pi}{2}\ln^2 2+\frac{\pi^3}{24}\\[20pt]
-\int_0^{\pi/2}\ln^3(\cos x)\,dx=\frac{\pi}{2}\ln^3 2+\frac{\pi^3}{8}\ln 2 +\frac{3\pi}{4}\zeta(3)
\end{equation}
and the OP receives some good answers even I then could answer it.

My next question is finding the closed-forms for

\begin{align}
\int_0^{\pi/4}\ln^2(\sin x)\,dx\tag1\\[20pt]
\int_0^{\pi/4}\ln^2(\cos x)\,dx\tag2\\[20pt]
\int_0^1\frac{\ln t~\ln\big(1+t^2\big)}{1+t^2}dt\tag3
\end{align}

I have a strong feeling that the closed-forms exist because we have nice closed-forms for
\begin{equation}
\int_0^{\pi/4}\ln(\sin x)\ dx=-\frac12\left(C+\frac\pi2\ln2\right)\\
\text{and}\\
\int_0^{\pi/4}\ln(\cos x)\ dx=\frac12\left(C-\frac\pi2\ln2\right).
\end{equation}
The complete proofs can be found here.
As shown by Mr. Lucian in his answer below, the three integrals are closely related, so finding the closed-form one of them will also find the other closed-forms. How to find the closed-forms of the integrals? Could anyone here please help me to find the closed-form, only one of them, preferably with elementary ways (high school methods)? If possible, please avoiding contour integration and double summation. Any help would be greatly appreciated. Thank you.

REPLY [3 votes]: Evaluation of $\int_0^1\frac{\ln(x)\ln(1+x^2)}{1+x^2}dx:$
First note that
$$\int_0^1\frac{\ln(x)\ln(1+x^2)}{1+x^2}dx=\sum_{n=1}^\infty (-1)^n H_n\int_0^1 \ln(x) x^{2n}dx$$
$$=\sum_{n=1}^\infty\frac{(-1)^nH_n}{(2n+1)^2}=\sum_{n=0}^\infty\frac{(-1)^nH_n}{(2n+1)^2}.$$
We have here
$$\int_0^1\frac{x^{2n}}{1+x}dx=\ln(2)+H_n-H_{2n}$$
$$=\ln(2)+H_n-H_{2n+1}+\frac1{2n+1}.$$
Multiply both sides by $\frac{(-1)^n}{(2n+1)^2}$ then $\sum_{n=0}^\infty$ we get
$$\text{G}\ln(2)+\sum_{n=0}^\infty\frac{(-1)^nH_n}{(2n+1)^2}-\sum_{n=0}^\infty\frac{(-1)^nH_{2n+1}}{(2n+1)^2}+\underbrace{\sum_{n=0}^\infty\frac{(-1)^n}{(2n+1)^3}}_{\pi^3/32}$$
$$=\int_0^1\frac{1}{1+x}\left(\sum_{n=0}^\infty\frac{(-1)^nx^{2n}}{(2n+1)^2}\right)dx=\int_0^1\frac{1}{1+x}\left(\Im\frac{\text{Li}_2(ix)}{x}\right)dx$$
$$\int_0^1\frac{1}{1+x}\left(\Im\int_0^1-\frac{i\ln(y)}{1-ixy}dy\right)dx=\int_0^1\frac{1}{1+x}\left(\int_0^1-\frac{\ln(y)}{1+x^2y^2}dy\right)dx$$
$$\overset{xy=t}{=}\int_0^1\int_0^x\frac{\ln(x/t)}{x(1+x)(1+t^2)}dtdx=\int_0^1\frac{1}{1+t^2}\left(\int_t^1\frac{\ln(x/t)}{x(1+x)}dx\right)dt$$
$$=\int_0^1\frac{1}{1+t^2}\left(\text{Li}_2(-t)+\frac12\ln^2(t)+\ln(2)\ln(t)+\frac12\zeta(2)\right)dt$$
$$=\int_0^1\frac{\text{Li}_2(-t)}{1+t^2}dt+\frac{\pi^3}{32}-\text{G}\ln(2)+\frac{\pi^3}{48}$$
Therefore
$$\sum_{n=0}^\infty\frac{(-1)^nH_n}{(2n+1)^2}=\sum_{n=0}^\infty\frac{(-1)^nH_{2n+1}}{(2n+1)^2}+\int_0^1\frac{\text{Li}_2(-t)}{1+t^2}dt-2\text{G}\ln(2)+\frac{\pi^3}{48}\tag1$$
where
$$\sum_{n=0}^\infty\frac{(-1)^nH_{2n+1}}{(2n+1)^2}=\Im\sum_{n=1}^\infty\frac{i^nH_{n}}{n^2}=-\frac{\pi}{16}\ln^2(2)-\frac12\text{G}\ln(2)+\Im\operatorname{Li}_3(1+i)\tag2$$
and
$$\int_0^1\frac{\text{Li}_2(-t)}{1+t^2}dt=\int_0^1\frac{1}{1+t^2}\left(\int_0^1\frac{t\ln(x)}{1+tx}dx\right)dt$$
$$=\int_0^1\ln x\left(\int_0^1\frac{t}{(1+t^2)(1+tx)}dt\right)dx$$
$$=\int_0^1\ln(x)\left(\frac{\pi}{4}\frac{x}{1+x^2}+\frac{\ln(2)}{2}\frac{1}{1+x^2}-\frac{\ln(1+x)}{1+x^2}\right)dx$$
$$=-\frac{\pi^3}{192}-\frac12\text{G}\ln(2)-\int_0^1\frac{\ln(x)\ln(1+x)}{1+x^2}dx$$
Substitute
$$\int_0^1\frac{\ln(x)\ln(1+x)}{1+x^2}dx=3\ \text{Im}\operatorname{Li}_3(1+i)-\frac{5\pi^3}{64}-\frac{3\pi}{16}\ln^2(2)-2\ln(2)\ G,$$
we get
$$\int_0^1\frac{\text{Li}_2(-t)}{1+t^2}dt=-3\ \text{Im}\operatorname{Li}_3(1+i)+\frac{7\pi^3}{96}+\frac{3\pi}{16}\ln^2(2)+\frac32\ln(2)\ G.\tag3$$
Substitute $(2)$ and $(3)$ in $(1)$, we get
$$\sum_{n=0}^\infty\frac{(-1)^nH_n}{(2n+1)^2}:=\int_0^1\frac{\ln(x)\ln(1+x^2)}{1+x^2}dx=\frac{3\pi^3}{32}+\frac{\pi}8\ln^2(2)-\text{G}\ln(2)-2\Im\operatorname{Li_3}(1+i).$$