<s>[INST] $\left(\frac{\sin(\frac{n\theta}{2})}{\sin(\frac{\theta}{2})}\right)^2=\left|\sum_{k=1}^{|n|}e^{ik\theta}\right|^2$ I'm having trouble proving $$\left(\frac{\sin(\frac{n\theta}{2})}{\sin(\frac{\theta}{2})}\right)^2=\left|\sum_{k=1}^{|n|}e^{ik\theta}\right|^2$$ where $n\in\mathbb{Z}$ and $\theta\in\mathbb{R}$. Can anyone suggest a hint?
 [/INST] Using the sum of sines and cosines with arguments in arithmetic progression as given above: if $\theta\ne0$ and let $\varphi =0$, then we have,
\begin{align} &S =\sin{(\theta)} + \sin{(2\theta)} + \cdots + \sin{(n\theta)} = \frac{\sin{\left(\frac{(n+1) \theta}{2}\right)} \cdot \sin{(\frac{n \theta}{2})}}{\sin{\frac{\theta}{2}}} \quad\hbox{and}\\[10pt] &C =\cos{(\theta)} + \cos{(2\theta)} + \cdots+ \cos{(n\theta)} = \frac{\cos{\left(\frac{(n+1) \theta}{2}\right)} \cdot \sin{(\frac{n \theta}{2})}}{\sin{\frac{\theta}{2}}}. \end{align} 
From Euler's Formula and the definition of absolute value of a complex number, we can write $$\left|\sum_{k=1}^{|n|}e^{ik\theta}\right|^2 = C^2 + S^2$$ 
$$= \frac{\sin{\left(\frac{n \theta}{2}\right)}^2}{\sin{\frac{\theta}{2}}^2}\cdot\left(\cos{(\frac{(n+1) \theta}{2})}^2 + \sin{(\frac{(n+1) \theta}{2})}^2\right)$$
$$ = \left(\frac{\sin{\frac{n \theta}{2}}}{\sin{\frac{\theta}{2}}}\right)^2$$
</s>