Algebra of trigonometry and some limits I am singlehandedly trying to get through a book on divergent series, however one sequence is really strange and I cant seem to understand what the authors use to come to these conclusions!
Imagine the following is our sum. ($0 < x < 2{\pi}$)

As the authors attempt to determine the mean of the partial sums, they go on to do the following:

Is there any way to understand any of the following steps, including the determination of the limit as $n$ approaches positive infinity?
Thanks a lot for your help!
 A: Rewrite
$$
S_n+\frac{1}{2}=\frac{\sin\left(n+\dfrac{1}{2}\right)x}{2\sin\dfrac{x}{2}}
$$
Then
$$
\sum_{m=1}^n \left(S_m+\frac{1}{2}\right)=
\frac{1}{2\sin(x/2)}\sum_{m=1}^n\sin\left(m+\frac{1}{2}\right)x
$$
or
$$
\frac{n}{2}+\sum_{m=1}^n S_m=
\frac{1}{2\sin(x/2)}\sum_{m=1}^n\sin\left(m+\frac{1}{2}\right)x
$$
that can also be rewritten as
$$
4\sin^2\frac{x}{2}\left(\frac{n}{2}+\sum_{m=1}^n S_m\right)=
\sum_{m=1}^n 2\sin\frac{x}{2}\sin\left(m+\frac{1}{2}\right)x
$$
Now we can recall that
$$
2\sin\frac{x}{2}\sin\left(m+\frac{1}{2}\right)x=\cos mx-\cos(m+1)x
$$
and therefore
$$
\sum_{m=1}^n2\sin\frac{x}{2}\sin\left(m+\frac{1}{2}\right)x=
\sum_{m=1}^n(\cos mx-\cos(m+1)x)=\cos x-\cos(n+1)x
$$
(by telescoping).
Hence
$$
4\sin^2\frac{x}{2}\left(\frac{n}{2}+\sum_{m=1}^n S_m\right)=
\cos x-\cos(n+1)x
$$
Divide both sides by $n$:
$$
4\sin^2\frac{x}{2}\left(\frac{1}{2}+\frac{1}{n}\sum_{m=1}^n S_m\right)=
\frac{\cos x-\cos(n+1)x}{n}
$$
Since $0<x<2\pi$, we know that $\sin(x/2)\ne0$ and so
$$
\frac{1}{2}+\lim_{n\to\infty}\frac{1}{n}\sum_{m=1}^n S_m=0
$$
because
$$
\lim_{n\to\infty}\frac{\cos x-\cos(n+1)x}{n}=0
$$
as the numerator is bounded.
A: let us pick a small $n$ and try what they are doing. i will pick $n = 10.$  we have 
$$S_1 = \frac{\sin(3x/2) - \sin (x/2)}{2\sin x/2}, S_2 = \frac{\sin(5x/2) - \sin (x/2)}{2\sin x/2}, \cdots, S_{10}=\frac{\sin(21x/2) - \sin (x/2)}{2\sin x/2} $$
now we can compute $$\begin{align} S &= 2\sin^2(x/2)\left(S_1 + S_2 + S_3 + \cdots + S_{10}\right)\\ &= 2\sin(x/2)\sin(3x/2) + 2\sin(x/2)\sin(5x/2) + \cdots + 2\sin(x/2)\sin(21x/2) - 20\sin^2 (x/2)\\
& = (\cos(3x/2-x/2) -\cos(3x/2 + x/2)) + (\cos(5x/2-x/2) -\cos(5x/2 + x/2)) + \cdots + (\cos(21x/2-x/2) -\cos(21x/2 + x/2)) - 20\sin^2 (x/2)\\
&=\cos x-\cos(11x)  - 20\sin^2 (x/2)\end{align}$$
so we have $$ \frac{S}{20\sin^2(x/2)} = \frac{S_1 + S_2 + S_3 + \cdots + S_{10}}{10} = \frac{\cos x - \cos(11x)}{20\sin(x/2)} -\frac 12$$
therefore we can see that $$ \frac{S_1 + S_2 + S_3 + \cdots + S_{n}}{n} = \frac{\cos x - \cos((n+1)x)}{2n\sin(x/2)} -\frac 12 \to -\frac 12 \text{ as } n \to \infty.$$
we have used the fact that $$\big|\cos x - \cos((n+1)x)\big| \le 2.$$
