Using the identity $$U_{n}(\cos \theta) = \frac{\sin \left((n+1) \theta\right)}{\sin(\theta)}, $$ and the Fourier series $$\log(|\sin x|) = -\log(2) - \sum_{k=1}^{\infty} \frac{\cos(2kx)}{k}, \quad (x \in \mathbb{R}, \, x \ \text{not an integer multiple of} \, \pi) \, , $$ the integral can be written as
$ \begin{align} I &= \int_{-1}^1 \sqrt{1-x^2} \, U_n(x){}^2 \log \left(U_n(x){}^2\right) \, dx \\ &= \int_{0}^{\pi} \sin^{2} \left((n+1) \theta \right) \log \left(\frac{\sin^{2} \left((n+1) \theta \right)}{\sin^{2} (\theta)} \right) \, \mathrm d \theta \\ &= 2 \int_{0}^{\pi}\sin^{2} \left((n+1) \theta \right) \log \left( \frac{|\sin \left((n+1) \theta \right)|}{\sin (\theta)}\right) \, \mathrm d \theta \\ &= - 2 \int_{0}^{\pi}\sin^{2} \left((n+1) \theta \right) \sum_{k=1}^{\infty}\frac{\cos\left(2k(n+1)\theta \right)}{k} \, \mathrm d \theta+ 2 \int_{0}^{\pi}\sin^{2} \left((n+1) \theta \right) \sum_{k=1}^{\infty}\frac{\cos\left(2k\theta \right)}{k} \, \mathrm d \theta \\ &= -2 \sum_{k=1}^{\infty} \frac{1}{k} \int_{0}^{\pi} \sin^{2} \left((n+1) \theta \right)\cos\left(2k(n+1)\theta \right) \, \mathrm d \theta +2\sum_{k=1}^{\infty} \frac{1}{k} \int_{0}^{\pi} \sin^{2} \left((n+1) \theta \right)\cos\left(2k\theta \right) \, \mathrm d \theta \end{align}$
The first integral has a value of $- \frac{\pi}{4}$ if $k=1$ and $0$ otherwise.
And the second integral has a value of $-\frac{\pi}{4}$ if $k = n+1$ and $0$ otherwise.
Therefore, $$ I = -2 \left(- \frac{\pi}{4} \right) + 2 \, \frac{1}{n+1} \left(- \frac{\pi}{4} \right) = \frac{\pi}{2} \frac{n}{n+1}, $$ which agrees with the results from Maple and Mathematica.
UPDATE: There is an issue with this approach, namely the justification for switching the order of summation and integration. But I think we can get around this by using the Fourier series $$\sum_{k=1}^{\infty} \frac{r^{k} \cos(2 k \theta)}{k} = - \frac{1}{2} \log \left(1-2 r \cos (2\theta) +r^{2} \right) $$ to show that $$\int_{0}^{\pi} \sin^{2} \left((n+1) \theta \right) \log \left(\frac{1-2r \cos \left(2(n+1)\theta \right) + r^{2}}{1-2r \cos (2\theta) +r^{2}} \right) \mathrm d \theta = \frac{\pi}{2} \left(r- \frac{r^{n+1}}{n+1} \right)$$ and then taking the limit as $r \to 1^{-}$.
identifycommand and Mathematica withFindSequenceFunctioncommand. – Mariusz Iwaniuk Aug 18 '24 at 16:57