I'm trying to find
$$\sum _{k=1}^{n} k\cos(k\theta)\qquad\text{and}\qquad\sum _{k=1}^{n} k\sin(k\theta)$$
I tried working with complex numbers, defining $z=\cos(\theta)+ i \sin(\theta)$ and using De Movire's, but so far nothing has come up.
I'm trying to find
$$\sum _{k=1}^{n} k\cos(k\theta)\qquad\text{and}\qquad\sum _{k=1}^{n} k\sin(k\theta)$$
I tried working with complex numbers, defining $z=\cos(\theta)+ i \sin(\theta)$ and using De Movire's, but so far nothing has come up.
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
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.
All identities are coming from Wikipedia page for trigonometric identities. The main identity that we start with is: $$ \sum_{k=1}^n \cos(kx)= \frac{ \sin((n+\frac{1}{2}) x)}{2\sin(x/2)} -1 $$ Get a derivative with respect to $x$, and we have \begin{eqnarray*} \sum_{k=1}^n k \sin(kx)&=& \frac{ \cos(x/2) \sin((n+\frac{1}{2})x)- (2n+1) \cos((n+\frac{1}{2})x) \sin(x/2)}{4\sin^2(x/2)}\\ &=& \frac{-2n \cos((n+\frac{1}{2})x) \sin(x/2) + \left( \cos(x/2) \sin((n+\frac{1}{2})x)- \cos((n+\frac{1}{2})x) \sin(x/2)\right)}{4\sin^2(x/2)}\\ &=& \frac{-2n \cos((n+\frac{1}{2})x) \sin(x/2) + \sin(nx)}{4\sin^2(x/2)}\\ &=& \frac{ -n\sin( (n+1)x) + n\sin(nx) + \sin(nx)}{4\sin^2(x/2)}\\ &=& \frac{ -n\sin( (n+1)x) + (n + 1) \sin(nx)}{4\sin^2(x/2)}. \end{eqnarray*}