Evaluate $\int_0 ^{\pi}\left (\frac{\pi}{2} - x\right)\sin\left(\frac{3x}{2}\right)\csc\left(\frac{x}{2}\right) dx$ How would you evaluate the  integral 
$$\int_0 ^{\pi} \left(\frac{\pi}{2} - x\right)\sin\left(\frac{3x}{2}\right)\csc\left(\frac{x}{2}\right) dx$$
The answer from Wolfram is $0$. 
Would you use a substitution or do it by parts? Would making the substitution $u=\dfrac x2$ help?

Using the triple angle formula for sine and the power reduction formula for the square of cosine, we have:
$$\begin{align}
\sin{\left(3\theta\right)}
&=3\sin{\theta}-4\sin^3{\theta}\\
&=\sin{\theta}\left(3-4\sin^2{\theta}\right)\\
&=\sin{\theta}\left(4\cos^2{\theta}-1\right)\\
&=\sin{\theta}\left[4\left(\frac{1+\cos{\left(2\theta\right)}}{2}\right)-1\right]\\
&=\sin{\theta}\left[1+2\cos{\left(2\theta\right)}\right]\\
\implies \sin{\left(3\theta\right)}\csc{\left(\theta\right)}&=1+2\cos{\left(2\theta\right)};~\theta\in\mathbb{R}\land\frac{\theta}{\pi}\notin\mathbb{Z}.\\
\end{align}$$
Letting $\theta=\frac{x}{2}$ then gives us the identity,
$$\sin{\left(\frac{3x}{2}\right)}\csc{\left(\frac{x}{2}\right)}=1+2\cos{x};~x\in(2k\pi,2(k+1)\pi),k\in\mathbb{Z}.$$
Substituting $u=\frac{\pi}{2}-x$ transforms the interval of integration into a symmetric interval about the origin, and so the integral of the odd component of the integrand automatically becomes zero:
$$\begin{align}
\mathcal{I}
&=\int_{0}^{\pi}\left(\frac{\pi}{2}-x\right)\sin{\left(\frac{3x}{2}\right)}\csc{\left(\frac{x}{2}\right)}\,\mathrm{d}x\\
&=\int_{0}^{\pi}\left(\frac{\pi}{2}-x\right)\left(1+2\cos{x}\right)\,\mathrm{d}x\\
&=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}u\left(1+2\sin{u}\right)\,\mathrm{d}u\\
&=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}u\,\mathrm{d}u+2\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}u\sin{u}\,\mathrm{d}u\\
&=0+4\int_{0}^{\frac{\pi}{2}}u\sin{u}\,\mathrm{d}u=4\int_{0}^{\frac{\pi}{2}}u\sin{u}\,\mathrm{d}u.\\
\end{align}$$
At this stage, we know that the integral $\mathcal{I}$ cannot be zero because $u\sin{u}$ is positive on $u\in(0,\frac{\pi}{2}]$. Finally, evaluating integrals of products powers and trig functions is a common application of integration by parts, of which the last integral above is an easy example:
$$\begin{align}
\mathcal{I}
&=4\int_{0}^{\frac{\pi}{2}}u\sin{u}\,\mathrm{d}u\\
&=4\left[\left[-u\cos{u}\right]_{0}^{\frac{\pi}{2}}-\int_{0}^{\frac{\pi}{2}}(-1)\cos{u}\,\mathrm{d}u\right]\\
&=4\left[-\frac{\pi}{2}\cdot0+0\cdot1+\int_{0}^{\frac{\pi}{2}}\cos{u}\,\mathrm{d}u\right]\\
&=4\left[0+\left[\sin{u}\right]_{0}^{\frac{\pi}{2}}\right]\\
&=4\left[1-0\right]=4.~\blacksquare\\
\end{align}$$
