integration of $\int_{-\pi}^{\pi}\cos(x)\frac{1}{\sqrt\pi}\sin(\frac{n(x+\pi)}{2})\frac{1}{\sqrt\pi}\sin(\frac{m(x+\pi)}{2})dx$ I'm working on solving the integration 
$\int_{-\pi}^{\pi}\cos(x)\frac{1}{\sqrt\pi}\sin(\frac{n(x+\pi)}{2})\frac{1}{\sqrt\pi}\sin(\frac{m(x+\pi)}{2})dx$ and my results after using the integration by parts for different cases for the integers $n$ and $m$ as the following:
$$
\int_{-\pi}^{\pi}\cos(x)\frac{1}{\sqrt\pi}\sin(\frac{n(x+\pi)}{2})\frac{1}{\sqrt\pi}\sin(\frac{m(x+\pi)}{2})dx=
\begin{cases}
0,& \text{for } n\neq m \& (n-m)^2\neq4,\\
0,& \text{for } n=m\neq1,\\
\frac{1}{2},& \text{for }n=m=1,\\
-\frac{1}{2},& \text{for } (n-m)^2=4. \\
\end{cases}
$$
Is there any way to make sure I have the correct results?
appreciate any help:)
here is a case when $n=m\neq1:$
using the identity:
$sin(A)sin(B)=\frac{1}{2}[cos(A-B)-cos(A+B)]$
I get:$\int_{-\pi}^{\pi}\cos(x)\frac{1}{\sqrt\pi}\sin(\frac{n(x+\pi)}{2})\frac{1}{\sqrt\pi}\sin(\frac{m(x+\pi)}{2})dx=\frac{1}{2\pi}\int_{-\pi}^{\pi}cos(x)cos(\frac{n-m}{2}(x+\pi))-cos(x)cos(\frac{n+m}{2}(x+\pi))dx$ 
using the integration by parts twice for the first term:
$\begin{align}\int_{-\pi}^{\pi}cos(x)cos(\frac{n-m}{2}(x+\pi))dx&=[\frac{2}{n-m}cos(x)sin(\frac{n-m}{2}(x+\pi))]_{-\pi}^{\pi}+\frac{2}{n-m}\int_{-\pi}^{\pi}sin(x)sin(\frac{n-m}{2}(x+\pi))dx\\&=(\frac{1}{(1-\frac{4}{(n-m)^2})})\bigg[[\frac{2}{n-m}cos(x)sin(\frac{n-m}{2}(x+\pi))]_{-\pi}^{\pi}-\frac{4}{(n-m)^2}[sin(x)cos(\frac{n-m}{2}(x+\pi))]_{-\pi}^{\pi}\bigg]\\&=0.\end{align}$
Similarly for the other term:
$\int_{-\pi}^{\pi}cos(x)cos(\frac{n+m}{2}(x+\pi))dx=0$
Hence for $n=m\neq1:$
$\int_{-\pi}^{\pi}\cos(x)\frac{1}{\sqrt\pi}\sin(\frac{n(x+\pi)}{2})\frac{1}{\sqrt\pi}\sin(\frac{m(x+\pi)}{2})dx=0$
 A: We have $$2\sin\frac{n(x+\pi)}2\sin\frac{m(x+\pi)}2=\cos\frac{(n-m)(x+\pi)}2-\cos\frac{(n+m)(x+\pi)}2$$ and \begin{align}2\cos\frac{(n\pm m)(x+\pi)}2\cos x&=\cos\frac{(n\pm m)(x+\pi)-x}2+\cos\frac{(n\pm m)(x+\pi)+x}2\\&=\cos\frac{(n\pm m-1)x+(n\pm m)\pi}2+\cos\frac{(n\pm m+1)x+(n\pm m)\pi}2\end{align} so $$\cos x\sin\frac{n(x+\pi)}2\sin\frac{m(x+\pi)}2\\=\\\frac14\left[\left(\cos\frac{(n-m-1)x+(n-m)\pi}2+\cos\frac{(n-m+1)x+(n-m)\pi}2\right)-\left(\cos\frac{(n+m-1)x+(n+m)\pi}2+\cos\frac{(n+m+1)x+(n+m)\pi}2\right)\right].$$ Thus $$\int_{-\pi}^\pi\cos x\sin\frac{n(x+\pi)}2\sin\frac{m(x+\pi)}2\,dx=\frac12\left[\frac{\sin\frac{(n-m-1)x+(n-m)\pi}2}{n-m-1}+\frac{\sin\frac{(n-m+1)x+(n-m)\pi}2}{n-m+1}-\frac{\sin\frac{(n+m-1)x+(n+m)\pi}2}{n+m-1}-\frac{\sin\frac{(n+m+1)x+(n+m)\pi}2}{n+m+1}\right]_{-\pi}^\pi=\frac12\left[\frac{\sin\frac{(2(n-m)-1)\pi}2}{n-m-1}+\frac{\sin\frac{(2(n-m)+1)\pi}2}{n-m+1}-\frac{\sin\frac{(2(n+m)-1)\pi}2}{n+m-1}-\frac{\sin\frac{(2(n+m)+1)\pi}2}{n+m+1}\right]-\frac12\left[\frac{1}{n-m-1}-\frac{1}{n-m+1}-\frac{1}{n+m-1}+\frac{1}{n+m+1}\right]$$ ...
