Closed form of a series (dilogarithm) We are all aware of the dilogarithm function (Spence's function):
$$\sum_{n=1}^{\infty} \frac{x^n}{n^2}, \;\; x \in (-\infty, 1]$$
Also it is known that:
$$\sum_{n=1}^{\infty} \frac{\cos n x}{n^2}= \frac{\pi^2}{6}-\frac{\pi x}{2} + \frac{x^2}{4}$$ 
This can be shown by using the known Fourier series $\displaystyle \sum_{n=1}^{\infty} \frac{\sin nx}{n} =\frac{\pi-x}{2}$ and integrating termwise.
My main goal here is to evaluate ${\rm Li}_2(e^{ix})$. I begin by using Euler's identity:
$$e^{ix}=\cos x + i \sin x$$
Hence:
$${\rm Li}_2\left ( e^{ix} \right )= \underbrace{\sum_{n=1}^{\infty }\frac{\cos n x}{n^2}}_{\frac{\pi^2}{6}- \frac{\pi x}{2}+ \frac{x^2}{4}}+ i \sum_{n=1}^{\infty}\frac{\sin nx}{n^2}$$
So what remains now is to evaluate the last series. The only thing I have come up with is to use the Fourier series:
$$\sum_{n=1}^{\infty} \frac{\cos nx}{n} = -\ln \left( 2 \sin \frac{x}{2} \right)$$
and integrate termwise. But I cannot integrate the RHS. I believe that there is no closed form, unless I am wrong ? I'd like your help for the last step.
 A: "What remains" is actually the only nontrivial part of $\operatorname{Li}_2\left(e^{ix}\right)$, given by Clausen function. The fact that one can evaluate cosine series is related to the identity
$$\operatorname{Li}_2\left(z\right)+\operatorname{Li}_2\left(z^{-1}\right)=-\frac{\ln^2\left(-z\right)}{2}-\frac{\pi^2}{6}.$$
Slightly rephrasing, we can rewrite this as $\displaystyle 2\,\Re \operatorname{Li}_2\left(e^{ix}\right)=\frac{\left(x-\pi\right)^2}{2}-\frac{\pi^2}{6}$.
A: Too long for a comment: Here's a little intuitive tip: What do $~\dfrac{\sin t}t~$ and $~\dfrac{\cos t}{t^2}~$ both 
have in common? They are even functions. So, if you notice various series or integrals 
whose summand or integrand belongs to this category having a nice closed form, that 
should not surprise you. For instance, $~\displaystyle\int_{-\infty}^\infty\frac{\sin x}x~dx=\pi,~$ or $~\displaystyle\int_{-\infty}^\infty\frac{\cos x}{1+x^2}~dx=\frac\pi e,~$ 
or $~\displaystyle\sum_{n=-\infty}^\infty'\frac1{n^{2k}}=a_k~\pi^{2k},~$ where the apostrophe represents the omission of the divergent 
term corresponding to $n=0$, and $a_k\in\mathbb Q$. Obviously, if one were to sum or integrate odd 
functions over this entire interval, the result would be $0$ for integrals, and either $0$ or $f(0)$ 
for sums, since the values on $(-\infty,0)$ would cancel those on $(0,\infty)$. So, in this sense, if 
one were to define odd $\zeta$ values as $\zeta(2k+1)=\displaystyle\sum_{n=-\infty}^\infty'\frac1{n^{2k+1}},~$ these would indeed possess 
a very beautiful closed form, namely $0$. Indeed, $~\displaystyle\int_0^\infty\frac{\sin x}{1+x^2}~dx~$ also lacks a known closed 
form, as does $~\displaystyle\sum_{n=1}^\infty\frac{\sin nx}{n^2}.~$ Please do not misunderstand me, there are exceptions to every 
rule, and one might indeed find counter-examples of both kinds, but usually they are trivial 
$($e.g., the odd integrand whose primitive can be expressed in closed form, and then evaluated 
at the extremities of the integration interval, or, in the case of $~\displaystyle\sum_{n=1}^\infty\frac{\cos nx}n,~$ the famous 
Mercator series for the natural logarithm; not to mention a whole infinity of even functions 
whose summation or definite integral simply does not possess a closed form, for the trivial 
reason that the overwhelming majority of functions simply do not have one, and those that 
do are the exception rather than the rule$)$.
