Integrating the Fourier series to find the Fourier series of $\frac{1}{2}x^2$ 
The function $\phi(x) = x$ on the interval $[-l,l]$ has the Fourier series
  $$x = \frac{2 l}{\pi}\sum_{m=1}^{\infty}\frac{(-1)^{m+1}}{m}\sin\left(\frac{m\pi x}{l} \right) = \frac{2 l}{\pi}\left(\sin\left(\frac{\pi x}{l} \right) - \frac{1}{2}\sin\left(\frac{2\pi x}{l} \right) + \frac{1}{3}\sin\left(\frac{3\pi x}{l} \right) - \ldots \right)$$
  Integrate the series term-by-term to find the Fourier series for $\frac{1}{2}x^2$, up tp a constant of integration (which is then the $\frac{1}{2}A_0$ term in the cosine series). Find the $A_0$ using the standard formula to completely determine the series.

Attempted solution - We have 
\begin{align*}
&\sum_{m=1}^{\infty}\int_{0}^{l}\frac{2l}{\pi}\frac{(-1)^{m+1}}{m}\sin\left(\frac{m\pi x}{l}\right)dx\\
&= \frac{2l}{\pi}\sum_{m=1}^{\infty}\frac{(-1)^{m+1}}{m}\int_{0}^{l}\sin\left(\frac{m\pi x}{l}\right)dx\\
&= \frac{2l}{\pi}\sum_{m=1}^{\infty}\frac{(-1)^{m+1}}{m}\left[-\frac{l}{\pi m}\left(\cos\left(\frac{m\pi x}{l}\right)\Big|_0^l\right)\right]\\
&= -\frac{2 l^2}{\pi^2}\sum_{m=1}^{\infty} \frac{(-1)^{m+1}}{m^2}\left(\cos\left(\frac{m \pi l}{l}\right) - 1\right)\\
\end{align*}
I am not sure where to go from here, any suggestions are greatly appreciated.

What has been given is
$$\frac{x^2}{2} = -\frac{2 l^2}{\pi^2}\sum_{m=1}^{\infty} \frac{(-1)^{m+1}}{m^2}\left(\cos\left(\frac{m \pi l}{l}\right) - 1\right).$$
Now consider:
$$\zeta(2) = \sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}$$
and
\begin{align}
\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n^2} &= \frac{1}{1^2} - \frac{1}{2^2} + \frac{1}{3^2} - \frac{1}{4^2} + \cdots \\
&= \sum_{n=1}^{\infty} \frac{1}{n^2} - 2 \, \sum_{n=1}^{\infty} \frac{1}{(2 n)^2} \\
&= \frac{1}{2} \, \zeta(2) = \frac{\pi^2}{12}.
\end{align}
This then leads to
$$\frac{x^2}{2} = \frac{l^2}{6} -\frac{2 l^2}{\pi^2}\sum_{m=1}^{\infty} \frac{(-1)^{m+1}}{m^2} \, \cos\left(\frac{m \pi l}{l}\right)$$
or
$$\sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{n^2} \, \cos\left(\frac{n \pi x}{l}\right) = \frac{\pi^2}{12} - \left(\frac{\pi x}{2 \, l}\right)^2.$$
