<s>[INST] Estimation of sum of series with cosine Prove the following:
$$
\sum_{{\large j = 1} \atop {\large j \neq k}}^{n}
{1 \over \left\vert\cos\left(k\pi/ n\right) -
\cos\left(j\pi/n\right)\right\vert} \leq cn^{2}
\qquad\mbox{where}\quad 1 \leq k \leq n\quad\mbox{is fixed.}
$$
I was able to get the upper bound to be $cn^{3}$.
Any method can be used for getting the desired bound.
I also tried taking the upper bound in terms of an integral.
I will appreciate any suggestions.
 [/INST] By sum-to-product formulae, the sum $S(n)$ equals
$$S(n)=\frac12\sum^n_{j=1}\left|\csc\frac{(j+k)\pi}{2n}\csc\frac{(j-k)\pi}{2n}\right|$$
By Cauchy-Schwarz inequality,
$$S(n)\le\frac12\sqrt{
\underbrace{\sum^n_{j=1}\csc^2\frac{(j+k)\pi}{2n}}_{S_1}
\cdot\underbrace{\sum^n_{j=1}\csc^2\frac{(j-k)\pi}{2n}}_{S_2}}$$
Regarding $S_1$,
$$
\begin{align}
S_1
&=\sum^n_{j=1}\csc^2\frac{(j+k)\pi}{2n} \\
&=\sum^{n+k}_{j=k+1}\csc^2\frac{\pi}{2}\frac jn \\
&=\sum^{n}_{j=k+1}\csc^2\frac{\pi}{2}\frac jn +\sum^{n+k}_{j=n+1}\csc^2\frac{\pi}{2}\frac jn\\
&=\sum^{n}_{j=k+1}\csc^2\frac{\pi}{2}\frac jn +\sum^{k}_{j=1}\csc^2\frac{\pi}{2}\left(1+\frac jn\right)\\
&=\sum^{n}_{j=k+1}\csc^2\frac{\pi}{2}\frac jn +\sum^{k}_{j=1}\sec^2\frac{\pi}{2}\frac jn\\
&\le \sum^{n}_{j=k+1}\csc^2\frac{\pi}{2}\frac jn+k \sec^2\frac{k\pi}{2n}\\
&\le \sum^{n}_{j=k+1}\frac{n^2}{j^2}+k \sec^2\frac{k\pi}{2n} \qquad\text{NB: }x\csc\frac{\pi x}{2}\le1 \text{ for }|x|\le 1\\
&\le\frac{\pi^2}{6}n^2+k \sec^2\frac{k\pi}{2n}
\end{align}
$$
Thus, $S_1=O(n^2)$.
Regarding $S_2$,
$$
\begin{align}
S_2
&=\sum^{k-1}_{j=1}\csc^2\frac{(k-j)\pi}{2n}+\sum^n_{j=k+1}\csc^2\frac{(j-k)\pi}{2n} \\
&=\sum^{k-1}_{j=1}\csc^2\frac{\pi j}{2n}+\sum^{n-k}_{j=1}\csc^2\frac{\pi j}{2n} \\
&\le\sum^{k-1}_{j=1}\frac{n^2}{j^2}+\sum^{n-k}_{j=1}\frac{n^2}{j^2} \\
&\le \frac{\pi^2}{3}n^2
\end{align}
$$
Hence, $S_2=O(n^2)$. Therefore,
$$S(n)=\sqrt{O(n^2)\cdot O(n^2)}=O(n^2)$$
</s>