I was going through a solid-state textbook when the following result appeared in the text. The author states that
$$\sum_{p = 1}^{\infty}\dfrac{\sin(Qpa)}{p} \sin\left(\dfrac{qpa}{2}\right)^2 =\frac{\pi}{4} \theta(Q-q)$$
where $\theta$ denotes the Heaviside step function. I have no idea why this should be true as I was not able to tackle this with my (limited) ability in Fourier series. I would appreciate if someone could provide a proof of this or some intuition as to why this should be the case.
Edit: As a way of convincing myself of the truth of the formula i have plotted the above sum as a function of q, with Q = 2 and the sum running from 1 to pmax = 1, 10, 50 in blue green and orange respectively and the results seem to make the formula plausible. This is of course far from a proof.

I think the OP has it backward. The sum is easily addressed by using a half-angle formula, and is equal to
$$\frac12 \sum_{p=1}^{\infty} \frac{\sin{(Q a p)}}{p} - \frac12 \sum_{p=1}^{\infty} \frac{\sin{(Q a p)}}{p} \cos{(q a p)} $$
Consider the Fourier series
$$f(x) = \sum_{p=-\infty}^{\infty} \frac{\sin{(k p)}}{p} \cos{(x p)} = \cases{\pi \quad |x| \lt k \\ 0 \quad |x| \gt k} $$
Thus,
$$\frac12 \sum_{p=1}^{\infty} \frac{\sin{(Q a p)}}{p} = \frac{\pi}{4} - \frac14 $$
$$\frac12 \sum_{p=1}^{\infty} \frac{\sin{(Q a p)}}{p} \cos{(q a p)} = \frac{\pi}{4} \theta(Q a-q a) - \frac14 $$
We can ignore the factor $a$ inside the Heaviside. Thus, the sum in question is equal to