# Summation of Cosine Series

Find the summation of the series $$\sum\limits_{k = 0}^n {{{\sin }^2}\left( {\frac{{k + 1}}{{n + 2}}\pi } \right)}$$

My approach is as follow

$$\sum\limits_{k = 0}^n {{{\sin }^2}\left( {\frac{{k + 1}}{{n + 2}}\pi } \right)} \Rightarrow \sum\limits_{k = 0}^n {\left( {1 - \cos \left( {\frac{{2k + 2}}{{n + 2}}\pi } \right)} \right)}$$

$$\Rightarrow \sum\limits_{k = 0}^n {\left( 1 \right)} - \sum\limits_{k = 0}^n {\cos \left( {\frac{{2k + 2}}{{n + 2}}\pi } \right)} \Rightarrow \left( {n + 1} \right) - \sum\limits_{k = 0}^n {\cos \left( {\frac{{2k + 2}}{{n + 2}}\pi } \right)}$$

$$\sum\limits_{k = 0}^n {\cos \left( {\frac{{2k + 2}}{{n + 2}}\pi } \right)} = \sum\limits_{k = 0}^n {\cos \left( {\frac{{2\pi }}{{n + 2}} + \frac{2}{{n + 2}}k} \right)} ;a = \frac{{2\pi }}{{n + 2}};d = \frac{2}{{n + 2}}$$

From the website I got the following formula but the summation of the series is from $$0$$ to $$n-1$$.

$$\sum\limits_{k = 0}^{n - 1} {\cos \left( {a + kd} \right)} = \frac{{\sin \left( {\frac{{nd}}{2}} \right)}}{{\sin \left( {\frac{d}{2}} \right)}} \times \cos \left( {a + \frac{{\left( {n - 1} \right)d}}{2}} \right)$$

Where as in the question it is from $$0$$ to $$n$$, a total of $$n+1$$ terms. How do I proceed

$$\dfrac{\sin\frac{(n+1)d}{2}}{\sin \frac{d}{2}} \cdot \cos(a + \dfrac{nd}{2})$$
For summation from $$0$$ to $$n$$
Move the last term of the sum out of the sum. The remaining sum will match your reference. $$\sum_{k=0}^n f(k) = \left( \sum_{k=0}^{n-1} f(k) \right) + f(n) \text{.}$$