I am asked to verify the identity
$$\prod_{k = 1}^\infty\left[\frac{(1 + x^{2k - 1})(1 - x^{2k})}{(1 - x^{2k - 1})(1 + x^{2k})}\right] = \sum_{k \in \mathbb{Z}}x^{k^2}.$$
I have tried to simplify the expression inside the product on the left and then use Jacobi's triple product identity to show this but I cannot for the life of me simply the expression.
The LHS is $$\prod_{k=1}^\infty\frac{(1-x^{4k-2})(1-x^{2k})^2}{(1-x^{2k-1})^2(1-x^{4k})} =\prod_{k=1}^\infty\frac{(1-x^{4k-2})^2(1-x^{2k})}{(1-x^{2k-1})^2} =\prod_{k=1}^\infty(1+x^{2k-1})^2(1-x^{2k}) =\sum_{m=-\infty}^\infty z^{m^2}$$ by the Jacobi triple product.