Finding $\lim_{n\to\infty}\frac1{n^3}\sum_{k=1}^{n-1}\frac{\sin\frac{(2k-1)\pi}{2n}}{\cos^2\frac{(k-1)\pi}{2n}\cos^2\frac{k\pi}{2n}}$ 
For all $n\ge 1$, let
$$
a_{n}=\sum_{k=1}^{n-1} \frac{\sin \left(\frac{(2 k-1) \pi}{2 n}\right)}{\cos ^{2}\left(\frac{(k-1) \pi}{2 n}\right) \cos ^{2}\left(\frac{k \pi}{2 n}\right)}
$$
Find $\displaystyle\lim_{n\to\infty}\frac{a_n}{n^3}$.

This is a problem from the 2019 Putnam competition.
The official solutions use two different strategies; one reduces the expression as a telescoping sum and the other uses the asymptotic property of sine near zero. The two community-wiki answers below essentially elaborate on the official solutions.
Remark. I am curious if one can write $\displaystyle\frac{a_n}{n^3}$ as a Riemann sum so that one can write the limit as an integral. Naively, the fraction looks very much like $\frac{1}{n}\sum_{k=1}^{n-1}\cdots$, which is in the setting of Riemann sums. (This only serves as a comment, not a requirement for solving the problem.)

This is based on one of the official solutions for the problem.
We first write $a_n$ as a telescoping sum. Notice that
$$
\frac{1}{AB} = \left(\frac{1}{A}-\frac{1}{B}\right)\cdot \frac{1}{B-A}\,.
$$
It follows that the summand of $a_n$ can be written as
$$
\left(\frac{1}{\cos ^{2}\left(\frac{(k-1) \pi}{2 n}\right)}-\frac{1}{\cos ^{2}\left(\frac{k \pi}{2 n}\right)}\right)\cdot
\frac{\sin \left(\frac{(2 k-1) \pi}{2 n}\right)}{\cos ^{2}\left(\frac{k \pi}{2 n}\right)-\cos ^{2}\left(\frac{(k-1) \pi}{2 n}\right)}\tag{1}
$$
If we can show that the quantity
$$
\frac{\sin \left(\frac{(2 k-1) \pi}{2 n}\right)}{\cos ^{2}\left(\frac{k \pi}{2 n}\right)-\cos ^{2}\left(\frac{(k-1) \pi}{2 n}\right)}\tag{2}
$$
is independent of $k$, then we have a telescoping sum.
By the double angle and sum-product identities for cosine, we have
\begin{align} 
&\phantom{=}2 \cos ^{2}
\left(\frac{(k-1) \pi}{2 n}\right)
-2 \cos ^{2}\left(\frac{k \pi}{2 n}\right) \\
&=\cos \left(\frac{(k-1) \pi}{n}\right)-\cos \left(\frac{k \pi}{n}\right) 
\quad &(2\cos^2x = \cos 2x - 1)
\\ 
&=2 \sin \left(\frac{(2 k-1) \pi}{2 n}\right) \sin \left(\frac{\pi}{2 n}\right) 
\quad &(\cos \theta-\cos \varphi=-2 \sin \left(\frac{\theta+\varphi}{2}\right) \sin \left(\frac{\theta-\varphi}{2}\right))
\end{align}
and it follows that the summand in $a_n$ can be written as
$$
\frac{1}{\sin \left(\frac{\pi}{2 n}\right)}\left(-\frac{1}{\cos ^{2}\left(\frac{(k-1) \pi}{2 n}\right)}+\frac{1}{\cos ^{2}\left(\frac{k \pi}{2 n}\right)}\right)
$$
Thus the sum telescopes and we find that
$$
a_{n}=\frac{1}{\sin \left(\frac{\pi}{2 n}\right)}\left(-1+\frac{1}{\cos ^{2}\left(\frac{(n-1) \pi}{2 n}\right)}\right)=-\frac{1}{\sin \left(\frac{\pi}{2 n}\right)}+\frac{1}{\sin ^{3}\left(\frac{\pi}{2 n}\right)}
$$
Finally, since $\lim_{x\to 0}\frac{\sin x}{x}=1$, we have
$$
\lim_{n\to\infty} n\sin\frac{\pi}{2n} = \frac{\pi}{2}
$$
and thus
$$
\lim_{n\to\infty}\frac{a_n}{n^3} = \frac{8}{\pi^3}\;.
$$
