# Simplifying $\sum_{{}^{m=1}_{m\ne n}}^N(1+(-1)^{m+n})\frac{\sin\frac{\pi mk}{N+1}\sin\frac{\pi m}{N+1}}{\cos\frac{\pi n}{N+1}-\cos\frac{\pi m}{N+1}}$

I am writing perturbation theory for some linear operator, finding the first-order corrections to the components of eigenvectors boils down to the following sum: $$\sum\limits_{{}^{m=1}_{m\ne n}}^{N} (1 + (-1)^{m+n}) \frac{\sin \left( \frac{\pi m k}{N+1} \right) \sin \left( \frac{\pi m}{N+1} \right)}{\cos\left(\frac{\pi n}{N+1}\right) - \cos\left(\frac{\pi m}{N+1}\right)},$$ where $$k,n=1,2,\ldots,N$$, and $$N$$ are integers. It is really desirable that this answer has a simple analytical expression, as otherwise it has no use, but at the moment it does not look like exactly summable.

Does anyone have ideas on how to approach this? Even the answer in the limit of large $$N \gg 1$$ would be nice.

UPDATE: I think this is impossible. Here is why. Let us just ignore the factor in front for simplicity (it will erase half of the terms simply), and our goal is to get rid from this difference in the denominator. Assume the part of the sum for which $$m>n$$. In this case $$\cos(\pi n/(N+1))>\cos(\pi m/(N+1))$$, and we can write:

$$\frac{1}{\cos\left(\frac{\pi n}{N+1}\right)} \sum\limits_{m=n+1}^{N} \sin \left( \frac{\pi m k}{N+1} \right) \sin \left( \frac{\pi m}{N+1} \right) \frac{1}{1 - \frac{\cos\left(\frac{\pi m}{N+1}\right)}{\cos\left(\frac{\pi n}{N+1}\right)}} = \\\frac{1}{\cos\left(\frac{\pi n}{N+1}\right)} \sum\limits_{l=0}^{\infty} \cos^{-l}\left(\frac{\pi n}{N+1}\right) \sum\limits_{m=n+1}^{N} \sin \left( \frac{\pi m k}{N+1} \right) \sin \left( \frac{\pi m}{N+1} \right) \cos^l\left(\frac{\pi m}{N+1}\right).$$ Obviously, for $$n>m$$ one has to do the inverse, and perform a similar expansion of the $$\frac{1}{1-x}$$ function.

The only option one has is to convert all trigonometric functions into exponents. $$\cos^l\left(\frac{\pi m}{N+1}\right) = \frac{1}{2^l} \sum\limits_{p=0}^{l} C(l,p) e^{i m (l-p) \phi } e^{-i p m \phi },$$ where $$C(l,p)$$ are the binomial coefficients. So, one can get rid of the summation over $$m$$, but will be left with other two (over $$p$$, and $$l$$), and it does not look like any special function or smth like this.

UPDATE OF 27.07.2021: As metamorphy has proven, I was wrong, and it is possible to find a closed-form solution :). The final answer is:

$$- \sin\left( \dfrac{\pi n k}{N+1} \right) \cot\left( \dfrac{\pi n}{N+1}\right) - (2k-N-1) \cos\left( \dfrac{\pi n k}{N+1} \right)$$

• it looks like you should be able to simplify your fraction summand by using the half-angle formula on top and difference-to-product formula for the bottom. If you do decide to algebra, substitute $t = \dfrac{\pi}{N+1}$ to save some writing. Commented Jul 21, 2021 at 20:59
• Here's a related post involving a similar sum with sines only. Commented Jul 22, 2021 at 6:55

Using $$2\sin A\sin B=\cos(A-B)-\cos(A+B)$$, we see that the sum is $$\frac12\big(S_{N+1,n,k-1}-S_{N+1,n,k+1}+(-1)^n(S_{N+1,n,N+k}-S_{N+1,n,N+k+2})\big)$$ where, for $$0 and $$0\leqslant k\leqslant 2N$$, $$S_{N,n,k}=\sum_{\substack{0
Here are steps to get a closed form of the latter. In this answer I show that $$\sum_{m=0}^{N-1}\frac{\exp(2mk\pi i/N)}{1-2z\cos(2m\pi/N)+z^2}=\frac{N(z^k+z^{N-k})}{(1-z^2)(1-z^N)}$$ for $$0\leqslant k\leqslant N$$ and $$z\in\mathbb{C}$$ not a singularity. Now we replace $$N$$ by $$2N$$, put $$z=e^{it}$$, and use $$\sum_{m=0}^{2N-1}a_m=a_0+a_N+\sum_{m=1}^{N-1}(a_m+a_{2N-m})$$. This gives (for $$0\leqslant k\leqslant 2N$$ now) $$\sum_{m=1}^{N-1}\frac{\cos(mk\pi/N)}{\cos t-\cos(m\pi/N)}=\frac12\left(\frac1{1-\cos t}-\frac{(-1)^k}{1+\cos t}\right)-N\frac{\cos(N-k)t}{\sin t\cdot\sin Nt}.$$ To get $$S_{N,n,k}$$, subtract the term with $$m=n$$ and take the limit as $$t\to n\pi/N$$.
• Dear @metamorphy, from your answer above I have tried to obtain the closed form for the sum $$\sum\limits_{m=1,m \ne n}^{N} \dfrac{ \sin^2\left(\frac{\pi m}{N+1}\right) }{\left( \cos\left(\frac{\pi n}{N+1}\right) - \cos\left(\frac{\pi m}{N+1}\right) \right)^2}$$, which can be related to the sum above by differentiating by $t$, but for some strange reason I failed, mb there is a problem with interchanging the limit and the differentiation. Do you have a simple idea how to do that? Commented Jul 29, 2021 at 10:18
• @Sl0wp0k3: Differentiation by $t$ should have worked (together with $\sin^2\alpha=(1-\cos2\alpha)/2$ in the numerator, reducing to $k\in\{0,2\}$). Commented Jul 29, 2021 at 11:39
• Dear @metamorphy, sorry, I was mistaken, the actual series are $\sum\limits_{m=1,m\ne n}^{N} \dfrac{ \sin^2\left( \frac{\pi m}{N+1} \right) \left( 1 + (-1)^{n+m} \right) }{ \left( \cos \left( \frac{\pi n}{N+1} \right) - \cos \left( \frac{\pi m}{N+1} \right) \right)^2 }$. Could you give me an advice on how to get rid of that sign-altering part? The same trick from the post of yours does not seem to work now as there is no $k$. Commented Jul 30, 2021 at 15:22