Summation of the Sine Function I was messing around on Wolfram Alpha's summation calculator and when I plugged in the summation
$$\sum_{i=1}^n\sin\frac{i\pi}{180}$$
and it gave me the value
$$\frac12\left(\cot\frac\pi{360}-\csc\frac\pi{360}\cos\frac{(2n+1)\pi}{360}\right)$$
I don't understand... how does it arrive at this formula? And how do I verify this? If I wanted to, how could I find similar formulas in the future?

We have
$$ 2\sin{A}\sin{B} = -\cos{(A+B)}+\cos{(A-B)} $$
by using the angle addition formulae. Putting $A=ak+b$, $B=a/2$ gives
$$ 2\sin{\left(\frac{a}{2}\right)}\sin{(ak+b)} = -\cos{\left(a\left(k+\frac{1}{2}\right)+b\right)} + \cos{\left(a\left(k-\frac{1}{2}\right)+b\right)}. $$
Summing from $k=1$ to $n$ gives
$$ 2\sin{\left(\frac{a}{2}\right)}\sum_{k=1}^n \sin{(ak+b)} = \sum_{k=0}^n \left(  - \cos{\left(a\left(k+\frac{1}{2}\right)+b\right)} + \cos{\left(a\left(k+\frac{1}{2}\right)+b\right)} \right). $$
The sum on the right telescopes, and the only remaining terms give
$$ \sum_{k=1}^n \sin{(ak+b)} = \frac{1}{2}\csc{\left(\frac{a}{2}\right)} \left( \cos{\left(\frac{a}{2}+b\right)} - \cos{\left(a\left(n+\frac{1}{2}\right)+b\right)} \right) $$
This is essentially the most general formula of its kind: choosing different values for $a$ and $b$ gives a number of useful trigonometric sums. In your case, $a=\pi/180$, $b=0$, which gives
$$ \sum_{k=1}^n \sin{\frac{k\pi}{180}} = \frac{1}{2}\csc{\left(\frac{\pi}{360}\right)} \left( \cos{\left(\frac{\pi}{360}\right)} - \cos{\left(\frac{(2n+1)\pi}{360}\right)} \right), $$
as expected.
These formulae may also be used in integrating the trigonometric functions from first principles.
