If $A=\sum_{n=1}^{3027}\sin(n\pi/2018)$ and $B=\sum_{n=1}^{3027}\cos(n\pi/2018)$, evaluate $A(1-\cos(\pi/2018))+B\sin(\pi/2018)$ 
Let 
  $$A=\sum_{n=1}^{3027}\sin\frac{n\pi}{2018} \qquad B=\sum_{n=1}^{3027}\cos\frac{n\pi}{2018}$$
  Evaluate 
  $$A\left(1-\cos\frac{\pi}{2018}\right)+B\sin\frac{\pi}{2018}$$

I don't know how to do it. I used a smaller case. I changed $3027 \to 3$ and changed the denominator by $2$, and I noticed that the answer is $-1$. I don't know how to solve the bigger case.
 A: I'll generalize the problem a bit, writing $m$ for $3027$ and $2\theta$ for $\pi/2018$.
Adapting the identities proven here, we can write
$$\begin{align}
A &:= \sum_{n=1}^{m}\sin 2n\theta = \frac{\sin(m+1)\theta}{\sin\theta}\;\sin m\theta \\[4pt]
B &:= \sum_{n=1}^{m}\cos 2n\theta = \frac{\sin(m+1)\theta}{\sin\theta}\;\cos m\theta - 1
\end{align}$$
where we subtract $\cos 0=1$ from the cosine sum (and $\sin 0=0$ from the sine sum!) because our summations start at index $1$ instead of $0$. Then we have
$$\begin{align}
A \left(1-\cos 2\theta\right) + B\sin 2\theta 
&= \phantom{+}A\cdot 2 \sin^2\theta + B\cdot 2\sin\theta\cos\theta \tag{1}\\[4pt]
&= \phantom{+}2\sin\theta\;\sin(m+1)\theta\;\sin m\theta \\
&\phantom{=}+ 2 \cos\theta\;\sin(m+1)\theta\;\cos m\theta - 2\sin\theta\cos\theta \tag{2}\\[4pt]
&= \phantom{+}2\sin(m+1)\theta\;\left(\sin\theta\sin m\theta+\cos\theta\cos m\theta\right)-\sin 2\theta \tag{3}\\[4pt]
&= \phantom{+}2\sin(m+1)\theta\;\cos(m-1)\theta -\sin 2\theta \tag{4} \\[4pt]
&= \phantom{+}\left( \sin 2m\theta + \sin 2\theta \right) - \sin 2\theta \tag{5} \\[4pt]
&= \phantom{+} \sin 2m\theta \tag{6}
\end{align}$$
where $(1)$ uses the double-angle identities, $(4)$ uses the angle-difference identity for cosine, and  $(5)$ invokes a somewhat-lesser-known product-to-sum identity.
Restoring the specific values for the problem at hand,
$$2\theta = \frac{\pi}{2018} \qquad m = 3027 \qquad\to\qquad 2m\theta = \frac{3\pi}{2} \qquad\to\qquad \sin 2m\theta = -1 \tag{$\star$}$$
It's a bit of an identity slog, but there it is. $\square$
A: hint
$$B+iA=\sum_{n=1}^{3027}(e^{\frac{i\pi}{2018}})^n$$
