<s>[INST] Evaluate $\int_{0}^{\frac{\pi}{2}}\frac{x^2}{ \sin x}dx$ I want to evaluate $$\int_{0}^{\frac{\pi}{2}}\frac{x^2}{ \sin x}dx$$
First,I tried to evaluate like this:
$$\int_{0}^{\frac{\pi}{2}}\frac{x^2}{ \sin x}dx=\int_{0}^{\frac{\pi}{2}}x^2\left(\frac{1+\cos x}{\sin x}\right)\frac{dx}{1+\cos x}=\int_{0}^{\frac{\pi}{2}}x^2\left(\frac{1+\cos x}{\sin x}\right)d\left(\frac{\sin x}{1+\cos x}\right)$$
$$=\int_{0}^{\frac{\pi}{2}}x^2d\log\left(\frac{\sin x}{1+\cos x}\right)=x^2\log\left(\frac{\sin x}{1+\cos x}\right)|_{0}^{\frac{\pi}{2}}-2\int_{0}^{\frac{\pi}{2}}x\log\left(\frac{\sin x}{1+\cos x}\right)dx$$
$$=0+2\int_{0}^{\frac{\pi}{2}}x\log\left(\frac{1+\cos x}{\sin x}\right)dx=2\int_{0}^{\frac{\pi}{2}}x\log\left(1+\cos x\right)dx-2\int_{0}^{\frac{\pi}{2}}x\log\left(\sin x\right)dx$$
$$=2\int_{0}^{\frac{\pi}{2}}x\log\cot \left(\frac{x}{2}\right)dx=8\int_{0}^{\frac{\pi}{4}}x\log\cot xdx$$
but I can't proceed next step,help me,thanks.
 [/INST] Observe we have
\begin{align}
I=\int^{\pi/2}_0 \frac{x^2}{\sin x}\ dx = \int^{\pi/2}_0 \frac{x^2}{\cos\left(\frac{\pi}{2}-x \right)}\ dx = \int^{\pi/2}_0 \frac{(\frac{\pi}{2}-u)^2}{\cos u}\ du.
\end{align}
Then using integration by parts, we see that
\begin{align}
I&=\left(\frac{\pi}{2}-u\right)^2\left\{\log\left|1 + \sin u\right|-\log|\cos u|\right\}\bigg|^{\pi/2}_0 + 2\int^{\pi/2}_0\left(\frac{\pi}{2}-u \right)\log|\sec u + \tan u|\ du\\
&= 2\pi \left(\frac{1}{2}\int_{0}^{\pi/2}\log|\sec u+\tan u|\ du \right)-\frac{7}{2}\left(\frac{4}{7}\int^{\pi/2}_0 u \log|\sec u+\tan u|\ du \right)\\
&= 2\pi G - \frac{7}{2}\zeta(3).
\end{align}
Here, I have used the facts that
\begin{align}
G= \frac{1}{2}\int_{0}^{\pi/2}\log|\sec u+\tan u|\ du
\end{align}
and
\begin{align}
\zeta(3) = \frac{4}{7}\int^{\pi/2}_0 u \log|\sec u+\tan u|\ du. 
\end{align}
See here for reference.
</s>