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?
 A: Here are the steps
$$ \int_0 ^{\pi} \left(\frac{\pi}{2} - x\right)\sin\left(\frac{3x}{2}\right)\csc\left(\frac{x}{2}\right) dx $$
$$= \int_0 ^{\pi} \left(\frac{\pi}{2} - x\right)\left(\frac{\sin\left(\frac{3x}{2}\right)}{\sin\left(\frac{x}{2}\right)}\right) dx $$
$$= \int_0 ^{\pi} \left(\frac{\pi}{2} - x\right)\left(\frac{3\sin\left(\frac{x}{2}\right)-4\sin^3\left(\frac{x}{2}\right)}{\sin\left(\frac{x}{2}\right)}\right) dx $$
$$= \int_0 ^{\pi} \left(\frac{\pi}{2} - x\right)\left(3-4\sin^2\left(\frac{x}{2}\right)\right) dx $$
$$= \int_0 ^{\pi} \left(\frac{\pi}{2} - x\right)\left(3-4\left(\frac{1-\cos(x)}{2}\right)\right) dx $$
$$= \int_0 ^{\pi} \left(\frac{\pi}{2} - x\right)\left(3-2\left(1-\cos x\right)\right) dx $$
$$= \int_0 ^{\pi} \left(\frac{\pi}{2} - x\right)\left(1+2\cos x\right) dx $$
$$= \frac{\pi}{2}\int_0 ^{\pi}dx+\pi \int_0 ^{\pi}\cos x\ dx -\int_0^{\pi}x\ dx -2\int_0^{\pi}x\cos x\ dx $$
$$= \frac{\pi}{2}\bigg[x\bigg]_0 ^{\pi}+\pi \bigg[\sin x\bigg]_0 ^{\pi}-\bigg[\frac{x^2}{2}\bigg]_0^{\pi} -2\bigg[x\sin x+\cos x\bigg]_0^{\pi} $$
$$= \frac{\pi^2}{2}+\pi\sin \pi-\frac{\pi^2}{2}-2\bigg(\pi\sin \pi+\cos \pi-1\bigg) $$
$$= \pi\sin \pi-2\bigg(\pi\sin \pi+\cos \pi-1\bigg) $$
$$= 0-2\bigg(0-1-1\bigg) = -2\bigg(-2\bigg) =4$$
A: 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}$$
A: Hint
Note that:
$$\sin (3x/2) \csc (x/2) = 1+2\cos x$$
Then by integration by parts you easily get the result, ($4$ not $0$ btw).
