I saw a video of the solution to this problem yesterday and I understand all of it but I wanted to confirm if I am supposed to be able to solve it that way. Here's the solution; $$ \sum_{k=1}^{n} \sin (kx)$$ $$ \sin(x) = \frac{e^{ix}-e^{-ix}}{2i} $$ $$ \sin(kx) = \frac{e^{ikx}-e^{-ikx}}{2i} $$ $$ \sum_{k=1}^{n} \sin(kx) = \frac{1}{2i}\left(\sum_{k=1}^{n} e^{ikx}-\sum_{k=1}^{n} e^{-ikx}\right) $$ $$ = \frac{1}{2i} \left(\sum_{k=1}^{n} \left(e^{ix}\right) ^ {k}-\sum_{k=1}^{n}\left(e^{-i x}\right)^{k}\right) $$ $$ \text { Note: } \sum_{k=1}^{n} x^{k}=\frac{x-x^{n+1}}{1-x}$$ $$ \sum_{k=1}^{n} \sin (kx)=\frac{1}{2i}\left(\frac{e^{ix}-e^{(n+1)ix}}{1-e^{i x}}-\frac{e^{-ix}-e^{-(n+1)ix}}{1-e^{-ix}}\right) $$ $$ =\frac{1}{2i}\left(\frac{e^{i x}\left(1-e^{i n x}\right)}{e^{\frac{ix}{2}}\left(e^{-\frac{ix}{2}}-e^{\frac{ix}{2}}\right)}-\frac{e^{-i x}\left(e^{-i x}-e^{-i m x}\right)}{e^{-\frac{ix}{2}}\left(e^{\frac{ix}{2}}-e^{-\frac{ix}{2}}\right)}\right) $$ $$ =\frac{1}{2i}\left(\frac{e^{\frac{ix}{2}}\left(1-e^{inx}\right)}{-2i \sin \left(\frac{x}{2}\right)}-\frac{e^{-\frac{ix}{2}}\left(1-e^{-inx}\right)}{2i \sin \left(\frac{x}{2}\right)}\right) $$ $$ =\frac{1}{4} \cdot \frac{e^{\frac{ix}{2}}-e^{ix\left(n+\frac{1}{2}\right)}+e^{-\frac{ix}{2}}-e^{-ix\left(n+\frac{1}{2}\right)}}{\sin \left(\frac{x}{2}\right)} $$ $$ =\frac{1}{4} \cdot \frac{e^{\frac{ix}{2}}+e^{-\frac{ix}{2}}-e^{ix\left(n+\frac{1}{2}\right)}-e^{-ix\left(n+\frac{1}{2}\right)}}{\sin \left(\frac{x}{2}\right)} $$ $$ =\frac{1}{4} \cdot \frac{2\cos \left(\frac{x}{2}\right) -2 \cos \left(x\left(n+\frac{1}{2}\right)\right)}{\sin \left(\frac{x}{2}\right)} $$ $$ =\frac{1}{2} \cdot \frac{\cos \left(\frac{x}{2}\right)-\cos \left(nx+\frac{x}{2}\right)}{\sin \left(\frac{x}{2}\right)} $$
My question is that since the formula for geometric sum doesn't work if the geometric ratio is 1, can I use it in this solution as $\mid e^{ix}\mid$ is always 1? Or is there another solution to the question?