# Evaluating $\int_0^{\tfrac{\pi}{4}}\ln(\cos x-\sin x)\ln(\cos x) dx - \int_0^{\tfrac{\pi}{4}}\ln(\cos x+\sin x)\ln(\sin x)dx=\frac{G\ln 2}{2}$

In order to compute, in an elementary way,

$\displaystyle \int_0^1 \frac{x \arctan x \log \left( 1-x^2\right)}{1+x^2}dx$

i need to show, in a simple way, that:

$\displaystyle \int_0^{\tfrac{\pi}{4}}\ln(\cos x-\sin x)\ln(\cos x) dx - \int_0^{\tfrac{\pi}{4}}\ln(\cos x+\sin x)\ln(\sin x)dx=\dfrac{G\ln 2}{2}$

$G$ being the Catalan constant.

The reason of my interest for this question is, if i am right, that this formula permits to find out a relation between integrals:

$\displaystyle \int_0^1 \dfrac{\ln(1+x)\ln(1+x^2)}{1+x^2}dx$

$\displaystyle \int_0^1 \dfrac{\ln(1+x)^2}{1+x^2}dx$

$\displaystyle \int_0^{\tfrac{\pi}{4}}\big(\ln(\cos x)\big)^2 \dfrac{}{}dx$

and some constants.

Using Simpsons rule we know $$\cos(x)-\sin(x)=\sqrt{2}\sin\left(\frac{\pi}{4}-x\right)$$ and $$\cos(x)+\sin(x)=\sqrt{2}\cos\left(\frac{\pi}{4}-x\right)$$

Plugging this in the original integrals yields: $$\int_0^{\frac{\pi}{4}}\ln\left(\sqrt{2}\sin\left(\frac{\pi}{4}-x\right)\right)\ln\left(\cos(x)\right)\mathrm{d}x- \int_0^{\frac{\pi}{4}}\ln\left(\sqrt{2}\cos\left(\frac{\pi}{4}-x\right)\right)\ln\left(\sin(x)\right)\mathrm{d}x$$

Splitting the logarithms and rearranging yields: $$\int_0^{\frac{\pi}{4}}\ln(\sqrt{2})\left(\ln(\cos(x))-\ln(\sin(x)\right)\mathrm{d}x+\\ +\left(\int_0^{\frac{\pi}{4}}\ln\left(\sin\left(\frac{\pi}{4}-x \right)\right)\ln(\cos(x)) \mathrm{d}x-\int_0^{\frac{\pi}{4}}\ln\left(\cos\left(\frac{\pi}{4}-x \right)\right)\ln(\sin(x)) \mathrm{d}x \right)$$

The first part yields $$\int_0^{\frac{\pi}{4}}\ln(\sqrt{2})\left(\ln(\cos(x))-\ln(\sin(x)\right)\mathrm{d}x = \ln(\sqrt{2})G=\frac{G\ln(2)}{2}$$

and because $$\int_0^bf(x)\mathrm{d}x=\int_0^bf(b-x)\mathrm{d}x$$ the second part yields $$\int_0^{\frac{\pi}{4}}\ln\left(\sin\left(\frac{\pi}{4}-x \right)\right)\ln(\cos(x)) \mathrm{d}x-\int_0^{\frac{\pi}{4}}\ln\left(\cos\left(\frac{\pi}{4}-x \right)\right)\ln(\sin(x)) \mathrm{d}x=0$$

• Very nice ! Thank you – FDP Jul 6 '16 at 20:07

\begin{align} I&:=\int_0^{\tfrac{\pi}{4}}\ln(\cos x-\sin x)\ln(\cos x)\,dx - \int_0^{\tfrac{\pi}{4}}\ln(\cos x+\sin x)\ln(\sin x)\,dx\\ &=\int_0^{\tfrac{\pi}{4}}\ln\left(\sqrt{2}\,\cos\left(x+\frac {\pi}4\right)\right)\ln(\cos x)\,dx - \int_0^{\tfrac{\pi}{4}}\ln\left(\sqrt{2}\,\sin\left(x+\frac {\pi}4\right)\right)\ln(\sin x)\,dx\\ &\ \quad\text{setting}\; x=\frac {\pi}4-y\;\ \text{in the first integral gives}\\ &=\int_0^{\tfrac{\pi}{4}}\ln\left(\sqrt{2}\,\cos\left(\frac {\pi}2-y\right)\right)\ln\left(\cos\left(\frac {\pi}2-\frac {\pi}4-y\right)\right)\,dy - \int_0^{\tfrac{\pi}{4}}\ln\left(\sqrt{2}\,\sin\left(x+\frac {\pi}4\right)\right)\ln(\sin x)\,dx\\ &=\int_0^{\tfrac{\pi}{4}}\ln\left(\sqrt{2}\,\sin\left(y\right)\right)\ln\left(\sin\left(y+\frac {\pi}4\right)\right)\,dy - \int_0^{\tfrac{\pi}{4}}\ln\left(\sqrt{2}\,\sin\left(x+\frac {\pi}4\right)\right)\ln(\sin x)\,dx\\ &=\int_0^{\tfrac{\pi}{4}}\left(\ln(\sqrt{2})+\ln\left(\sin x\right)\right)\ln\left(\sin\left(x+\frac {\pi}4\right)\right) - \left(\ln(\sqrt{2})+\ln\left(\sin\left(x+\frac {\pi}4\right)\right)\right)\ln(\sin x)\;dx\\ &=\ln(\sqrt{2})\int_0^{\tfrac{\pi}{4}}\ln\left(\sin\left(x+\frac {\pi}4\right)\right)-\ln(\sin x)\;dx\\ &=\dfrac{\ln 2}{2}G\\ \end{align} It remains to prove that $\displaystyle \int_0^{\tfrac{\pi}{4}}\ln\left(\sin\left(x+\frac {\pi}4\right)\right)-\ln(\sin x)\;dx=G$.
This is detailed around $(16)$ in this interesting paper by Jameson and Lord or using : \begin{align} \int_0^{\tfrac{\pi}{4}}\ln\left(\sin\left(x+\frac {\pi}4\right)\right)-\ln(\sin x)\,dx&=\int_{\tfrac{\pi}{4}}^{\tfrac{\pi}{2}}\ln\left(\sin x\right)\,dx-\int_0^{\tfrac{\pi}{4}}\ln(\sin x)\,dx\\ &=\int_0^{\tfrac{\pi}{4}}\ln(\cos x)\,dx-\int_0^{\tfrac{\pi}{4}}\ln(\sin x)\,dx\\ &=-\int_0^{\tfrac{\pi}{4}}\ln(\tan x)\,dx\\ &=-\int_0^1\frac{\ln t}{1+t^2}\,dt,\quad\text{integrated by parts}\\ &=-\left.\ln(t)\;\arctan(t)\right|_0^1+\int_0^1\frac{\arctan(t)}{t}\,dt\\ &=\int_0^1\sum_{n=0}^\infty (-1)^n\frac{t^{2n}}{2n+1}\,dt\\ &=\left.\sum_{n=0}^\infty (-1)^n\frac{t^{2n+1}}{(2n+1)^2}\right|_0^1\\ &=G\\ \end{align}

• Thank you ! I was expecting such tricky proof. To say the truth i was close to find it. I hope it will help me to terminate my very lengthy computation – FDP Jul 6 '16 at 19:57
• Thanks for the link to this paper. – FDP Jul 6 '16 at 21:51

Relationship between the proposed integrals.

$\displaystyle \int_0^1 \dfrac{\ln(1+x)^2}{1+x^2}dx$-$\displaystyle \int_0^1 \dfrac{\ln(1+x)\ln(1+x^2)}{1+x^2}dx=-\frac{3\pi}{16}\ln^2{2}+\dfrac{G\ln 2}{2}$

• Have you an elementary proof of this? – FDP Jul 6 '16 at 21:54
• Anyway I think i don't need such precise value to compute $\int_0^1 \frac{x \arctan x \log \left( 1-x^2\right)}{1+x^2}dx$ – FDP Jul 6 '16 at 21:57
• I think i see how to prove this. It relies on the evaluation of $\int_0^{\frac{\pi}{4}} (\ln(\cos x+\sin x))^2dx$ using Simpson's rule and some properties of $\cos$ and $\sin$. Thank you, it will simplify my computation :) – FDP Jul 6 '16 at 23:37
• Consider $\displaystyle \int_0^1 \dfrac{\ln(1+x^2)^2}{1+x^2}dx$ $$x=\frac{1-y}{1+y}$$ we obtain the relationship – user178256 Jul 7 '16 at 6:16
• Direct computation using the change of variable $x=tan(y)$ is ok too. it leads, if i'm correct to the evaluation of $\int_0^{\frac{\pi}{4}} (\ln(\cos x+\sin x))^2dx$ but to make the things easier you need to substract to both integrals $\int_0^{\frac{\pi}{4}} (\ln(\cos x)^2dx$. Thanks again, i haven't noticed this relation – FDP Jul 7 '16 at 8:29