<s>[INST] Tricky elementary integral $\int_{0}^{\frac{\pi}{2}}x\cot(x)dx$. 
$$\int_{0}^{\frac{\pi }{2}}x\cot(x)dx$$

I tried integration by parts and got $\dfrac{1}{2}\int_{0}^{\frac{\pi }{2}}x^{2} \csc^{2}x dx$ which doesn't help at all. I don't really know what to do. Any help will be greatly appreciated.
 [/INST] that is a great question  but there is a splendid Q , I will post for knowlodge
$$I=∫_{0}^{\frac{π }{4}}x^2 \cot xdx\ \ \ \ \ \ \ \ \ by\ parts\ we\ have\\
\\
I=x^2\ln(\sin x)\tfrac{\frac{π }{4}}{0}-2∫_{0}^{\frac{π }{4}}x\ln(\sin(x))dx\\
\\
=-\frac{π ^{2}\ln(2)}{32}+∫_{0}^{\frac{π }{4}}(2\ln(2)+2∑_{k=1}^{\infty }\frac{\cos(2kx)}{k})xdx\\
\\
=\frac{-π ^{2}\ln(2)}{32}+2\ln(2)∫_{0}^{\frac{π }{4}}xdx+2∑_{k=1}^{\infty }\frac{1}{k}∫_{0}^{\frac{π }{4}}x\cos(2kx)dx\\
\\
\\
but\ ∫ x\cos(2kx)=\frac{x\sin(2kx)}{2k}+\frac{\cos(2kx)}{4k^2}+c\\
\\
\therefore ∫_{0}^{\frac{π }{4}}x\cos(2kx)dx=\frac{π \sin(\frac{kπ }{2})}{8k}+\frac{\cos(\frac{π k}{2})}{4k^2}-\frac{1}{4k^2}\\
\\$$
$$\therefore I=\frac{-π ^{2}\ln(2)}{32}+\ln(2)x^2\tfrac{\frac{π }{4}}{0}+2∑_{k=1}^{\infty }(\frac{π \sin(\frac{π k}{2})}{8k^2}+\frac{\cos(\frac{π k}{2})}{4k^3}-\frac{1}{4k^3})\\
\\
=\frac{-π ^{2}}{32}\ln(2)+\frac{π ^{2}}{16}\ln(2)-\frac{1}{2}∑_{k=1}^{\infty }\frac{1}{k^3}+\frac{1}{2}∑_{k=1}^{\infty }(\frac{\cos(π k)}{8k^3})+\frac{π }{4}∑_{k=1}^{\infty }\frac{(-1)^{k-1}}{(2k-1)^2}\\
\\
=\frac{π ^{2}}{32}\ln(2)+\frac{π G}{4}-\frac{1}{2}\zeta (3)-\frac{3}{64}\zeta (3)\\
\\
\\
\therefore I=∫_{0}^{\frac{π }{4}}x^2.\cot(xdx=\frac{π ^{2}}{32}.\ln(2)-\frac{35}{64}\zeta (3)+\frac{π G}{4}\\$$
</s>