Finding a closed form for $1-2\cos\alpha+3\cos2\alpha+\cdots+(-1)^{n-1}n\cos((n-1)\alpha)$ I would like to find a closed form for the following Sum:
$$C = 1-2\cos(\alpha)+3\cos(2\alpha)+\cdots+(-1)^{n-1}n\cos((n-1)\alpha)$$
I've tried adding it to the sum:
$$S =0-2\sin(\alpha)+3\sin(2\alpha)+\cdots+(-1)^{n-1}n\sin((n-1)\alpha) $$
Then,
$$C+iS = 1-2e^{i\alpha}+3e^{i2\alpha}-...+(-1)^{n-1}ne^{in\alpha} $$
We can multiply by $e^{i\alpha}$ to get:
$$(C+iS)e^{i\alpha} = 0+e^{i\alpha}-2e^{i2\alpha}+3e^{i3\alpha}-...+(-1)^{n-2}(n-1)e^{in\alpha}+(-1)^{n-1}ne^{i\alpha(n+1)}  $$
Adding the above two equations,
$$(C+iS)(1+e^{i\alpha}) = 1-e^{i\alpha}+e^{i2\alpha}-e^{i3\alpha}+...+(-1)^{n-1}e^{in\alpha} +(-1)^{n-1}ne^{i\alpha(n+1)}$$
Which is then a geometric series and hence:
$$(C+iS)(1+e^{i\alpha}) =\frac{1((-e^{i\alpha})^{n}-1)}{(-e^{i\alpha}-1)}+(-1)^{n-1}ne^{i\alpha(n+1)}$$
I have trouble continuing forward,as the expression gets complicated.I was wondering if there is an alternative way or if you could simplify the above expression?
 A: Consider the following:
Let $$f(x)=1+x+x^2+x^3+\cdots+x^n=\frac{x^{n+1}-1}{x-1}.$$
Then$$\begin{align}f'(x)&=1+2x+3x^3++\cdots+nx^{n-1}\\
&=\frac{d}{dx}\left(\frac{x^{n+1}-1}{x-1}\right)\\
&=\frac{(n+1)x^n(x-1)-(x^{n+1}-1)}{(x-1)^2}\\
&=\frac{nx^{n+1}-(n+1)x^n+1}{(x-1)^2}.\end{align}$$
Plugging in $x=-e^{i\alpha}$, we obtain
$$\begin{align}C+iS&=1-2e^{i\alpha}+3e^{i2\alpha}-...+(-1)^{n-1}ne^{in\alpha}\\
&=\frac{n(-e^{i\alpha})^{n+1}-(n+1)(-e^{i\alpha})^n+1}{(-1-e^{i\alpha})^2}\\
&=\frac{n(-1)^{n+1}e^{(n+1)i\alpha}+(n+1)(-1)^{n+1}e^{ni\alpha}+1}{(1+e^{i\alpha})^2}.\end{align}$$
The numerator is less problematic, so we will first concentrate on the denominator.
$$\begin{align}
(1+e^{i\alpha})^2&=(e^{i\alpha/2}(e^{i\alpha/2}+e^{-i\alpha/2}))^2\\
&=\left(e^{i\alpha/2}\cdot 2\cos\frac{\alpha}{2}\right)^2\\
&=4e^{i\alpha}\cos^2\frac{\alpha}{2}.\end{align}$$
This means that
$$\begin{align}
C+iS&=\frac{1}{4}\sec^2\frac{\alpha}{2}\left(n(-1)^{n+1}e^{ni\alpha}+(n+1)(-1)^{n+1}e^{(n-1)i\alpha}+e^{-i\alpha}\right).\end{align}$$
Separating real and imaginary parts is now reasonably simple.

I hope that helps. If you have any questions please don't hesitate to ask.
