How may we show that $\int_{0}^{\infty}{{\cos\left({2x\over \pi}\right)-\cos^2\left({2x\over \pi}\right)}\over x^2}\cdot\ln(x)\,\mathrm dx=-\ln(2)?$

I will propose an alternative (but extremely similar to tired's) approach.
By the Laplace transform, for any $k>0$ and any $\alpha\in(1,3)$ we have

$$ \int_{0}^{+\infty}\frac{1-\cos(kx)}{x^\alpha}\,dx = k^{\alpha-1}\int_{0}^{+\infty}\frac{1-\cos(x)}{x^{\alpha}}\,dx =\frac{k^{\alpha-1}}{\Gamma(\alpha)}\int_{0}^{+\infty}\frac{s^{\alpha-2}}{1+s^2}\,ds\tag{1}$$ and the last integral can be computed through the Beta function. In particular we get:

$$\int_{0}^{+\infty}\frac{1-\cos(kx)}{x^\alpha}\,dx = \frac{\pi\,k^{\alpha-1}}{2\cos\left(\frac{\pi}{2}(a-2)\right)\Gamma(\alpha)} \tag{2}$$ and by differentiating both sides with respect to $\alpha$ we simply get: $$ g(k)=\int_{0}^{+\infty}\frac{1-\cos(kx)}{x^2}\log(x)\,dx = \frac{k\pi}{2}\left(1-\gamma-\log k\right) \tag{3}$$ so the original integral equals:

$$ \int_{0}^{+\infty}\frac{\cos\left(\frac{2x}{\pi}\right)-\cos^2\left(\frac{2x}{\pi}\right)}{x^2}\log(x)\,dx = \frac{1}{2}\,g\left(\frac{4}{\pi}\right)-g\left(\frac{2}{\pi}\right)=\color{red}{-\log 2}\tag{4} $$ as wanted.


Define

$$ I(b)=\int_0^{\infty}\frac{\cos(b x)-\cos^2(b x)}{x^2}\log(x) $$

so the integral in question is $I(2/\pi)$. Now

$$ -I'(b)=\int_0^{\infty}\frac{\sin(b x)(1-2\cos(b x))}{x}\log(x)\underbrace{=}_{xb\rightarrow y}\\I'(1)-\log(b)\int_0^{\infty}\frac{\sin(x)(1-2\cos(x))}{x}=I'(1) $$

or

$$ I(b)=-bI'(1)+c $$

now $I'(1)$ can be calculated pretty straightfowardy from using $2\cos(x)\sin(x)=\sin(2x)$ .

$$ I'(1)=\log(2)\int_0^{\infty}\frac{\sin(x)}{x}=\log(2)\frac{\pi}{2} $$

Afterwards the only thing left is to fix $c$ which can be done by observing that $\lim_{b\rightarrow 0}I(b)=0$ which follows from the Taylorexpansion of $\cos(bx)-\cos^2(bx)$. This means

$$ I(b)=-b\frac{\pi}{2}\log(2) $$

from which it follows that $I(2/\pi)=-\log(2)$ as proposed


$\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ \begin{align} &\int_{0}^{\infty} {\cos\pars{2x/\pi} - \cos^{2}\pars{2x/\pi} \over x^{2}}\,\ln\pars{x}\,\dd x \\[5mm] = &\ \int_{0}^{\infty} {1 - \cos^{2}\pars{2x/\pi} \over x^{2}}\,\ln\pars{x}\,\dd x - \int_{0}^{\infty} {1 - \cos\pars{2x/\pi} \over x^{2}}\,\ln\pars{x}\,\dd x \\[5mm] = &\ \int_{0}^{\infty} {\sin^{2}\pars{2x/\pi} \over x^{2}}\,\ln\pars{x}\,\dd x - \int_{0}^{\infty} {2\sin^{2}\pars{x/\pi} \over x^{2}}\,\ln\pars{x}\,\dd x \\[5mm] = &\ {2 \over \pi}\int_{0}^{\infty} {\sin^{2}\pars{x} \over x^{2}}\,\ln\pars{\pi x \over 2}\,\dd x - {2 \over \pi}\int_{0}^{\infty} {\sin^{2}\pars{x} \over x^{2}}\,\ln\pars{\pi x}\,\dd x \\[5mm] = &\ {2 \over \pi}\int_{0}^{\infty} {\sin^{2}\pars{x} \over x^{2}}\,\bracks{\ln\pars{1 \over 2}}\,\dd x = \bbx{\ds{-\ln\pars{2}}} \end{align}