Convergence and limit of $\sum_{j=1}^n\sin\left(\frac{j-1}n\right)\left\{\cos\left(\frac jn\right)-\cos\left(\frac{j-1}n\right)\right\}$ The title says it all - I'm trying to find a way of proving the convergence and evaluating the limit of $a_n=\sum_{j=1}^n\sin\left(\frac{j-1}n\right)\left\{\cos\left(\frac jn\right)-\cos\left(\frac{j-1}n\right)\right\}$. This exercise is from the field of integration theory, so probably Riemann sums are to be used on this one but I can't find any way that makes sense. I'd appreciate any hints.
 A: We have:
$$ \lim_{n\to +\infty} \sum_{j=1}^{n}\sin\left(\frac{j-1}{n}\right)\left[\cos\left(\frac{j}{n}\right)-\cos\left(\frac{j-1}{n}\right)\right]=\color{red}{\frac{\sin(2)-2}{4}}.$$
Sketch of proof: we have:
$$ \cos\left(\frac{j}{n}\right)-\cos\left(\frac{j-1}{n}\right) = \int_{\frac{j-1}{n}}^{\frac{j}{n}}(-\sin x)\,dx=-\frac{1}{n}\,\sin\left(\frac{j-1}{n}\right)+O\left(\frac{1}{n^2}\right), $$
hence our limit is the same as:
$$ -\lim_{n\to +\infty}\sum_{j=1}^{n}\frac{1}{n}\sin^2\left(\frac{j-1}{n}\right) = -\int_{0}^{1}\sin^2(x)\,dx. $$
A: From trigonometric identities:
$$
\sum_{j=1}^{n}\sin\left(\frac{j-1}{n}\right)\left[\cos\left(\frac{j}{n}\right)-\cos\left(\frac{j-1}{n}\right)\right]
=-2\sin\frac{1}{2n}\sum_{j=1}^{n}\sin\left(\frac{j-1}{n}\right)\sin\left(\frac{2j-1}{2n}\right).
$$
Now, we also can rewrite
$$
\sin\frac{2j-1}{2n} = \sin\left(\frac{j-1}{n}+\frac{1}{2n}\right)
= \sin \frac{j-1}{n} \cdot \cos \frac{1}{2n} + \cos \frac{j-1}{n} \cdot \sin \frac{1}{2n}
$$
so that
$$\begin{align}
\sum_{j=1}^{n}\sin\left(\frac{j-1}{n}\right)\left[\cos\left(\frac{j}{n}\right)-\cos\left(\frac{j-1}{n}\right)\right]
&=-2\sin\frac{1}{2n}\cos\frac{1}{2n}\sum_{j=1}^{n}\sin\left(\frac{j-1}{n}\right)^2 \\
&+-2\sin\left(\frac{1}{2n}\right)^2\sum_{j=1}^{n}\sin\left(\frac{j-1}{n}\right)\cos\left(\frac{j-1}{n}\right).
\end{align}$$


*

*We can ignore the second term, as its limit is $0$: indeed, each term of the sum is at most $1$, so the sum is in $[-n,n]$; but from $\lim_{x\to 0}\frac{\sin x}{x}= 1$ we have that $\sin\left(\frac{1}{2n}\right)^2 \sim_{n\to \infty} \frac{1}{4n^2}$.

*for the first term, we have $\lim_{n\to\infty} \cos\frac{1}{2n} = 1$ and $\lim_{n\to\infty} \frac{\sin\left(\frac{1}{2n}\right)}{\frac{1}{2n}} = 1$, so the limit is the same as the limit of
$$
-2\frac{1}{2n}\sum_{j=1}^{n}\sin\left(\frac{j-1}{n}\right)^2=-\frac{1}{n}\sum_{j=1}^{n}\sin\left(\frac{j-1}{n}\right)^2
$$
which is a Riemann sum: the limit is
$$
\lim_{n\to\infty }-\frac{1}{n}\sum_{j=1}^{n}\sin\left(\frac{j-1}{n}\right)^2
= -\int_0^1 \sin^2 t dt = \frac{\sin 2 - 2}{4}.
$$
(Which can be easily obtained e.g. by integration by parts.)
A: Rather than go through all the ugly trigonometric details of this particular problem, I would suggest reading about the Riemann-Stieltjes integral. We have that
$$\sum_{j=1}^nf(\tfrac{j-1}n)[g(\tfrac{j}n)-g(\tfrac{j-1}n)]\to\int_0^1f(x)\mathrm dg(x)$$
as $n\to\infty$. If $g$ is differentiable, $\mathrm dg(x)=g'(x)\mathrm dx$. Plugging in $f=\sin$, $g=\cos$ will give us the solution.
A: Thanks to everyone of you for your input - but I think I've now found the intended solution and since it differs greatly from the other solutions, I'll post it. (Thanks Jason, reading about the Riemann-Stieltjes integral did point me in the right direction, which is the MVT.)
By the MVT (mean value theorem) for every $1\leq j\leq n$ there exists an $x_j\in\left(\frac{j-1}n,\frac jn\right)$ such that$$\cos\left(\frac jn\right)-\cos\left(\frac{j-1}n\right)=\cos'(x_j)\left(\frac jn-\frac{j-1}n\right)=\frac{-\sin(x_j)}n.$$
Let $Z_n$ be the equidistant partition into $n$ parts of $[0,1]$.
Since $\sin$ (and therefore $\sin^2$ as well) is increasing on $[0,1]$, for every $1\leq j\leq n$ we have $$\sin^2\left(\frac{j-1}n\right)\leq\sin\left(\frac{j-1}n\right)\sin(x_j)\leq\sin^2(x_j)\leq\sin^2\left(\frac jn\right),$$
so on the one hand we have $$\begin{align}
a_n=&\sum_{j=1}^n\sin\left(\frac{j-1}n\right)\left\{\cos\left(\frac jn\right)-\cos\left(\frac{j-1}n\right)\right\}\\
=&-\sum_{j=1}^n\frac1n\sin\left(\frac{j-1}n\right)\sin(x_j)\\
\leq&-\sum_{j=1}^n\frac1n\sin^2\left(\frac{j-1}n\right)\\
=&-\sum_{j=1}^n\frac1n\inf\left\{\sin^2(x):x\in\left[\frac{j-1}n,\frac jn\right]\right\}\\
=&-\underline S(Z_n,\sin^2)\xrightarrow{n\to\infty}-\int_0^1\sin^2(x)\mathrm dx
\end{align}$$
but on the other hand, in analogy we have $$\begin{align}
a_n\geq&-\sum_{j=1}^n\frac1n\sin^2\left(\frac jn\right)\\
=&-\sum_{j=1}^n\frac1n\sup\left\{\sin^2(x):x\in\left[\frac{j-1}n,\frac jn\right]\right\}\\
=&-\bar S(Z_n,\sin^2)\xrightarrow{n\to\infty}-\int_0^1\sin^2(x)\mathrm dx,
\end{align}$$
so the sandwich lemma gives us
$$\lim_{n\to\infty}a_n=-\int_0^1\sin^2(x)\mathrm dx=\frac{\sin(2)-2}4.$$
