find the sum $\sum_{k=1}^{\infty} \frac {\sin^2(kx)}{k^2}$, for $x\in [-\pi,\pi]$ find the sum $$\sum_{k=1}^{\infty} \frac {\sin^2(kx)}{k^2},$$ for $x\in [-\pi,\pi]$.
Also i know that $$\sum_{k=1}^{\infty} \frac {\sin(kx)}{k}=\frac {\pi-x}{2}$$
Any help would be much appreciated.
 A: Write
$$
\sin^2(k\,x)=\frac{1-\cos(2\,k\,x)}{2}.
$$
Can you find a function whose Fourier series is
$$
\sum_{k=1}^\infty\frac{\cos(2\,k\,x)}{k^2}\text{ ?}
$$
A: You can have a closed form in terms of the polylogarithm function

$$\sum_{k=1}^{\infty} \frac {\sin^2(kx)}{k^2}= \frac{\pi^2}{12}-\frac{1}{4}\,{Li_2} \left( {{\rm e}^{2\,ix}} \right) -\frac{1}{4}\,{Li_2} \left( {{\rm e}^{-2ix}} \right). $$

You need to represent $\sin(kx)^2$ in terms of $e^{ikx}$ and then use the polylog function. See here.
A: Consider the sum $$S(x) = \sum_{k\ge 1} \frac{\sin^2 (kx)}{(kx)^2}.$$
The sum term is harmonic and may be evaluated by inverting its Mellin transform.
Recall the harmonic sum identity
$$\mathfrak{M}\left(\sum_{k\ge 1} \lambda_k g(\mu_k x);s\right) =
\left(\sum_{k\ge 1} \frac{\lambda_k}{\mu_k^s} \right) g^*(s)$$
where $g^*(s)$ is the Mellin transform of $g(x).$
In the present case we have
$$\lambda_k = 1, \quad \mu_k = k \quad \text{and} \quad
g(x) = \frac{\sin^2 x}{x^2}.$$
We need the Mellin transform $g^*(s)$ of $g(x)$ which can be obtained by starting with the transform of $\sin^2(x):$
$$\int_0^\infty \sin^2(x) x^{s-1} dx
= \frac{1}{2} \int_0^\infty (1-\cos(2x)) x^{s-1} dx
\\= -\frac{1}{2} 
\int_0^\infty \left(\sum_{q\ge 1} (-1)^q \frac{2^{2q}}{(2q)!} x^{2q} \right) x^{s-1} dx
= -\frac{1}{2} 
\int_0^\infty 
\left(\sum_{q\ge 1} i^{2q} \frac{2^{2q}}{(2q)!} (-x)^{2q} \right) x^{s-1} dx
\\ = -\frac{1}{4} 
\int_0^\infty 
\left(\sum_{q\ge 1} i^q (1+(-1)^q) \frac{2^q}{q!} (-x)^q \right) x^{s-1} dx.$$
Now apply the Ramanujan Master Theorem to obtain the transform
$$-\frac{1}{4}\Gamma(s) i^{-s} (1+(-1)^s) 2^{-s}
= -\frac{1}{4} (e^{-i\pi/2 s} + e^{i\pi/2 s}) 2^{-s}
= -\frac{1}{2^{s+1}} \Gamma(s) \cos(\pi/2 s).$$
This transform can also be computed directly as shown at this MSE link. Here we have used the fact that when we omit an initial segment of the expansion about zero of a function whose Mellin transform we want to compute then the effect is merely to shift the fundamental strip.
The Mellin transform $g^*(s)$ of $g(x)$ is thus given by
$$-\frac{1}{2^{s-1}} \Gamma(s-2) \cos(\pi/2 s-\pi)
= \frac{1}{2^{s-1}} \Gamma(s-2) \cos(\pi/2 s).$$
It follows that the Mellin transform $Q(s)$ of the harmonic sum $S(x)$ is given by
$$Q(s) =
\frac{1}{2^{s-1}} \Gamma(s-2) \cos(\pi/2 s)
\zeta(s).$$
The Mellin inversion integral here is
$$\frac{1}{2\pi i} \int_{3/2-i\infty}^{3/2+i\infty} Q(s)/x^s ds$$
which we evaluate by shifting it to the left for an expansion about zero. There is a lot of cancellation among the poles from the gamma function since the cosine term cancels the ones at the odd negative integers and the zeta term with its trivial zeros the ones at the even negative integers. This leaves just two poles with their residues to the left of $\Re(s) = 3/2$:
$$\mathrm{Res}(Q(s)/x^s; s=1) = \frac{\pi}{2x} \quad\text{and}\quad
\mathrm{Res}(Q(s)/x^s; s=0) = -\frac{1}{2}.$$
This gives $$S(x) = \frac{\pi}{2x} -\frac{1}{2}$$ on $(0,\pi)$ and for the original quantity we were looking for
$$x^2 S(x) =  \sum_{k\ge 1} \frac{\sin^2 (kx)}{k^2}
= \frac{\pi}{2} x - \frac{1}{2} x^2.$$
this time for $[0,\pi).$ That was quite a computation for a simple answer but it allowed us to showcase Mellin transforms and the Ramanujan Master Theorem.
Remark. Use $$ \frac{\pi}{2} |x| - \frac{1}{2} x^2 $$ 
to extend this to $(-\pi,\pi).$
A: Unless I am missing something, Parseval's theorem tells us that
$$\sum_{k=-\infty}^{\infty} \frac{\sin^2{k x}}{k^2} = \pi |x| \quad x \in [-\pi,\pi)$$
Then
$$\sum_{k=1}^{\infty} \frac{\sin^2{k x}}{k^2} = \frac12 |x| \, (\pi -|x|) \quad x \in [-\pi,\pi)$$
