TITLE: Sum of reciprocal sine function $\sum\limits_{k=1}^{n-1} \frac{1}{\sin(\frac{k\pi}{n})}=?$
QUESTION [11 upvotes]: The question comes to me when I find there are answers on summation of some forms of trigonometric functions, i.e. 
$$
\sum\limits_{k=1}^{n-1} \frac{1}{\sin^2(\frac{k\pi}{n})}\\
\sum\limits_{k=0}^{n-1} \tan(\frac{k\pi}{n})\\
$$
Sum of the reciprocal of sine squared
Sum of tangent functions where arguments are in specific arithmetic series
To show the identity of $\sum\limits_{k=0}^{n-1} \frac{1}{\tan^2(\frac{k\pi}{n})}$ should be trivial as the summand can be rewritten as $\frac{1}{\sin^2(\frac{k\pi}{n})}-1$.
I am wondering what is the following summation:
$$
\sum\limits_{k=1}^{n-1} \frac{1}{\sin(\frac{k\pi}{n})}?
$$

REPLY [3 votes]: An asymptotic formula may be derived as follows. Starting with TheSimpliFire's answer,
\begin{align*}
\sum\limits_{k = 1}^{n - 1} {\csc \left( {\frac{{\pi k}}{n}} \right)} & =
\frac{{2n}}{\pi }\int_0^1 {\frac{{s^{n - 1}  - 1}}{{(s - 1)(s^n  + 1)}}ds}  \\ & = \frac{{2n}}{\pi }\int_0^1 {\frac{{s^n  - 1}}{{(s - 1)(s^n  + 1)}}ds}  - \frac{{2n}}{\pi }\int_0^1 {\frac{{s^{n - 1} }}{{s^n  + 1}}ds} 
\\ & = \frac{{2n}}{\pi }\int_0^1 {\frac{{s^n  - 1}}{{(s - 1)(s^n  + 1)}}ds}  - \frac{{2\log 2}}{\pi }
\\ & = \frac{{2n}}{\pi }\int_0^1 {\frac{{s^n  - 1}}{{s - 1}}ds}  - \frac{{2n}}{\pi }\int_0^1 {\frac{{s^n  - 1}}{{s - 1}}\frac{{s^n }}{{s^n  + 1}}ds}  - \frac{{2\log 2}}{\pi }
\\ & = \frac{{2n}}{\pi }\left( {H_n  - \int_0^1 {\frac{{s^n  - 1}}{{s - 1}}\frac{{s^n }}{{s^n  + 1}}ds} } \right) - \frac{{2\log 2}}{\pi }
\end{align*}
where $H_n$ is the $n$th Harmonic number. It is known that for any $x>0$ and $N\geq 1$,
$$
\frac{x}{{e^x  - 1}} = 1-\frac{x}{2} + \sum\limits_{k = 1}^{N - 1} {\frac{{B_{2k} }}{{(2k)!}}x^{2k} }  + \Theta _N \frac{{B_{2N} }}{{(2N)!}}x^{2N} 
$$
with a suitable $0<\Theta _N<1$ that may depend on $x$, and with $B_k$ being the Bernoulli numbers. Accordingly, using the mean value theorem for improper integrals,
\begin{align*}
& \int_0^1 {\frac{{s^n  - 1}}{{s - 1}}\frac{{s^n }}{{s^n  + 1}}ds}  = 
\int_0^{ + \infty } {\frac{{1 - e^{ - t} }}{t}\frac{1}{{1 + e^t }}\frac{{t/n}}{{e^{t/n}  - 1}}dt} \\ &
= \int_0^{ + \infty } {\frac{{1 - e^{ - t} }}{t}\frac{1}{{1 + e^t }}dt} 
 - \frac{1}{{2n}}\int_0^{ + \infty } {\frac{{1 - e^{ - t} }}{{1 + e^t }}dt} 
\\ & \quad + \sum\limits_{k = 1}^{N - 1} {\frac{{B_{2k} }}{{(2k)!}}\frac{1}{{n^{2k} }}\int_0^{ + \infty } {\frac{{1 - e^{ - t} }}{{1 + e^t }}t^{2k - 1} dt} }   + \theta _N \frac{{B_{2N} }}{{(2N)!}}\frac{1}{{n^{2N} }}\int_0^{ + \infty } {\frac{{1 - e^{ - t} }}{{1 + e^t }}t^{2N - 1} dt} 
\\ & = \log \left( {\frac{\pi }{2}} \right)  - \frac{{2\log 2 - 1}}{{2n}}+ \sum\limits_{k = 1}^{N - 1} { \frac{{B_{2k} }}{{2k}}\left( {(2 - 2^{2 - 2k} )\zeta (2k) - 1} \right)\frac{1}{{n^{2k} }}} \\ & \quad + \theta _N \frac{{B_{2N} }}{{2N}}\left( {(2 - 2^{2 - 2N} )\zeta (2N) - 1} \right)\frac{1}{{n^{2N} }}
\end{align*}
with a suitable $0<\theta _N<1$ that depends on $n$ and $N$. Here $\zeta(s)$ denotes the Riemann zeta function. It is well known that for any $n\geq 1$ and $N\geq 1$,
$$
H_n  = \log n + \gamma  + \frac{1}{{2n}} - \sum\limits_{k = 1}^{N - 1} {\frac{{B_{2k} }}{{2k}}\frac{1}{{n^{2k} }}}  - \sigma _N \frac{{B_{2N} }}{{2N}}\frac{1}{{n^{2N} }}
$$
with an appropriate $0<\sigma_N<1$ that depends on $n$ and $N$. Therefore, taking into account the sign of the remainder terms,
$$
H_n  - \int_0^1 {\frac{{s^n  - 1}}{{s - 1}}\frac{{s^n }}{{s^n  + 1}}ds}  = \log \left( {\frac{2n}{\pi }} \right) + \gamma  + \frac{\log 2}{{n}} + \sum\limits_{k = 1}^{N - 1} {\frac{{a_{2k} }}{{(2n/\pi)^{2k} }}}  + \omega _N \frac{{a_{2N} }}{{(2n/\pi)^{2N} }}
$$
with
$$
a_{2k}=
 - \frac{{B_{2k} (2 - 2^{2 - 2k} )\zeta (2k)}}{{2k}}\left( {\frac{2}{\pi }} \right)^{2k}  = ( - 1)^k \frac{{2^{2k} (2^{2k}  - 2)B_{2k}^2 }}{{2k \cdot 2k!}}
$$
and with a suitable $0<\omega_N<1$ that depends on $n$ and $N$. In summary,
$$
\sum\limits_{k = 1}^{n - 1} {\csc \left( {\frac{{\pi k}}{n}} \right)} = 
\frac{{2n}}{\pi }\log \left( {\frac{2n}{\pi }} \right) + \gamma \frac{{2n}}{\pi } +  \sum\limits_{k = 1}^{N - 1} {\frac{{a_{2k} }}{{(2n/\pi)^{2k - 1} }}}  + \omega _N \frac{{a_{2N} }}{{(2n/\pi)^{2N - 1} }} 
$$
with the coefficients $a_{2k}$ as given above and $0<\omega_N<1$ being an appropriate number that depends on $n$ and $N$.