found the way to go...We can want to solve
$$
I=\int_0^{\pi/2}x\cot(x) dx,
$$
so we introduce a parameter $\xi$ by writing
$$
I(\xi)=\int_0^{\pi/2} \frac{\tan^{-1}(\xi\tan(x))}{\tan(x)} dx
$$
and in the limit $\xi \to 1$ we recover I. Taking a derivative we obtain
$$
I'(\xi)=\frac{d}{d\xi}\int_0^{\pi/2} \frac{\tan^{-1}(\xi\tan(x))}{\tan(x)} dx=\int_0^{\pi/2}\frac{\partial}{\partial \xi} \bigg(\frac{\tan^{-1}(\xi\tan(x))}{\tan(x)} \bigg)dx
$$
Now we take the derivative to obtain
$$
I'(\xi)=\int_0^{\pi/2} \frac{dx}{\big(\xi\tan(x)\big)^2+1} =\frac{\pi}{2(\xi+1)}.
$$
We now integrate our result wrt $\xi$ and realizing the constant of integration is zero, we obtain
$$
I(\xi)=\frac{\pi}{2}\ln(\xi+1).
$$
Taking the limit as $\xi \to 1$ we obtain
$$
\lim_{\xi \to 1} I(\xi)=\lim_{\xi \to 1} \frac{\pi}{2}\ln(\xi+1)=\frac{\pi \ln(2)}{2}.
$$
Thus we have shown that
$$
{\boxed{I=\frac{\pi\ln(2)}{2}}}
$$
Let's consider the integral
\begin{align}I(\alpha)&=\int_0^{\Large\frac{\pi}{2}}\frac{\ln\,(1+\cos\alpha\,\sin\,\phi)}{\sin\,\phi}\;d\phi\quad\Rightarrow\quad\phi\mapsto \frac{\pi}{2}-\phi\\
&=\int_0^{\Large\frac{\pi}{2}}\frac{\ln\,(1+\cos\alpha\,\cos\,\phi)}{\cos\,\phi}\;d\phi, \qquad 0 < \alpha < \pi.\end{align}
Differentiating $I(\alpha)$ with respect to $\alpha$, we have
\begin{align}
{I}'(\alpha) &= \int_0^{\Large\frac{\pi}{2}} \frac{\partial}{\partial\alpha} \left(\frac{\ln(1 + \cos\alpha \cos \phi)}{\cos \phi}\right)\,d\phi \\
&=-\int_0^{\Large\frac{\pi}{2}}\frac{\sin \alpha}{1+\cos \alpha \cos \phi}\,d\phi \\
&=-\int_0^{\Large\frac{\pi}{2}}\frac{\sin \alpha}{\left(\cos^2 \frac{\phi}{2}+\sin^2 \frac{\phi}{2}\right)+\cos \alpha\,\left(\cos^2\,\frac{\phi}{2}-\sin^2 \frac{\phi}{2}\right)}\,d\phi \\
&=-\frac{\sin\alpha}{1-\cos\alpha} \int_0^{\Large\frac{\pi}{2}} \frac{1}{\cos^2\frac{\phi}{2}}\frac{1}{\left[\left(\frac{1+\cos \alpha}{1-\cos \alpha}\right) +\tan^2 \frac{\phi}{2} \right]}\,d\phi \\
&=-\frac{2\,\sin\alpha}{1-\cos\alpha} \int_0^{\Large\frac{\pi}{2}}\,\frac{\frac{1}{2}\,\sec^2\,\frac{\phi}{2}}{\left[\,\left(\dfrac{2\,\cos^2\,\frac{\alpha}{2}}{2\,\sin^2\,\frac{\alpha}{2}}\right) + \tan^2\,\frac{\phi}{2} \right]} \,d\phi \\
&=-\frac{2\left(2\,\sin\,\frac{\alpha}{2}\,\cos\,\frac{\alpha}{2}\right)}{2\,\sin^2\,\frac{\alpha}{2}}\,\int_0^{\Large\frac{\pi}{2}}\,\frac{1}{\left[\left(\dfrac{\cos \frac{\alpha}{2}}{\sin\,\frac{\alpha}{2}}\right)^2\,+\,\tan^2\,\frac{\phi}{2}\,\right]}\,d\left(\tan\,\frac{\phi}{2}\right)\\
&=-2\cot \frac{\alpha}{2}\,\int_0^{\Large\frac{\pi}{2}}\,\frac{1}{\left[\,\cot^2\,\frac{\alpha}{2} + \tan^2\,\frac{\phi}{2}\,\right]}\,d\left(\tan \frac{\phi}{2}\right)\,\\
&=-2\,\left.\tan^{-1} \left(\tan \frac{\alpha}{2} \tan \frac{\phi}{2} \right) \right|_0^{\Large\frac{\pi}{2}}\\
&=-\alpha
\end{align}
Therefore:
$$I(\alpha) = C - \frac{\alpha^2}{2}$$
However by definition, $I\left(\frac{\pi}{2}\right) = 0$, hence $C = \dfrac{\pi^2}{8}$ and
$$I(\alpha) = \frac{\pi^2}{8}-\frac{\alpha^2}{2}.$$
The integral we want to evaluate is
$$I(0) = \int_0^{\Large\frac{\pi}{2}}\frac{\ln\,(1+\sin\,\phi)}{\sin\,\phi}\;d\phi=\frac{\pi^2}{8}.$$
Best Answer
Consider for $a>0$ $$ I(a)=\int_0^\infty\frac{\sin^2(ax)}{x^2(x^2+1)}dx $$ Differentiate it twice. Since $$ \int_0^\infty\frac{\cos(kx)}{x^2+1}dx=\frac{\pi}{2e^k} $$ for $k>0$ we get $I''(a)=\pi e^{-2a}$. Note that $I'(0)=I(0)=0$, so after solving respective IVP we get $$ I(a)=\frac{\pi}{4}(-1+2a+e^{-2a}) $$ It is remains to substitute $a=1$.