Q: Prove: $\frac{p}{2\pi}\int_{-\infty}^{+\infty}\frac{\sin xt}{t\cdot \sin\frac12pt}\sin([\frac xp]+\frac12) pt \, \mathrm dt=\cdots$ Suppose $p>0$, define that
$$
g(x)=\begin{cases}
p\left\lfloor\frac xp\right\rfloor+\frac p2,x\geqslant0\\\\-g(-x), x<0\end{cases}$$
Prove 
for all $x$,

$$ \frac{p}{2\pi}\int_{-\infty}^{+\infty}\sum_{n=-\lfloor x/p\rfloor}^{\lfloor x/p\rfloor}\frac{\sin ((n+\frac12)pt)}{\sin (\frac12pt)}\cdot\frac{\sin (xt)}{t} \, \mathrm dt=\frac12[g(x^+)+g(x^-)].$$

First, 
$$\sum_{n=-\lfloor x/p\rfloor}^{\lfloor x/p\rfloor}\frac{\sin ((n+\frac12)pt)}{\sin (\frac12pt)}\cdot\frac{\sin (xt)}{t}=\frac{\sin (xt)}{t\cdot  \sin(\frac12pt)} \sin\left(\left\lfloor \frac xp\right\rfloor+\frac12\right) pt ,$$
I just simplify it, then get
$$\frac{p}{2\pi}\int_{-\infty}^{+\infty}\frac{\sin (xt)}{t\cdot \sin(\frac12pt)} \sin\left(\left(\left\lfloor \frac xp\right\rfloor+\frac12\right) pt\right) \, \mathrm dt=\frac12[g(x^+)+g(x^-)].$$
However, I don't know how to continue it. I guess that it may be related to $fourier.$
Can someone help me out? Sincerely thanks.
