Summation of $\sum_{r=1}^n \sin(2r-1)\theta$

In a CIE A Level Further Mathematics question paper, the following question appeared:

By considering $$\sum_{r=1}^n z^{2r-1}$$ where $$z=\cos\theta +i\sin\theta$$, show that if $$\sin ≠ 0$$,

$$\sum_{r=1}^n \sin(2r-1)\theta =\frac{\sin^2n\theta}{\sin\theta}$$

My attempt at solving this: $$\sum_{r=1}^n z^{2r-1}=z+z^3+z^5+...z^{2n-1}=\frac{z((z^2)^n-1)}{z^2-1}$$ Then, expanding the brackets and dividing the numerator and denominator by $$z$$, $$\frac{z^{2n}-1}{z-z^{-1}}$$ Applying de Moivre's theorem, we get $$\frac{\cos(2n\theta)+i\sin(2n\theta)-1}{2i\sin\theta}$$ Since we only need the imaginary part, $$\operatorname{Im}\left(\sum_{r=1}^n z^{2r-1}\right)=\frac{\cos(2n\theta)-1}{2\sin\theta}$$ Lastly, applying the double angle formula, $$\frac{-\sin^{2}(n\theta)}{\sin\theta}$$ Maybe I'm being completely oblivious to one single elementary error, but what mistake have I made to get a negative sign?

• Consider $\sum \sin(2r-1)\theta = \sum \Im e^{(2r-1)\theta i} = \Im \sum e^{(2r-1)\theta i}$.
– Chia
Commented Dec 30, 2022 at 2:47
• Is it because $1/i=-i$? (The line starting with "Since we only need the imaginary part...") Commented Dec 30, 2022 at 3:06

\eqalign{ \Im\left(\frac{\cos\left(2n\theta\right)+i\sin\left(2n\theta\right)-1}{2i\sin\left(\theta\right)}\right) &= \Im\left(\frac{\cos\left(2n\theta\right)}{2i\sin\left(\theta\right)}+\frac{\sin\left(2n\theta\right)}{2\sin\left(\theta\right)}-\frac{1}{2i\sin\left(\theta\right)}\right) \cr &= \Im\left(\frac{\sin\left(2n\theta\right)}{2\sin\left(\theta\right)}+\frac{i}{2\sin\left(\theta\right)}-\frac{i\cos\left(2n\theta\right)}{2\sin\left(\theta\right)}\right) \cr &= \frac{1}{2\sin\left(\theta\right)}-\frac{\cos\left(2n\theta\right)}{2\sin\left(\theta\right)} \cr &= \frac{1-\cos\left(2n\theta\right)}{2\sin\left(\theta\right)} \cr &= \frac{\sin^{2}\left(n\theta\right)}{\sin\left(\theta\right)}. } Maybe there was a missing negative in your attempt.
We have $$\frac{\cos(2n\theta)+i\sin(2n\theta)-1}{2i\sin\theta} = \frac{\sin(2n\theta)}{2\sin(\theta)} + \frac{1}{i}\frac{\cos(2n \theta) - 1}{2 \sin\theta}.$$ Since $$\frac1i = -i$$, the imaginary part of the above quantity will be $$\frac{1 - \cos(2n \theta)}{2 \sin\theta}$$. You have written the negative of that.