How do I get $$\dfrac{l}{2} - \dfrac{2l}{\pi^{2}}\sum_{n=1}^{\infty} \dfrac{1}{(2n-1)^{2}}e^{-\dfrac{i(2n-1)\pi x}{l}} - \dfrac{2l}{\pi^{2}}\sum_{n=1}^{\infty} \dfrac{1}{(2n-1)^{2}}e^\dfrac{i(2n-1)\pi x}{l}$$ from
$$\dfrac{l}{2} - \dfrac{2l}{\pi^{2}}\sum_{n=0}^{\infty} \dfrac{1}{(-2n-1)^{2}}e^\dfrac{i(-2n-1)\pi x}{l} - \dfrac{2l}{\pi^{2}}\sum_{n=1}^{\infty} \dfrac{1}{(2n-1)^{2}}e^\dfrac{i(2n-1)\pi x}{l}?$$
I've separated out the zeroth term from the rest of the terms, but I'm still unable to get the desired result.
If we want to make the sum from $n=1$ instead from $n=0$, wherever we have $n$ we need to replace by $n-1$. In addition, we can take the $-2n-1$ term and write its as $-(2n+1)$. I also used $(-a)^2=a^2$. So the relevant (middle) term is transformed in the following way: $$\begin{align}\sum_{n=0}^\infty\frac1{(-2n-1)^2}e^{\dfrac{i(-2n-1)\pi x}l}&=\sum_{n=0}^\infty\frac1{(2n+1)^2}e^{-\dfrac{i(2n+1)\pi x}l}\\&=\sum_{n=1}^\infty\frac1{(2(n-1)+1)^2}e^{-\dfrac{i(2(n-1)+1)\pi x}l}\\&=\sum_{n=1}^\infty\frac1{(2n-2+1)^2}e^{-\dfrac{i(2n-2+1)\pi x}l}\\&=\sum_{n=1}^\infty\frac1{(2n-1)^2}e^{-\dfrac{i(2n-1)\pi x}l}\end{align}$$