Is there a way to simplify a sum of cosecants? 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?
 A: I do not think that the summation could be simplified.
Assuming that $n$ is a large number, we can build the series $$\csc \left(\frac{\pi  k}{2 n+1}\right)=\frac{2 n}{\pi  k}+\frac{1}{\pi  k}+\frac{\pi  k}{12 n}-\frac{\pi  k}{24
   n^2}+\frac{\frac{7 \pi ^3 k^3}{2880}+\frac{\pi 
   k}{48}}{n^3}+O\left(\left(\frac{1}{n}\right)^4\right)$$ and sum over $k$. As a result, after many simplifications, $$f(n) = \sum_{k=1}^n \csc \left(\frac{\pi  k}{2 n+1}\right)\approx\frac{\pi   (n+1)\Big(\left(480+7 \pi ^2\right) n^2+\left(7 \pi ^2-240\right) n+120 \Big)}{11520 n^2}+\frac{(2 n+1) H_n}{\pi }+\cdots$$ For illustration purposes, using $n=100$, the approximation leads to a value $\approx 346.967$ while the exact summation would lead to  $\approx 347.345$; with $n=1000$, the approximation leads to a value $\approx 4917.62$ while the exact summation would lead to  $\approx 4921.64$; with $n=10000$, the approximation leads to a value $\approx 63810.5$ while the exact summation would lead to  $\approx 63850.9$.
For sure, you could continue using approximations for  the harmonic numbers.
Adding extra terms to the expansions leads for sure to better results but digamma functions start to appear. Pushing the expansion up to $O\left(\left(\frac{1}{n}\right)^6\right)$, for the same examples as above, we obtain $347.275$, $4920.87$ and $63843.1$.
For sure, you could continue using approximations for  the harmonic numbers such as $$H_n=\gamma +\log (n)+\frac{1}{2 n}-\frac{1}{12
   n^2}+O\left(\left(\frac{1}{n}\right)^4\right)$$ For the cases given above, the results would be the same for six significant figures.
