Asymptotics for $\sum_{k=0}^{n-1}(-1)^k \cot(\frac{2k+1}{4n}\pi)\log{(2\sin(\frac{2k+1}{4n}\pi))} $

asymptoticsdefinite integralsintegrationroots-of-unity

I have been able to establish the identity
$$
I(n):=\int_0^1 \frac{y^{n-1}(1+y-y^{n+1}) – 1}{(1-y)(1+y^{2n})}\ dy = \frac{1}{n} \sum_{k=0}^{n-1}(-1)^k\cot(\frac{2k+1}{4n}\pi)\log{(2\sin(\frac{2k+1}{4n}\pi))}
$$

However, neither side seems conducive to discovering an asymptotic expansion as $n \to \infty.$
Purely on numerical evidence I conjecture that $I(n) \sim -\log(n).$
$$
\begin{array}{c|lcr}
n & I(n) &-\log{n} & -\log{n}/I(n) \\
\hline
10^3 & -6.702 & -6.908 & 1.031 \\
10^4 & -9.004 & -9.2106 &1.023 \\
10^5 & -11.307 &-11.513 & 1.018 \\
\end{array}
$$

I seek the dominant and one subdominant asymptotic terms. (If the Lambert W function is involved, then maybe one term is sufficient.) Here are some ideas.

(1) On the LHS (left-hand side), letting $n \to \infty,$ the $y^n$ terms integrand go to zero and you are left with $-1/(1-y),$ and the integral over it will diverge. However, plotting the integrand for large $n$, it is seen that the integrand follows the $-1/(1-y)$ curve until it sharply drops to zero near $y=1.$ It is probable that the position of the drop, $y_d,$ is analytically tractable, and one can approximate the integral as
$-\int_{0}^{y_d}dy/(1-y).$ However, I have no idea on how to approach a subdominant term.

(2) The RHS looks sort of like a Riemann sum, except for the pesky alternating sign, and the fact that odd integers appear in the arguments instead of every integer. A long time ago I read that the Euler-Maclaurin formula has been extended to character sums, which this looks like. I also know that Euler-Maclaurin can be used for asymptotic analysis. A solution in this manner would be most edifying, since I know so little about it.

Best Answer

Note that $$ I(n) = \int_0^1 {\frac{{(t^n - 1)^2 }}{{(t - 1)(t^{2n} + 1)}}\mathrm{d}t} + \int_0^1 {\frac{{t^{n - 1} }}{{t^{2n} + 1}}\mathrm{d}t} . $$ Here $$ \int_0^1 {\frac{{t^{n - 1} }}{{t^{2n} + 1}}\mathrm{d}t} \le \int_0^1 {t^{n - 1} \mathrm{d}t} = \frac{1}{n}. $$ Now \begin{align*} \int_0^1 {\frac{{(t^n - 1)^2 }}{{(t - 1)(t^{2n} + 1)}}\mathrm{d}t} & = - \int_0^1 {\frac{{1 - t^n }}{{1 - t}}\mathrm{d}t} + \int_0^1 {\frac{{1 - t^{2n} }}{{1 + t^{2n} }}\frac{{t^n }}{{1 - t}}\mathrm{d}t} \\ & = - \sum\limits_{k = 1}^n {\frac{1}{k}} +\int_0^1 {\frac{{1 - t^{2n} }}{{1 + t^{2n} }}\frac{{t^n }}{{1 - t}}\mathrm{d}t}. \end{align*} We have $$ - \sum\limits_{k = 1}^n {\frac{1}{k}} = - \log n -\gamma + \mathcal{O}\!\left(\frac{1}{n}\right). $$ Furthermore, \begin{align*} &\int_0^1 {\frac{{1 - t^{2n} }}{{1 + t^{2n} }}\frac{{t^n }}{{1 - t}}\mathrm{d}t} = \int_0^{ + \infty } {\frac{{\tanh (ns)}}{{\mathrm{e}^s - 1}}\mathrm{e}^{ - ns} \mathrm{d}s} \\ & = \int_0^{ + \infty } {\frac{{t/n}}{{\mathrm{e}^{t/n} - 1}}\mathrm{e}^{ - t} \frac{{\tanh t}}{t}\mathrm{d}t} \\& = \int_0^{ + \infty } {\mathrm{e}^{ - t} \frac{{\tanh t}}{t}\mathrm{d}t} + \int_0^{ + \infty } {\left( {\frac{{t/n}}{{\mathrm{e}^{t/n} - 1}} - 1} \right)\mathrm{e}^{ - t} \frac{{\tanh t}}{t}\mathrm{d}t} . \end{align*} Here \begin{align*} \int_0^{ + \infty } {\left| {\frac{{t/n}}{{\mathrm{e}^{t/n} - 1}} - 1} \right|\mathrm{e}^{ - t} \frac{{\tanh t}}{t}\mathrm{d}t} & \le \int_0^{ + \infty } {\frac{t}{{2n}}\mathrm{e}^{ - t} \frac{{\tanh t}}{t}\mathrm{d}t} \\ & = \frac{1}{{2n}}\int_0^{ + \infty } {\mathrm{e}^{ - t} \tanh t\,\mathrm{d}t} = \mathcal{O}\!\left( {\frac{1}{n}} \right), \end{align*} since $\left| {\frac{x}{{\mathrm{e}^x - 1}} - 1} \right| \le \frac{x}{2} $ for all $x>0$. Thus, in summary, $$I(n)=-\log n+C+\mathcal{O}\!\left( {\frac{1}{n}} \right)$$ as $n\to +\infty$, where $$ C = - \gamma + \int_0^{ + \infty } {\mathrm{e}^{ - t} \frac{{\tanh t}}{t}\mathrm{d}t} = -\gamma +2\log \left( {\frac{{2\Gamma \left( {\frac{5}{4}} \right)}}{{\Gamma \left( {\frac{3}{4}} \right)}}} \right) =0.20597 \ldots \, . $$ It is possible to obtain a complete asymptotic expansion as follows. We observe that $$ \int_0^1 \frac{{t^{n - 1} }}{{t^{2n} + 1}}\mathrm{d}t = \frac{\pi }{{4n}}. $$ It is known that $$ - \sum\limits_{k = 1}^n {\frac{1}{k}} \sim - \log n - \gamma - \frac{1}{{2n}} + \sum\limits_{k = 1}^\infty {\frac{{B_{2k} }}{{2kn^{2k} }}} , $$ where $B_{2k}$ denotes the Bernoulli numbers. Also, using the generating function of the Bernoulli numbers, it is found that \begin{align*} & \int_0^{ + \infty } {\left( {\frac{{t/n}}{{\mathrm{e}^{t/n} - 1}} - 1} \right)\mathrm{e}^{ - t} \frac{{\tanh t}}{t}\mathrm{d}t} \\ & \sim - \frac{1}{{2n}}\int_0^{ + \infty } {\mathrm{e}^{ - t} \tanh t\,\mathrm{d}t} + \sum\limits_{k = 1}^\infty {\left[ {\frac{{B_{2k} }}{{(2k)!}}\int_0^{ + \infty } {t^{2k-1} \mathrm{e}^{ - t} \tanh t\,\mathrm{d}t} } \right]\frac{1}{{n^{2k} }}} . \\ & = - \frac{{\pi - 2}}{{4n}} + \sum\limits_{k = 1}^\infty {\frac{B_{2k}}{2k}\frac{ \zeta \left(2k,\frac{1}{4}\right) -2 \zeta \left( {2k ,\frac{3}{4}} \right) + \zeta \left( {2k,\frac{5}{4}} \right) }{{16^k }}\frac{1}{{n^{2k} }}} . \end{align*} Here $\zeta(s,a)$ is the Hurwitz zeta function. Therefore, \begin{align*} I(n) & \sim - \log n + C + \sum\limits_{k = 1}^\infty {\frac{B_{2k}}{2k}\left( 1+\frac{ \zeta \left(2k,\frac{1}{4}\right) -2 \zeta \left( {2k ,\frac{3}{4}} \right) + \zeta \left( {2k,\frac{5}{4}} \right) }{{16^k }}\right)\frac{1}{{n^{2k} }}} \\ & = - \log n + C + \sum\limits_{k = 1}^\infty \frac{{B_{2k} }}{{16^k k}}\left( {\zeta \left( {2k,\tfrac{1}{4}} \right) - \zeta \left( {2k,\tfrac{3}{4}} \right)} \right) \frac{1}{{n^{2k} }}, \end{align*} as $n\to +\infty$.