Closed form of a series (dilogarithm)

"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}$.


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$)$.