Prove that, for any numbers \(a_1, a_2, \ldots\,,\)
and \(b_1, b_2, \ldots\,,\) and for \(n\ge1\),
\[
\sum_{m=1}^n a_m(b_{m+1} -b_m) = a_{n+1}b_{n+1} -a_1b_1
-\sum_{m=1}^n b_{m+1}(a_{m+1} -a_m)
\,.
\]
By setting \(b_m = \sin mx\), show that
\[
\sum_{m=1}^n \cos (m+\tfrac12)x
= \tfrac12
\big(\sin (n+1)x - \sin x \big)
\cosec \tfrac12 x
\,.
\]
Note: $\sin A - \sin B = \displaystyle 2
\cos \big( \tfrac{{\displaystyle A+B\vphantom{_1}}}
{\displaystyle 2\vphantom{^1}} \big)\,
\sin\big( \tfrac{{\displaystyle A-B\vphantom{_1}}}{\displaystyle 2\vphantom{^1}} \big)\,
$.
Show that
\[
\sum_{m=1}^n m\sin mx
=
\big (p \sin(n+1)x +q \sin nx\big)
\cosec^2 \tfrac12 x
\,,
\]
where \(p\) and \(q\) are to be determined in terms of \(n\).
Note: \(2\sin A \sin B = \cos (A-B) - \cos (A+B)\,\);
Note: \(2\cos A \sin B = \sin (A+B) - \sin (A-B)\,\).
Solution: \begin{align*}
\sum_{m=1}^n a_m(b_{m+1} -b_m) +\sum_{m=1}^n b_{m+1}(a_{m+1} -a_m) &= \sum_{m=1}^n \left (a_{m+1}b_{m+1}-a_mb_m \right) \\
&= a_{n+1}b_{n+1} - a_1b_1
\end{align*}
And the result follows.