# Evaluating $\sum\limits_{k=1}^{n-1} k\cos (k x)$

My intent is to find an expression for the following summation, $$\sum_{k=1}^{n-1} k\cos (k x).$$ We know that (cfr. Sines and Cosines of Angles in Arithmetic Progression by M. P. Knapp) $$\sum_{k=0}^{n-1} \cos (k x) = \frac{\sin(nx/2)}{\sin(x/2)} \cos\left(\frac{(n-1)x}{2}\right)$$ and I was wondering if something similar can be found if there is a and additional $$k$$-term in the summation. Thank you for your help.

• It's the derivative of the sum over $k$ of $\sin(kx)$, which can be computed similarly to your identity (creatively telescoping, using complex exponentials, etc.) – Simply Beautiful Art Jun 18 '19 at 11:32
• Yes, your comment has led me to the sought answer, thank you very much! – EmFed Jun 18 '19 at 15:47

Using the above suggestion from User Simply Beautiful Art, that is, by writing the expression as a derivative of a sine function, we finally get: \begin{align} \sum_{k=1}^{n-1} k \cos (kx) &= \sum_{k=1}^{n-1} \frac{d}{dx} \sin{kx} \\ &= \frac{d}{dx} \left(\frac{\sin(kx/2)}{sin(x/2)} \sin\left(\frac{n-1}2 x\right)\right) \\ &= \frac 1 2 \left(k \frac{\cos(kx/2)}{\sin{x/2}}-\frac{\sin(kx/2)}{\sin^2(x/2)} \cos(x/2)\right)\sin\left( \frac {n-1} 2 x\right) \\ &+ \frac{n-1}2 \frac{\sin(kx/2)}{\sin(x/2)} \cos\left(\frac{n-1}2 x\right) \end{align} where in the second row we use again the formula from the reference given in the opening post. Thank you for your suggestions!
Hints: Step 1: $$\sum_{k=1}^{n-1}e^{ikx}$$ is a geometric sum. Write down its value. Step 2: differentiate w.r.t. $$x$$. Step 3: divide by $$i$$. Step 4: take real part on both sides.
• Why divide by $i$ and then take the real part instead of simply taking the imaginary part? – Simply Beautiful Art Jun 19 '19 at 2:21