I found the Fourier series $$ f(x)=\frac{4k}{\pi}\sum_{n \text{ odd}}^{\infty}\frac{1}{n}\sin(n x) \tag 1 $$ for the square wave function $$ f(x)= \begin{cases} \begin{align} -k, \quad -\pi <x<0\\ k, \quad 0<x<\pi \end{align} \end{cases} $$ But the answer is written as $$ f(x)=\frac{4k}{\pi}\sum_{n=1}^{\infty}\frac{1}{2n-1}\sin(2n-1)x \tag 2 $$
How can I find $(2)$ from $(1)$?