$$$$
\begin{align*}
\int_0^{\frac{\pi}{2}} \sin^2 x \ln \cos x dx~=~?
\end{align*}
解説
\begin{align*}
&\int_0^{\frac{\pi}{2}} \sin^2 x \ln \cos x dx \\
&=\int_0^{\frac{\pi}{2}} \ln \cos x dx - \int_0^{\frac{\pi}{2}} \cos^2 x \ln \cos x dx \\
&=\int_0^{\frac{\pi}{2}} \left. \frac{\partial}{\partial t} \cos^t x \right|_{t=0} dx - \int_0^{\frac{\pi}{2}} \left. \frac{\partial}{\partial u} \cos^u x \right|_{u=2} dx \\
&=\left. \frac12 \frac{d}{dt} B\left(\frac{t+1}{2}, \frac12\right) \right|_{t=0} - \left. \frac12 \frac{d}{du} B\left(\frac{u+1}{2}, \frac12\right) \right|_{u=2}\\
&=\left. \frac14 B\left(\frac{t+1}{2}, \frac12\right)\left( \psi\left(\frac{t+1}{2}\right) - \psi\left(\frac{t}{2} + 1\right)\right)\right|_{t=0} \\
&~~~~~- \left. \frac14 B\left(\frac{u+1}{2}, \frac12\right)\left( \psi\left(\frac{u+1}{2}\right) - \psi\left(\frac{u}{2} + 1\right)\right)\right|_{u=2}\\
&=\frac14 B\left(\frac12, \frac12\right)\left( \psi\left(\frac12\right) - \psi(1)\right) \\
&~~~~~- \frac14 B\left(\frac32, \frac12\right)\left( \psi\left(\frac32\right) - \psi(2)\right)\\
&=\frac{\pi}{4}(-2\ln 2 - \gamma + \gamma) \\
&~~~~~- \frac14 \Gamma\left(\frac32\right)\Gamma\left(\frac12\right)\left(\psi\left(\frac12\right) + 2 - \psi(1) - 1\right)\\
&=-\frac{\pi}{2}\ln 2 - \frac{\pi}{8}(-2\ln 2 + 1) \\
&=-\frac{3\pi}{4}\ln 2 - \frac{\pi}{8}
\end{align*}
実は,2行目に現れる積分
\begin{align*}
\int_0^{\frac{\pi}{2}} \ln \cos x dx
\end{align*}
は高校範囲で解くこともできます.ぜひチャレンジしてみてください!