computing a trignometric limit

I am trying to show that $$\lim _{n\rightarrow \infty }\dfrac {1+\cos \dfrac {x} {n}+\cos \dfrac {2x} {n}+\ldots +\cos\dfrac {\left( n-1\right) x} {n}} {n } = \dfrac{\sin x}{x}$$

I have attempted a number of approaches such as trigonometric tricks and the most recent with substitution of $\cos \dfrac {x} {n}=\dfrac {e^{i\frac {x} {n}}+e^{-\frac {ix} {n}}} {2}$
Starting from the left hand side i ended up with an expression such as $$\lim _{n\rightarrow \infty }\frac {\frac {1-e^{ix}} {1-e^{\frac {ix} {n}}}+\frac {1-e^{-ix}} {1-e^{\frac {-ix} {n}}}} {2n}$$ I am unsure how i could possibly rearrange this so upon taking the limit i can convert to RHS.

Any help with this method or even an alternative proof strategy would be much appreciated.

Solutions Collecting From Web of "computing a trignometric limit"

For a “pre-integral calculus” method:

You can use the formula

$$ \sum_{k=0}^{n-1} \cos k d = \frac{ \sin (nd/2)}{\sin (d/2)} \cos ((n-1)d/2)$$

Set $\displaystyle d = \frac{x}{n}$ and use the limit $\displaystyle \lim_{t\to 0} \frac{\sin t}{t} = 1$ and the formula $\displaystyle 2 \sin (x/2) \cos (x/2) = \sin x$.

For a proof of the formula, see here: How can we sum up $\sin$ and $\cos$ series when the angles are in arithmetic progression?

You can compute the sum or recognize a Riemann sum: for $x\neq 0$
$$\lim_{n\to+\infty}\frac 1n\sum_{k=0}^{n-1}\cos\frac{kx}n=\int_0^1\cos(tx)dt=\left[\frac{\sin(tx)}x\right]_{t=0}^{t=1}=\frac{\sin x}x.$$

Your sum is a Riemann sum approximating the integral
Alternatively, your sum is the real part of the geometric sum
where $\cis(x)=e^{ix}=\cos(x)+i\sin(x)$.

Then, note that
Combining $(1)$ and $(2)$ yields
Taking the real parts of $(3)$ yields

Here is slightly long winded solution using trigonometric identities only.
$$\lim _{n\rightarrow \infty }\dfrac {1+\cos \dfrac {x} {n}+\cos \dfrac {2x} {n}+\ldots +\cos\dfrac {\left( n-1\right) x} {n}} {n } $$

using the trignometric identity $$\sum _{n=1}^{N}\cos n\theta =\dfrac {-1} {2}+\dfrac {\sin \left( N+\dfrac {1} {2}\right) \theta } {2\sin \dfrac {\theta } {2}}$$
our equation can be rewritten as
$$\lim _{n\rightarrow \infty }\dfrac {1-\dfrac {1} {2}+\dfrac {\sin \left( n-1+\dfrac {1} {2}\right) \dfrac {x} {n}} {2\sin x / 2n}} {n}$$

$$\lim _{n\rightarrow \infty }\dfrac {1} {2n}\left( \dfrac {\sin\dfrac {x} {2n}+\sin \left( x-\dfrac {x} {2n}\right) } {\sin \dfrac {x} {2n}}\right) $$

$$\lim _{n\rightarrow \infty }\dfrac {1} {2n}\left( \dfrac {2\sin\dfrac {x} {2}\cos \left(\dfrac {\dfrac {x} {n}-x} {2}\right)} {\sin \dfrac {x} {2n}}\right) $$

The following restructure of the denominator was pointed out to me by Aryabhata. 🙂
$$\lim _{n\rightarrow \infty }\dfrac {\sin \dfrac {x} {2}\cos \dfrac {x} {2}\left( \dfrac {1} {n}-1\right) } {\dfrac {x\sin \dfrac {x} {2n}} {2\dfrac {x} {2n}}}$$

Taking the limit we get
$$\dfrac {\sin \dfrac {x} {2}\cos -\dfrac {x} {2}} {\dfrac {x} {2}}$$
which is the same as
$$\dfrac {\sin \dfrac {x} {2}\cos \dfrac {x} {2}} {\dfrac {x} {2}}$$
which gives RHS using the trigonometric identity once again.
$$\dfrac{\sin x}{x}$$