$q$-series identity I have to prove the following identity: $$\sum_{n\geq 0} (-1)^n(2n+1)q^{\frac{n(n+1)}{2}} = (q;q)_\infty^3$$ where $(a;q)_\infty = \prod_{i\geq 0}1-aq^i$ is the $q$-Pochhammer symbol. In my notes the identity is stated as a corollary of Jacobi triple product, whose statement is $$\sum_{n\in\mathbb Z} z^nq^{\frac{n(n+1)}{2}} = (-zq;q)_\infty(-1/z;q)_\infty(q;q)_\infty$$
What I have done so far is to change the range of $n$ to $\mathbb Z$, noting that
\begin{align*}\sum_{n\geq 0} (-1)^n(2n+1)q^{\frac{n(n+1)}{2}} &= \sum_{n\in\mathbb Z} (-1)^n n q^{\frac{n(n+1)}{2}} \\ 
&= \sum_{n\in\mathbb Z} (-1)^n \frac{2n+n^2-n^2}{2} q^{\frac{n(n+1)}{2}} \\
&= \sum_{n\in\mathbb Z} (-1)^n \frac{n^2+n}{2} q^{\frac{n(n+1)}{2}} + \sum_{n\in\mathbb Z} (-1)^n \frac{n-n^2}{2} q^{\frac{n(n+1)}{2}} \\
&= q\left(\sum_{n\in\mathbb Z} (-1)^n q^{\frac{n(n+1)}{2}}\right)' + \sum_{n\in\mathbb Z} (-1)^{n+1} \frac{n(n-1)}{2} q^{\frac{n(n+1)}{2}} \\
&= 0 + \sum_{n\in\mathbb Z} (-1)^{n+1} \frac{n(n-1)}{2} q^{\frac{n(n+1)}{2}} \end{align*}
where the first sum is zero, thanks to Jacobi triple product with $z=-1$.
However, I can't tell if I'm getting closer to my goal. Any hint would be appreciated at this point!
As a side question, I think I'm not getting the Jacobi triple product properly. In the LHS, there are negative powers of $z$. Does this mean that the equality is not happening in $\mathbb C[[z,q]]$ but only for values of $z,q$ where the sum converges? If so, what is the region of convergence of the series?

The theorem is due to Jacobi.
An english-language demonstration can be found in
chapter 19.9, at theorem 357 (with typos) by


*

*G. H. Hardy and E. M. Wright: An introduction to the theory of numbers.
Oxford University press, sixth edition 2008, ISBN 978-0-19-921985-8.
Note: First edition 1938.
The fourth edition seems to be preferable, the sixth has shameful OCR artefacts.


The proof goes like this.
Jacobi's triple product identity, as quoted in the question:
$$\sum_{n\in\mathbb{Z}} z^n q^{n(n+1)/2} =
(-zq;q)_\infty (-\tfrac{1}{z};q)_\infty (q;q)_\infty$$
To get somewhere near $(q;q)_\infty^3$, we want to set $z=-1$.
The problem is then the second product:
Its first factor is $(1+\tfrac{1}{z})$ which becomes zero for $z=-1$.
So let us pull this first factor out:
$$\begin{align}
 (-\tfrac{1}{z};q)_\infty &=
 (1+\tfrac{1}{z}) (-\tfrac{1}{z}q;q)_\infty
\\\therefore\quad
 (-zq;q)_\infty (-\tfrac{1}{z}q;q)_\infty (q;q)_\infty
 &= \frac{\sum_{n\in\mathbb{Z}} z^n q^{n(n+1)/2}}{1+\tfrac{1}{z}}
\\ &= \sum_{n=0}^\infty \frac{z^n+z^{-n-1}}{1+\tfrac{1}{z}} q^{n(n+1)/2}
\\ &= \sum_{n=0}^\infty z^{-n}\frac{z^{2n+1}+1}{z+1} q^{n(n+1)/2}
\\ &= \sum_{n=0}^\infty z^{-n}\,(z^{2n}-z^{2n-1}\pm\cdots-z+1)\,
 q^{n(n+1)/2}
\end{align}$$
Thus, the singularity at $z=-1$ can be removed.
Setting $z=-1$ now gives
$$(q;q)_\infty^3 = \sum_{n=0}^\infty (-1)^n (2n+1)\,q^{n(n+1)/2}$$
which is what we wanted to prove.
