Sine series and cosine series
In the theory of series in mathematical analysis, there is a common type of problem involving sums such as
$$\cos\theta+\cos 2\theta+\dots+\cos n\theta\tag{1}$$
and
$$\sin\theta+\sin 2\theta+\dots+\sin n\theta\tag{2}$$
that is, sums of sine or cosine series, where the main task is usually to prove that the sum is bounded. To prove this, one typically works out a closed form for the partial sum. Of course, this series also plays an important role in physics, where it represents the resultant amplitude of $n$ identical oscillators. In our mathematical analysis textbooks, the standard approach is to multiply the series by an extra factor $\sin\frac{\theta}{2}$, and then finish the derivation using product-to-sum formulas. Admittedly, if one restricts oneself to the real numbers, this might indeed be the only available trick. But the computation involved is not exactly simple, nor is it easy to remember — back in my sophomore year, this used to give me quite a headache. A few days ago, while reading one of Feynman's books, I came across a derivation technique using complex numbers. Strangely enough, the trick is so simple that writing it up almost feels like padding out this post — yet somehow I had never noticed it before! I guess my skills still need a lot more honing. more
Sometimes computing more things all at once turns out to be quicker than computing just one part in isolation. Let's consider $(1)$ and $(2)$ together, and compute
$$\cos\theta+\cos 2\theta+\dots+\cos n\theta+i\left(\sin\theta+\sin 2\theta+\dots+\sin n\theta\right)$$
Using Euler's formula, the expression above becomes
$$e^{i\theta}+e^{2i\theta}+\dots+e^{ni\theta}$$
which is nothing but a geometric series! It is easy to obtain
$$e^{i\theta}\left(\frac{e^{ni\theta}-1}{e^{i\theta}-1}\right)=e^{(n+1)i\theta /2}\left( \frac{e^{ni\theta /2} - e^{ - n i\theta /2}}{e^{i\theta /2} - e^{ - i\theta /2}} \right)$$
and the result inside the brackets is
$$\frac{\sin\frac{n\theta}{2}}{\sin\frac{\theta}{2}}$$
so altogether the result is
$$\left(\cos\frac{(n+1)\theta}{2}+i\sin\frac{(n+1)\theta}{2}\right)\frac{\sin\frac{n\theta}{2}}{\sin\frac{\theta}{2}}$$
By matching real and imaginary parts, we get
$$\cos\theta+\cos 2\theta+\dots+\cos n\theta=\cos\frac{(n+1)\theta}{2}\frac{\sin\frac{n\theta}{2}}{\sin\frac{\theta}{2}}$$
and
$$\sin\theta+\sin 2\theta+\dots+\sin n\theta=\sin\frac{(n+1)\theta}{2}\frac{\sin\frac{n\theta}{2}}{\sin\frac{\theta}{2}}$$
The whole process is so concise, almost done in one stroke. There's nothing particularly deep or mysterious about it, which is exactly why it's so strange that I never noticed it until now.
Similarly, one can also derive the summation formula for
$$\cos(\omega+\theta)+\cos(\omega+2\theta)+\dots+\cos (\omega+n\theta)$$
(it just requires multiplying by one extra phase factor~~)
Translated automatically with claude-sonnet-5; all equations are reproduced verbatim from the source. Copyright remains with the original author.