# Evaluating $\int_{\frac\pi 6}^{\frac \pi 3} \frac{\cos^2x}{x(\pi-x)}\,dx$

I am asked to find $\int_{\frac\pi 6}^{\frac \pi 3} \frac{\cos^2x}{x(\pi-x)}\,dx$ using the reflection property $\int_a^b f(x)\,dx = \int_a^bf(a+b-x)\,dx$.

After applying the formula I have $\int_{\frac\pi 6}^{\frac \pi 3} \frac{\sin^2x}{\left( \frac{\pi}{2} - x \right) \left( \frac \pi 2 + x\right)}\,dx$, or equivalently$\int_{\frac\pi 6}^{\frac \pi 3} \frac{4\sin^2x}{\pi^2-4x^2}\,dx$.

I have tried integration by parts and trigonometric identities but neither seem to have worked. I have also noticed that the integrand is even, but I don't think that will help.

I suspect I may need to use a result that I obtained from a previous question: $\int_{\frac\pi 6}^{\frac \pi 3} \frac{1}{\left( \frac{\pi}{2} - x \right) \left( \frac \pi 2 + x\right)}\,dx = \frac 1 \pi \log\frac 5 2$

Any hints would be welcome.

My bad, the integral was given to me incorrectly. It was actually $\int_{\frac\pi 6}^{\frac \pi 3} \frac{\cos^2x}{x(\pi-2x)}\,dx$.
$I =\int_{\frac\pi 6}^{\frac \pi 3} \frac{\cos^2x}{x(\pi-2x)}\,dx$
$=\int_{\frac\pi 6}^{\frac \pi 3} \frac{\cos^2\left(\frac \pi 2 - x\right)}{\left(\frac \pi 2 - x\right)2x}\,dx$
$=\int_{\frac\pi 6}^{\frac \pi 3} \frac{\sin^2\left(x\right)}{\left(\pi - 2x\right)x}\,dx$
$=\int_{\frac\pi 6}^{\frac \pi 3} \frac{1}{\left(\pi - 2x\right)x}\,dx - \int_{\frac\pi 6}^{\frac \pi 3} \frac{\cos^2\left(x\right)}{\left(\pi - 2x\right)x}\,dx$
\begin{aligned} \therefore 2I &= \int_{\frac\pi 6}^{\frac \pi 3} \frac{1}{\left(\pi - 2x\right)x}\,dx \\ &=\frac 1 \pi\int_{\frac\pi 6}^{\frac \pi 3} \frac{1}{x} + \frac{2}{\pi -2x}\,dx \,\,\,\,\mathrm{(by\,\, partial\,\, fractions)} \\ I&=\frac{1}{2\pi}\left[\log x -\log(\pi -2x)\right]^{\frac \pi 3}_{\frac\pi 6}\\ &=-\frac{1}{2\pi}\left(\log \frac \pi 6 -\log\frac{4\pi}{6} \right) \\ &=\frac{1}{\pi}\log2 \end{aligned}