TITLE: Is it true that $\frac{1}{\pi^{2n+1}} \int_0^{\theta} \ln^{2n}\left(\frac{\sin x}{\sin\left(\theta-x\right)}\right)\,dx$ is a rational...
QUESTION [5 upvotes]: I was trying to evaluate $\displaystyle \int_0^{\frac{\pi}{6}}\ln^2\left(2\sin x\right)\,dx$ in an elementary way (no complex variable) so i have considered:
$\displaystyle \int_0^{\frac{\pi}{6}} \ln^2\left(\frac{\sin x}{\sin\left(\frac{\pi}{6}-x\right)}\right)\,dx$. 
Using lindep a function in PARI GP i have conjectured that this integral is equal to a rational times $\pi^3$*.
Then i have considered:
$\displaystyle \frac{1}{\pi^5}\int_0^{\frac{\pi}{6}} \ln^4\left(\frac{\sin x}{\sin\left(\frac{\pi}{6}-x\right)}\right)\,dx,\frac{1}{\pi^7} \int_0^{\frac{\pi}{6}} \ln^6\left(\frac{\sin x}{\sin\left(\frac{\pi}{6}-x\right)}\right)\,dx$ and it seems that these integrals are rational numbers.
then i have considered:
$\displaystyle \frac{1}{\pi^5}\int_0^{\frac{\pi}{7}} \ln^4\left(\frac{\sin x}{\sin\left(\frac{\pi}{7}-x\right)}\right)\,dx,\frac{1}{\pi^7} \int_0^{\frac{\pi}{7}} \ln^6\left(\frac{\sin x}{\sin\left(\frac{\pi}{7}-x\right)}\right)\,dx$
same things happen.
Then i have considered:
$\displaystyle \frac{1}{\pi^3}\int_0^{\sqrt{2}} \ln^2\left(\frac{\sin x}{\sin\left(\sqrt{2}-x\right)}\right)\,dx$. 
and lindep doesn't show that this number is rational. (it's not a proof).
i have tested much more values ($\frac{\pi}{7}+\frac{1}{10000}$ for example)
My question:
is it true that:
$0< \theta <\pi$, a real
for all $n$, natural integer
$\displaystyle \frac{1}{\pi^{2n+1}} \int_0^{\theta} \ln^{2n}\left(\frac{\sin x}{\sin\left(\theta-x\right)}\right)\,dx$ is a rational 
if only if $\theta=r\pi$, $0< r<1$ a rational.
*: i think i have a proof for this.
PS:
The idea of this came after reading: Evaluation of $\int_0^{\pi/3} \ln^2\left(\frac{\sin x }{\sin (x+\pi/3)}\right)\,\mathrm{d}x$

REPLY [5 votes]: The integral can be modified as
\begin{align}
 I&= \frac{1}{\pi^{2n+1}} \int_0^{\theta} \ln^{2n}\left(\frac{\sin x}{\sin\left(\theta-x\right)}\right)\,dx\\
 &=\frac{1}{\pi^{2n+1}} \int_{-\theta/2}^{\theta/2} \ln^{2n}\left(\frac{\sin \left( \theta/2+y \right)}{\sin\left(\theta/2-y\right)}\right)\,dy\\
 &=\frac{2}{\pi^{2n+1}} \int_{0}^{\theta/2} \ln^{2n}\left(\frac{\sin \left( \theta/2+y \right)}{\sin\left(\theta/2-y\right)}\right)\,dy\\
\end{align}
Denoting $\varphi=\theta/2$,
\begin{align}
 I&=\frac{2}{\pi^{2n+1}} \int_{0}^{\varphi} \ln^{2n}\left(\frac{\sin\varphi\cos y+\sin y\cos\varphi}{\sin\varphi\cos y-\sin y\cos\varphi}\right)\,dy\\
 &=\frac{2}{\pi^{2n+1}} \int_{0}^{\varphi} \ln^{2n}\left(\frac{1+\tan y\cot\varphi}{1-\tan y\cot\varphi}\right)\,dy\\
 &=\frac{2^{2n+1}}{\pi^{2n+1}} \int_{0}^{\varphi} \operatorname{arctanh}^{2n}\left(\tan y\cot\varphi\right)\,dy
\end{align}
Now, changing $\tan y=\tan\varphi \tanh u$, 
\begin{align}
 I&=\frac{2^{2n+1}\tan\varphi}{\pi^{2n+1}} \int_{0}^{\infty}\frac{u^{2n}}{1+\tan^2\varphi \tanh^2 u}\frac{du}{\cosh^2u}\\
 &=\frac{2^{2n+1}\sin\varphi\cos\varphi}{\pi^{2n+1}} \int_{0}^{\infty}\frac{u^{2n}\,du}{\cosh^2u-\sin^2\varphi}\\
 &=\frac{2^{2n+1}\sin\theta}{\pi^{2n+1}} \int_{0}^{\infty}\frac{u^{2n}\,du}{\cosh 2u+\cos2\varphi}\\
 &=\frac{\sin\theta}{\pi^{2n+1}} \int_{0}^{\infty}\frac{v^{2n}\,dv}{\cosh v-\cos(\pi-\theta)}
\end{align}
and using the integral representation of the Bernoulli polynomials DLMF:
\begin{equation}
 B_{2n+1}\left(\frac{\pi-\theta}{2\pi}\right)=(-1)^{n+1}\frac{2n+1}{(2\pi)^{2n+1}}\sin\theta\int_{0}^{\infty}\frac{v^{2n}\mathrm{d}v}{\cosh v-\cos\theta}
\end{equation} 
we obtain the closed form expression
\begin{equation}
 I=\frac{(-1)^{n+1}2^{2n+1}}{2n+1}B_{2n+1}\left(\frac{\pi-\theta}{2\pi}\right)
\end{equation} 
Thus, if $\theta=r\pi$ where $r$ is a rational, then the argument of the Bernoulli polynomial is a rational and the integral also. Reciprocally, however, other values of $0<\theta<\pi$ exist which make $ B_{2n+1}\left(\frac{\pi-\theta}{2\pi}\right)$ (and thus $I$) rational. For instance, one can check numerically that, $I_{n=1,\theta=\theta^*}=4/75$ for $\theta^*=\pi\left( 3^{-1/2}\cos\Phi+\sin\Phi \right)$, where $\Phi=3^{-1}\arctan\left( \sqrt{3}\sqrt{517}/18 \right)$(!) (This was obtained, by solving $B_3(x)=1/50$ using a CAS).