<s>[INST] 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!
 [/INST] 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.
</s>