<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] As pointed out within the other answers we want to prove that

$$\mathfrak{I}=\int_0^{\pi/2}\frac{x^2}{\sin x}~dx=2\pi G-\frac72\zeta(3)$$

As the OP showed $\mathfrak{I}$ can be reduced to a linear combination of $x$ and the function $\log(\cot x)$
$$\mathfrak{I}=\int_0^{\pi/2}\frac{x^2}{\sin x}~dx=8\int_0^{\pi/4}x\log(\cot x)~dx$$
By applying the definition of the cotangent function followed up by the usage of the well-known Fourier series expansions of $\log(\cos x)$ and $\log(\sin x)$ this can be further simplified. Therefore we get
$$\small\begin{align}
\mathfrak{I}=8\int_0^{\pi/4}x\log(\cot x)~dx&=8\left[\int_0^{\pi/4}x\log(\cos x)~dx-\int_0^{\pi/4}x\log(\sin x)~dx\right]\\
&=8\left[\int_0^{\pi/4}x\left(-\log(2)-\sum_{n=1}^{\infty}(-1)^n\frac{\cos(2nx)}{n}\right)~dx-\int_0^{\pi/4}x\left(-\log(2)-\sum_{n=1}^{\infty}\frac{\cos(2nx)}{n}\right)~dx\right]\\
&=8\left[-\sum_{n=1}^{\infty}\frac{(-1)^n}{n}\underbrace{\int_0^{\pi/4}x\cos(2nx)~dx}_I+\sum_{n=1}^{\infty}\frac{1}{n}\underbrace{\int_0^{\pi/4}x\cos(2nx)~dx}_I\right]\\
\end{align}$$
The inner integral $I$ can be easily evaluated using IBP which leads to
$$I=\int_0^{\pi/4}x\cos(2nx)~dx=\frac{\pi}{8n}\sin\left(n\frac{\pi}2\right)-\frac1{(2n)^2}$$
Plugging this into our original formula and followed by a little bit of algebraic manipulation we get
$$\small\begin{align}
\mathfrak{I}&=8\left[-\sum_{n=1}^{\infty}\frac{(-1)^n}{n}\left(\frac{\pi}{8n}\sin\left(n\frac{\pi}2\right)-\frac1{(2n)^2}\right)+\sum_{n=1}^{\infty}\frac{1}{n}\left(\frac{\pi}{8n}\sin\left(n\frac{\pi}2\right)-\frac1{(2n)^2}\right)\right]\\
&=2\left[\sum_{n=1}^{\infty}\frac{(-1)^n}{n^3}-\sum_{n=1}^{\infty}\frac{1}{n^3}\right]+\pi\left[\sum_{n=1}^{\infty}\frac{1}{n^2}\sin\left(n\frac{\pi}2\right)-\sum_{n=1}^{\infty}\frac{(-1)^n}{n^2}\sin\left(n\frac{\pi}2\right)\right]
\end{align}$$
The first terms can be evaluated in terms of the Riemann Zeta Function $\zeta(s)$ and the Dirichlet Eta Function $\eta(s)$ whereas for the second term we have to consider some basic properties of the Sine function. For $n\in\mathbb{N}>0$ the function $\sin\left(n\frac{\pi}2\right)$ will be zero for all even $n$ and $-1$ and $1$ respectively for odd $n$ starting with $\sin\left(\frac{\pi}2\right)=1$ for $n=1$. Therefore all even terms vanish while the odd ones will remain with a oscillating negative sign. This leads to
$$\small\begin{align}
\mathfrak{I}&=2\left[\sum_{n=1}^{\infty}\frac{(-1)^n}{n^3}-\sum_{n=1}^{\infty}\frac{1}{n^3}\right]+\pi\left[\sum_{n=1}^{\infty}\frac{1}{n^2}\sin\left(n\frac{\pi}2\right)-\sum_{n=1}^{\infty}\frac{(-1)^n}{n^2}\sin\left(n\frac{\pi}2\right)\right]\\
&=2[-\eta(3)-\zeta(3)]+\pi\left[\sum_{n=0}^{\infty}\frac{1}{(2n+1)^2}(-1)^n-\sum_{n=0}^{\infty}\frac{(-1)^{2n+1}}{(2n+1)^2}(-1)^n\right]\\
&=-2[(1-2^{-2})\zeta(3)+\zeta(3)]+2\pi\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)^2}\\
\Leftrightarrow\mathfrak{I}&=-\frac72\zeta(3)+2\pi G
\end{align}$$
where within the last step the functional relation between the Riemann Zeta Function and the Dirichlet Eta Function aswell as the series defintions of Catalan's Constant $G$ where used.
</s>