Is there a way to simplify a sum of cosecants?

673 Views Asked by At

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?

2

There are 2 best solutions below

4
On BEST ANSWER

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}}}$$

0
On

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.