# Sum of $\sum_{n=1}^{a}\sin\left(\left(2n+1\right)x\right)$

Why does $$\lim_{a\to\infty}\sum_{n=1}^{a}\sin\left(\left(2n+1\right)x\right)$$ seem to "fill in" the area between the curves $$-\sin(x)$$ and $$\cot(x)\cos(x)$$? The picture shows what I mean, with the green curve being the summation up to around 26 terms, and the black curves being $$-\sin(x)$$ and $$\cot(x)\cos(x)$$. I only went up to $$a=26$$ in the image, but as $$a$$ increases, it only fills the area in between the black curves even more thoroughly.

• There's a very similar question here, you might be able to apply the techniques mentioned there to your problem: math.stackexchange.com/questions/1172449/… Oct 2, 2023 at 14:24
• You can expect a closed-form representation of your sum (truncated at $n=a$) that involves a high-frequency term (like $\sin ax$) times a modulating function (that essentially defines your envelope). Oct 2, 2023 at 14:47

Let $$f_a(x) = \sum_{n=1}^a \sin((2n + 1)x).$$ According to Wolfram Alpha, we may simplify this to: $$f_a(x) = \frac{1}{2}\csc(x)(\cos(2x)-\cos(2(a+1)x)).$$ While I have no wish to write out the steps explicitly, on can find this closed form by observing that $$f_a(x)$$ is the imaginary part of the complex geometric series $$\sum_{n=1}^a e^{(2n+1)xi},$$ which can be explicitly computed and with enough effort, the imaginary part may be extracted.
Let us assume that $$0 < x < \pi$$. From the picture, we expect that $$f_a(x) \ge -\sin(x)$$, or equivalently, given $$\sin(x) > 0$$, $$\cos(2x) - \cos(2(a+1)x) + 2\sin^2(x) \ge 0,$$ and given $$\cos(2x) = 1 - 2\sin^2(x)$$, it is further equivalent to: $$\cos(2(a+1)x) \le 1.$$ Note that not only is this true, but equality will be achieved on the interval $$(0, \pi)$$ a number of times proportional to $$a$$, and that these roots will be evenly-spaced. Following the above argument in reverse, this means that $$f_a(x) \ge -\sin(x)$$, but with equality at precisely the same points. That explains the increasingly dense clustering of points where $$f_a(x) = -\sin(x)$$ along $$(0, \pi)$$.
We also can see that $$f_a(x) \le \frac{\cos^2(x)}{\sin(x)}$$. Once again, given $$\sin(x) > 0$$, the above is equivalent to, $$\cos(2(a + 1)x) - 2\cos^2(x) - \cos(2x) \ge 0,$$ i.e. $$\cos(2(a + 1)x) \ge -1.$$ Once again, the inequality is achieved at regularly-spaced points, with number proportional to $$a$$. And, once again, this pattern of equality follows back to $$f_a(x) \le \frac{\cos^2(x)}{\sin(x)}$$.
On $$\pi < x < 2\pi$$, we obtain the reverse inequalities, as on this new interval, $$\sin(x) < 0$$. The same proofs work, so long as we begin with the opposite inequalities. The same pattern of equality will still hold.
Note that $$f_a$$ has a period of $$2\pi$$, so the observed patterns continue to hold on other intervals of the form $$(2n\pi, (2n+1)\pi)$$.
So, we see that $$f_a$$ bounces between the two curves, with frequency proportional to $$a$$. Because $$f_a$$ is continuous (from the original series representation), we know, from the intermediate value theorem, that every function value will be achieved between the two curves, between each "bounce". As the bounces get more frequent, it will naturally appear that the function is filling the space between the curves.