Summing $ \sum _{k=1}^{n} k\cos(k\theta) $ and $ \sum _{k=1}^{n} k\sin(k\theta) $
Solution 1:
HINT:
$$\sum_{1\le k\le n}\left(\cos k\theta+i\sin k\theta\right)=\sum_{1\le k\le n}e^{i k\theta}=e^{i\theta}\cdot\frac{e^{in\theta}-1} {e^{i\theta}-1}$$
Differentiate wrt $\theta$ and equate the real & the imaginary parts
$$\text{On differentiation, the left hand becomes }\sum_{1\le k\le n}k\left(-\sin k\theta+i\cos k\theta\right)$$
Alternatively, if $S=\sum_{1\le k\le n}k\cdot a^k=a+2\cdot a^2+\cdots+(n-1)\cdot a^{n-1}+n\cdot a^n$
$a\cdot S=a^2+2\cdot a^3+\cdots+(n-1)\cdot a^n+n\cdot a^{n+1}$
$$\text{On subtraction,}(a-1)S=n\cdot a^{n+1}-(a+a^2+\cdots+a^{n-1}+a^n)=n\cdot a^{n+1}-\frac{a(a^n-1)}{a-1}$$
$$\implies S=\sum_{1\le k\le n}k\cdot a^k=\frac{n\cdot a^{n+1}}{a-1}-\frac{a(a^n-1)}{(a-1)^2}$$
Putting $a=e^{i\theta},$
$$S=\sum_{1\le k\le n}k\cdot e^{ik\theta}=\frac{n\cdot e^{i(n+1)\theta}}{e^{i\theta}-1}-\frac{e^{i\theta}(e^{in\theta}-1)}{(e^{i\theta}-1)^2}$$ (The derivative method should bring us here,too)
$$S=\frac{ne^{i(n+1)\theta}}{e^{i\frac\theta2}(e^{i\frac\theta2}-e^{-i\frac\theta2})}-\frac{e^{i\theta}(e^{in\theta}-1)}{\{e^{i\frac\theta2}(e^{i\frac\theta2}-e^{-i\frac\theta2})\}^2}$$
As $e^{ix}-e^{-ix}=2i\sin x,$ $$S=\frac{ne^{i\frac{(2n+1)\theta}2}}{(e^{i\frac\theta2}-e^{-i\frac\theta2})}-\frac{(e^{in\theta}-1)}{(e^{i\frac\theta2}-e^{-i\frac\theta2})^2}$$
$$S=\frac{n\left(\cos\frac{(2n+1)\theta}2+i\sin\frac{(2n+1)\theta}2\right)}{2i\sin\frac\theta2}-\frac{(\cos n\theta+i\sin n\theta-1)}{(2i\sin\frac\theta2)^2}$$
$$=\frac{\cos n\theta-1}{4\sin^2\frac\theta2}+\frac{n\sin \frac{(2n+1)\theta}2}{2\sin\frac\theta2}+i\left(\frac{\sin n\theta}{4\sin^2\frac\theta2}-\frac{n(\cos\frac{(2n+1)\theta}2}{2\sin\frac\theta2}\right)$$
Again, $$S=\sum_{1\le k\le n}k\cdot e^{ik\theta}=\sum_{1\le k\le n}k(\cos k\theta+i\sin k\theta)=\sum_{1\le k\le n}k\cdot\cos k\theta+i\sum_{1\le k\le n}k\cdot\sin k\theta$$
Now, equate the real & the imaginary parts
Solution 2:
You can find it here.
$\displaystyle \sum_{k=0}^{n-1}\cos (k \theta) =\frac{\sin(\frac{n\theta}{2})}{\sin ( \frac{\theta}{2} )} \times \cos \biggl( \frac{ (n-1)\theta}{2}\biggr) $ and $\displaystyle \sum_{k=0}^{n-1}\sin (k \theta) =\frac{\sin(\frac{n \theta}{2})}{\sin ( \frac{\theta}{2} )} \times \sin\biggl( \frac{ (n-1)\cdot \theta}{2}\biggr)$
Differentiate it with respect to theta to get the series in that form.