How to estimate this sum? I encounter a problem and I just can't figure out a useful way to estimate it.I have tried taylor expansion but it doesn't work.
I want to know the big O-estimate of $n$ in this formula.
$$\sum_{k=2}^{n}\frac{\cos\frac{\pi}{n+1}}{\cos\frac{\pi}{n+1}-\cos\frac{k\pi}{n+1}}$$
 A: Since $\cos(x)=1-x^2/2+O\!\left(x^4\right)$
$$
\begin{align}
\frac{\cos\left(\frac\pi{n+1}\right)}{\cos\left(\frac\pi{n+1}\right)-\cos\left(\frac{k\pi}{n+1}\right)}
&=\frac{1-\frac{\pi^2}{2(n+1)^2}+O\left(\frac1{n^4}\right)}{\left(1-\frac{\pi^2}{2(n+1)^2}\right)-\left(1-\frac{k^2\pi^2}{2(n+1)^2}\right)+O\!\left(\frac{k^4}{n^4}\right)}\\
&=\frac{2(n+1)^2}{\left(k^2-1\right)\pi^2}+O\!\left(1\right)\\[4pt]
&=\frac{2n^2}{\left(k^2-1\right)\pi^2}+O\!\left(1+\frac{n}{k^2}\!\right)
\end{align}
$$
Therefore
$$
\sum_{k=2}^n\frac{\cos\left(\frac\pi{n+1}\right)}{\cos\left(\frac\pi{n+1}\right)-\cos\left(\frac{k\pi}{n+1}\right)}=\frac{3n^2}{2\pi^2}+O(n)
$$
A: The largest term in the sum is the first term, so the sum is less than 
$$(n-1)\frac{\cos(\pi/(n+1))}{\cos(\pi/(n+1))-\cos(2\pi/(n+1))} <\frac{n-1}{2\sin(3\pi/(2(n+1)))\sin(\pi/(2(n+1)))}$$
using the trig identity for difference of cosines.  The last bit is less than
$$\frac{n-1}{2\sin^2(\pi/(2(n+1))}<\frac{n-1}{2\left(\frac{\pi}{2(n+1)}-\left(\frac{\pi}{2(n+1)}\right)^3 +\cdots \right)^2}$$
by Taylor series.  The series is alternating so the first two terms are a lower bound.  The expression that is left after removing the $\cdots$ is $O(n^7)$.
I'm pretty sure we can do better, but it's a start.  Perhaps the sum is a Riemann Sum for some integral which can be estimated some other way?
