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.