A problem I have been working on recently results in a sum of cosecant terms. Specifically,
$f(n) = \sum_{k=1}^n \csc \frac{\pi k}{2n+1}$
$g(n) = \sum_{k=1}^n [(-1)^{k+1}(\csc \frac{\pi k}{2n+1})]$
The problem occasionally involves large values of n, which can make evaluating the sums cumbersome. I do not see a way to simplify the sums easily to something easier to calculate quickly. So my question is, is there a way to simplify these sums to make them easier to calculate?
I'll complement Claude's answer with other asymptotic expansions.
More terms for the expansion of $\displaystyle f(n) := \sum_{k=1}^n \csc \frac{\pi k}{2n+1}$ may be obtained using : $$\tag{1}\csc \left(\pi x\right)=\frac{1}{\pi x}+\frac{2 x}{\pi}\sum_{j=1}^\infty\frac{(-1)^j}{x^2-j^2}$$ which is for $\,\displaystyle x:=\frac{k}{2 n+1}$ : $$\tag{2}\csc \left(\frac{\pi k}{2 n+1}\right)=\frac{2 n+1}{\pi k}+\frac{2 k}{\pi(2n+1)}\sum_{j=1}^\infty\frac{(-1)^j}{\left(\frac k{2n+1}\right)^2-j^2}$$ A sum over the $n$ first values of $k$ will thus give for $\;\displaystyle H_n:=\sum_{k=1}^n \frac 1k$ : $$\tag{3}\sum_{k=1}^n\csc \left(\frac{\pi k}{2 n+1}\right)=\frac{2 n+1}{\pi }H_n+S(n)$$ with $S(n)$ a not so easy double sum...
Fortunately $S(n)$ seems to admit a rather simple expansion : $$\tag{4}S(n)\sim \frac{\ln(4/\pi)}{\pi}(2n+1)$$ while a good approximation of $H_n$ is $\;H_n\sim\gamma+\ln\left(n+\frac 12\right)\,$ ($\gamma$ is the Euler constant $0.5772156649\cdots$) so that $(3)$ becomes : $$\tag{5}\sum_{k=1}^n\csc \left(\frac{\pi k}{2 n+1}\right)\sim\frac{2 n+1}{\pi}\left(\gamma+\ln(4/\pi)+\ln\left(n+\frac 12\right)\right)$$ (with an error term in $O\left(\frac 1n\right)$ )
that is for $\,\displaystyle a_n:=\frac {2n+1}{\pi}\,$ the very simple : $$\tag{6}\sum_{k=1}^n\csc \frac k{a_n}\sim\left(\gamma+\ln(2\,a_n)\right){a_n}$$
A better approximation was obtained with $$\tag{7}\sum_{k=1}^n\csc\frac k{a_n}=\left(\gamma+\ln(2\,a_n)\right){a_n}-\frac 1{72\,(a_n)}+\frac 7{43200\,(a_n)^3}-\frac{31}{3810240\,(a_n)^5}+\frac {127}{145152000\,(a_n)^7}-\frac{511}{3161410560\,(a_n)^9}+O\left(\frac 1{(a_n)^{11}}\right)$$
so that I'll conjecture the simple and neat asymptotic expansion : $$\tag{8} \boxed{\displaystyle\sum_{k=1}^n\csc\frac k{a_n}=\left(\gamma+\ln(2\,a_n)\right){a_n}+\sum_{k\ge 1}(-1)^k(\operatorname{B}_{2k})^2\,\frac{2^{2k-1}-1}{k\,(2k)!\;(a_n)^{2k-1}}}$$
The originality here is that we got a generating function for the squares of the Bernoulli numbers $\operatorname{B}_k$ !
(for accurate results use between $10$ and $20$ terms of the sum)
In the second sum $\;\displaystyle g(n) := \sum_{k=1}^n (-1)^{k+1}\csc \frac{\pi k}{2n+1}\;$ the harmonic sum will be replaced by the alternate sum $\;\displaystyle \sum_{k=1}^n\frac {(-1)^{k+1}}k\,$ with the limit $\,\ln(2)$ as $n\to \infty$.
Again for $\,\displaystyle a_n:=\frac {2n+1}{\pi}\,$ I get the approximation :
$$\tag{9}\sum_{k=1}^n (-1)^{k+1}\csc\frac k{a_n}=\ln(2)\,a_n-\frac 12+\frac 1{24\,(a_n)}+\frac 1{16\,(a_n)^2}-\frac 7{2880\,(a_n)^3}-\\\frac{25}{768\,(a_n)^4}+\frac{31}{60480\,(a_n)^5}+\frac{3721}{92160\,(a_n)^6}-\frac{2159}{9676800\,(a_n)^7}-\frac{383645}{4128768\,(a_n)^8}+\frac{2263}{13685760\,(a_n)^9}+\frac{2552371441}{7431782400\,(a_n)^{10}}+O\left(\frac 1{(a_n)^{11}}\right)$$ The asymptotic expansion should then be (with $\operatorname{E}_k$ the Euler numbers) : $$\tag{10} {\displaystyle\sum_{k=1}^n (-1)^{k+1}\csc\frac k{a_n}=\ln(2)\,a_n -\sum_{k\ge 0}(-1)^k(\operatorname{E}_{2k})^2\frac{2^{2k+1}}{(2k)!\;(a_n)^{2k}} \\-\sum_{k\ge 1}(-1)^k(\operatorname{B}_{2k})^2\,\frac{(2^{2k-1}-1)(2^{2k}-1)}{k\,(2k)!\;(a_n)^{2k-1}}}$$