complex/trigonometric series How can I find the solution to the series $\sum_{n=1} ^\infty n^2(\cos(nx) + i \sin(nx))$

As joriki pointed out, the series diverges for real $x$. I will in the following assume that $\text{Im} x >0$.
We have 
$$
\begin{align}
\sum_{n=1}^\infty n^2[\cos(nx) + i \sin(nx)]
&= \sum_{n=0} ^\infty  n^2 e^{i n x} = -\partial_x^2 \sum_{n=0} ^\infty  e^{i n x}\\
&=\partial_x^2 \frac{1} {e^{ix}-1}.
\end{align}$$
